So a few weeks ago I introduced the relay, in my planning of what I'd like to appear next in this blog I realised that I forgot to include a mention of precautions that should be taken when dealing with electromagnetic relays.
As you know electromagnets can be used to generate electricity.
you have a coil of wire, you put a magnet inside of it, then you take the magnet away.
the collapsing magnetic field causes electricity to be generated.
When you have energised a relay you have created a magnet. when you turn a relay off you cut electricity going to the coil, the magnetic field collapses, and much like in a generator electricity is generated in the coil.
This spike of electricity occurs in the relay coil, and will travel throughout the circuit, if there are electrically sensitive parts, (transistors, or micro controllers) in the circuit these can be damaged by this electrical charge, which travels backwards through the circuit.
this "back EMF" backward electromotive force, can be limited by putting a diode in parallel with the relay like so:
During normal operation electricity flows from positive to negative.
the relay is energised
When the coil collapses the relay becomes a generator, but a generator that's connectted the wrong way around.
now a large voltage spike is introduced to the circuit, backwards, this voltage spike may be greater than a components maximum rating for reverse polarity connecttion:
the result is that the components may die.
putting a protection diode in means that rather than travelling backwards through the sensitive components, (where not inconsiderable work needs to be done to breakdown a component) the path the voltage spike takes is through the diode right back to the other side of the relay coil.