Professional Documents
Culture Documents
A relay is an electromechanical switch, which perform ON and OFF operations without any human interaction. General representation of double contact relay is shown in fig 1.1 Generally, the relay consists a inductor coil, a spring (not shown in the figure), Swing terminal, and two high power contacts named as normally closed (NC) and normally opened (NO). Relay uses anElectromagnet to move swing terminal between two contacts (NO and NC). When there is no power applied to the inductor coil (Relay is OFF), the spring holds the swing terminal is attached to NC contact.
Whenever required power is applied to the inductor coil, the current flowing through the coil generates a magnetic field which is helpful to move the swing terminal and attached it to the normally open (NO) contact. Again when power is OFF, the spring restores the swing terminal position to NC.
Advantage of relay:
A relay takes small power to turn ON, but it can control high power devices to switch ON and OFF. Consider an example; a relay is used t control the ceiling FAN at our home. The ceiling FAN may runs at 230V AC and draws a current maximum of 4A. Therefore the power required is 4X230 = 920 watts. Off course we can control AC, lights, etc., depend up on the relay ratings. Relays can be used to control DC motors in ROBOTICs. Best article submission sites
Types of Relays:
a. SPST (Single Pole Single Throw)
b.
c.
d.
Interfacing
Interfacing
relay
to
8051 microcontroller
There are many ways to interface a relay to 8051 microcontroller. But simple and easy way for beginners is by using ULN2003/ULN2803. In this tutorial, a 5volts operated relay is taken for the demonstration. But the circuits shown can be useful to 12Volts operated relays also.
So the simple way to drive the relay with 8051 microcontroller is by using ULN2003/ULN2803. A ULN driver has 500mA current sinking capability for each output pin. When input pin of ULN driver is at logic high then the corresponding output pin is connected to ground via 500mA fuse. Internally each fuse is designed by using Darlington transistor pair. So interfacing the 8051 microcontroller to relay via ULN driver will not damage the microcontroller port pin. The interfacing circuit is shown in figure1.2.
Figure 1.3 Inductor coil connected across the collector terminal As shown in figure 1.3 the inductor coil is connected at the collector terminal of the transistor. When logic high is applied, the transistor is in ON state, so the current flows along the inductor and transistor. When a logic LOW is applied, the transistor enters into OFF state (OPEN circuit), which in turn stop the current flow. Inductor doesnt allow sudden changes in the current therefore large negative voltage is produce across inductor coil and causes electrons to cross the air gap as shown in figure. Therefore an electric spark/arc is produced across the open terminals of the transistor and it may damage the transistor as shown in figure 1.4
Figure 1.4 Spark Generated when inductor coil current is suddenly off To avoid such problem, place a diode across the inductor coil as shown in below figure. When a power of the coil is OFF, the electric field (produced from the stored magnetic field) finds a path to flow electrons. Therefore the stored energy dissipates in the diode. When the relay coil power is ON, then the diode is not in conducting state. Whenever the power is OFF, the voltage appears across coil forward bias the diode and the current find a path to flow as shown in figure 1.5.
Figure 1.5 Flywheel diode across the inductor coil protects the transistor