This question already has an answer here:

I'm looking at connecting relays,

In the schematic found on this site, the diode is placed in parallel. Why would this be the case? If the diode is there to circumvent large voltage flow back, wouldn't this skip pass the diode and go straight to the arduino?



marked as duplicate by Leon Heller, Ricardo, PeterJ, Olin Lathrop, Daniel Grillo Dec 26 '14 at 15:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • \$\begingroup\$ For a great demonstration and explaination, have a look at this video by w2aew: youtu.be/c6I7Ycbv8B8 \$\endgroup\$ – tehwalris Dec 26 '14 at 11:49
  • \$\begingroup\$ -1 It is answered many times. Please correct keywords and dig..dig...dig. There are lot of work inside here. This is not a facebook wall!!! \$\endgroup\$ – GR Tech Dec 26 '14 at 14:04

Yes, it is there to "bleed off" large reverse voltages (back EMF) generated by the magnetic field in the coil as it collapses.

Why would this be the case? If the diode is there to circumvent large voltage flow back, wouldn't this skip pass the diode and go straight to the arduino?

Why would it want to do that, when there is a nice short low-resistance path right there through the diode? If you want to pop next door to borrow some sugar, do you just open your door, walk a few feet, and knock on their door, or do you get the car out, drive to the next town and back, park the car, get out, and knock on your neighbour's door? Current is just as lazy as you or I - it takes the shortest, easiest, route.

  • \$\begingroup\$ You should add that the reason this works is that the power supply is much more able to absorb the EMF than the Arduino. It does, after all, have to go somewhere. \$\endgroup\$ – WhatRoughBeast Dec 26 '14 at 13:32
  • 1
    \$\begingroup\$ @WhatRoughBeast It does not not go into the power supply when the diode is parallel to the coil. The energy in the coil inductance is absorbed by the coil resistance (and the voltage drop across the diode, to a lesser degree). \$\endgroup\$ – Spehro Pefhany Dec 26 '14 at 16:07

Although mentioned in the references above adequately, the important thing to understand about inductors is that they operate with current, a voltage is then induced according to the time variation of current in the inductor.

So you always need to think about the current. It's like a garden hose, you can't start and stop the flow instantly, it needs time to build up and decay, switch the flow too quickly and you will get water hammer in the hose. If you need to accurately fill a bucket with a hose, then you need to divert the flow when the desired level is reached.

So when voltage is first applied to a relay coil the current slowly builds up, let's say it takes 8milliseconds at 12V until you get 20mA through the coil. When you need to turn off the relay, the current is still flowing, and the voltage will reverse because the current is still trying to flow (but has nowhere to go), and (without the diode) it might rise to 120v for 0.8milliseconds to discharge the coil. To prevent damage, What you need to do is divert the 20mA somewhere else, that's what the diode does, the current circulates around the diode and coil. (It doesn't go back to the supply as mentioned elsewhere), the energy is dissipated in the coil resistance and the diode.

Going back to the hose analogy, to "turn off" the flow , we simply connect the hose outlet to the hose inlet, water will continue to circulate briefly in the closed loop, but there won't be any water hammer in the hose.


Not the answer you're looking for? Browse other questions tagged or ask your own question.