You are on page 1of 2

Drive LED or Opto-isolators with AVR

Control 7 segment LED displays with AVR

Drive relay with AVR microcontroller


By ScienceProg | 12 May, 2006 | AVR Microcontrollers

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.

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.

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

You might also like