[004] AVR Single-Chip Control Relay

Source: Internet
Author: User
Relay Structure

1. 12 is the two ends of the coil, 1 is the positive end, and 12 is the negative end. (The coil is essentially an electromagnet)

3, 4, and 5 are single-knife and double-throwing switches, and 8, 9, and 10 are single-knife and double-throwing switches.

When the electromagnet does not suck, the public end 4 and 9 of the switch are connected to 3 and 10 respectively.

When the electromagnet is sucked together, the public ends 4 and 9 of the switch are connected to 5 and 8 respectively.

 

Protection of relays:

Generally, a diode is added at both ends of the coil to reduce the damage caused by the induced current to the magnetic line ring. This is because after the relay works, the magnetic line will generate a reverse induction current. Adding a diode can eliminate the induced current.

Schematic diagram of relay connection

Figure 1 <---> 1, 2 <---> 3, 3 <---> 4, 4 <---> 5, 5 <---> 8, 6 <---> 9, 7 <---> 10, 8 <---> 12.

3 and 6 are the single-node and double-throwing switches in the structure diagram.

 

IfPC6 PortA high level, there will be a 5 V electrical potential difference between vcc2 and vcc2. in this way, the current will pass through the coil between 1 and 8, and the coil will be magnetic. Suck together the 3 and 6 single-Throw switches to both ends of otner1 and other2.

At the same time, the three ends are connected to an LED lamp, and the four ends are VCC high potential, which will light up the diode.

Program
/*************************************** **************************************** ** Features: * control led flashes through relays ********************************* **************************************** * ********/# include <iom16v. h> # include <macros. h> # define uint unsigned int # define uchar unsigned charvoid delay (uint MS); void main (void) {ddrc | = bit (6); While (1) {portc | = bit (6); delay (500); portc & = ~ Bit (6); delay (500) ;}} void delay (uint MS) {uint X, Y; For (x = 0; x <MS; X ++) {for (y = 0; y <1141; y ++ );}}
Entity example
The model is SRS 12vdc SL with six pins.

Jump to the resistance x1k. The coil with a fixed value is always closed, and the infinity is always open.

3 and 4 are coils, 5 and 1 are normally closed, 5 and 2 are normally open, and 5 and 6 are directly connected.

The pin that is related to both the common open point and the common closed point is the public end, that is, 5 in the figure.

[004] AVR Single-Chip Control Relay

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.