Why do I need a diode over the coil contacts on a relay ?

I'm sure the reply to this is common knowledge for those with experience, but I can't understand the purpose of a diode over the coil of a relay.

Don't get me wrong - I have been told I need it, and I don't dispute that, but I would like to understand why.

Any explanation or links in newbie terms (that means small words)?

DaveO:
I'm sure the reply to this is common knowledge for those with experience, but I can't understand the purpose of a diode over the coil of a relay.

Don't get me wrong - I have been told I need it, and I don't dispute that, but I would like to understand why.

Any explanation or links in newbie terms (that means small words)?

When you apply a voltage to a coil is creates a magnetic field. When you remove the voltage the magnetic field collapses and creates a reverse polarity voltage and can be many times the value of the original applied voltage (X4 in my o-scope experiments). This creates a transient voltage pulse that can damage other components in the circuit that are not rated for this polarity or the higher voltage created, things like semiconductors and caps have a maximum voltage limit and breakdown if exceeded. Having a reversed biased diode across the coil allows the diode to conduct for reverse polarity voltages and creates a 'short circuit' across the coil that allows the pulse to be dissipated in the resistance of the coil wiring.

Lefty

Thanks Lefty.

I think I got all of that except for the critical bit at the end ....

retrolefty:
Having a reversed biased diode across the coil allows the diode to conduct for reverse polarity voltages and creates a 'short circuit' across the coil that allows the pulse to be dissipated in the resistance of the coil wiring.

If I look at the following drawing ....

... is the following correct :

  1. under normal conditions, the current runs from point B, thru the coil and out pin A to Gnd.
  2. when the 5V+ is removed, the coil created excess voltage that will probably wreck havoc.
  3. this excess voltage travels out pin A and thry the diode and back into the coil until it dissipates to nothing ( repeatative current drop effect ? ).
  4. if this is the case, what prevents the excess voltage simply going down to Gnd ?

Sorry, but I think I just haven't got my head around this bit.

It is better to focus on the current rather than the voltage.

  1. when the 5V+ is removed, the coil created excess voltage that will probably wreck havoc.

Here is a more accurate description. When the +5V is removed, the coil's current cannot change instantaneously (since it is highly inductive). The collapsing magnetic field around the coil continues to force a current the slowly decays towards 0.

So if the coil current was 1A when +5V is applied, it will continue to be 1A immediately after +5V is removed (and decaying to 0A eventually).

The question is, with the +5V removed, where is that current going? If there is no "easy" path for the current to flow (i.e., terminal B as before) then it will "find a path" which can involve burning through the insulation on the coil's wiring, etc. and this is accompanied by a high voltage because the current decay is very fast (from 1A to 0A as fast as possible). The high voltage is a byproduct of the nearly-instantaneous change in current (towards 0A) because there is just no easy path for the current to follow at this point.

Now with the diode there, we are providing an "easy" path for the current to follow that does not involve burning the coil wire insulation. So current flows from one terminal of the coil (terminal A), through the diode, then back to the coil at terminal B. The voltage at terminal A is therefore limited to ~0.7V higher than terminal B and high voltages are avoided.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

An interesting aspect of this is that one can often hear a difference in the relay's action when switched off between if there is a diode installed or not. When there is no diode the relay's off action is faster and on larger relays one can hear the sharp click sound, but with a diode installed the off action sound is more muted and the speed is a little slower.

I noticed this when checking out a larger industrial 4 pole double throw 24vdc relay at work, using a scope to try and quantify the size and duration of the generated transient pulse. It was quite a short pulse, maybe just a microsecond or so, but easily 100+ volt peak could be seen on the scope.

Lefty

Lefty,

The diode is also termed a "flywheel" diode

The current flows from B to A under normal use
When you switch the relay off the back emf voltage drives a current which flows through the diode from A to B which then circulates back through the coil from B to A. Hence the term flywheel since the diode and coil form a circulating circuit which tries to maintain a current flowing through the coil. However the energy of circulation is dissipated in the coil resistance so "gradually" decreases to zero. I use the term "gradually" but could be exceedingly short.

This is the reason why the relay drop-out is slower with the diode in circuit; because the current through the coil continues to flow (via the diode) after the switch is opened

jack

Or summed up in equation form: V = L . dI/dt - induced voltage = inductance times rate of current change. Using a diode limits the V to 0.7V or so - thus the current falls more slowly. If you use a zener-diode in series with the flywheel diode you can make V bigger and have faster current reduction.

Without the diode(s) the value of V will be 'whatever it takes to force an arc/breakdown that carries the current' - this is typically hundreds of volts and will damage the driving transistor.

The intuitive way to look at inductances is that they give a current 'momentum'.

hi...do i need a diode even if it relay is connected to external 5V power supply, not to arduino? relay have a optocoupler.