RELAY: A relay is a electromagnetic mechanical ON/OFF switch type. It is used to low power (Voltage or Current) circuit to switch high power drive. It is an electric switch that operates like open and close switch.
This type of relay is not able to connect directly to MCU. Because the MCU can sink is only 15mA while relay needs 100mA
So we need Transistor to interface relay with micro-controller.
Here below given circuits works like a transistor as a electronic switch. When we need more number of relay we can use ULN2003 high voltage and high current darlington transistor array.
each darlinton pari can be operated directly with TTL output or CMOS devices. It operating voltage is maximum 50V and output drive current is 500mA.
Simple Transistor Drive circuit:
Complete micro controller with ULN2003 8 relay drive circuit given below.
Simple S program for the above circuit.
unsigned int x;
int main ()