Arduino Drives a relay

You can easily drive a relay 5 ,12 or 24 volts easily, giving a very small signal and driving a transistor . As known, out from microcontroller is just a few milamps, so is not enough to drive straight a relay that drains around 30 mA.

In the circuit below, transistor base current is 304μA and Ic  is 25 mA. Relay is 12v. Signal is 5v .

I made this small circuit on my expansion boards. I try to make it exactly as the schematic for better understanding

2 thoughts on “Arduino Drives a relay

  1. I need to control a 12V relay by adruino and wanted to use an optocoupler on it. So the arduino has its 5V and 12V comes from another source and is controlled by the arduino signal.
    I wonder about the advantages and disadvantages of thoose 2 ways – any idea what is better ? 🙂

    1. The disadvantage is that you have to use a second power supply 12 volts for your relay. So, if you must use 12 volt relay, you have to drive your optocoupler from the output of arduino and the output of opto to transistor that is working as switch. The load of the transistor will be the relay 12v.

      If you use 5 volt relay , you need neither 12 volt power supply nor transistor. But you have to use optocoupler. Arduino – optocoupler – 5 volt relay, from the same power supply tha is powered arduino.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2024 Electronics | WordPress Theme: Annina Free by CrestaProject.