Drive relay with AVR microcontroller

To drive relay you need more than 20mA – the current can one pin drive. This is why you cannot connect relay directly to microcontrollers pin. To drive relay you need to connect simple amplifier made of one transistor.

Drive relay with AVR microcontroller

One important part of this circuit is the diode, which protects circuit from induction caused when switching relay.

This circuit is more general as instead relay you can connect any other load like lamps, DC motors if you need to control more than one relay, you might consider using ICs like ULN2003 or ULN2803. These ICs have Darlington transistors inside and can drive up to 500mA each.

iDrive relay with AVR microcontroller using ULN2003A

To switch on a relay in this case you need simply write ‘1’ to port pin. And current doesn’t exceed the allowed limit of microcontroller.

Sumber: https://www.scienceprog.com/drive-relay-with-avr-microcontroller/

Leave a Reply