Understanding Relays  - Page 1
Forum section: electronics / beginners

author: PotatoBox
author_rank: Regular Contributor
timestamp: November 27, 2016, 04:09:44 am
content: Hello everyone, I'm trying to understand using a diode to protect a micro controller from the relay.In the photo I've attached (please excuse the poor drawings), from watching tutorial videos, the diagram above is the correct way of protecting the relay. But, why is it wired that way? I would have thought it would have been wired like it is in the 2nd diagram. Since diodes only allow current flowing one way, and the relay shoots back massive current once current is taken away from the coil, the diode in the 2nd diagram would take care of it, shouldn't it?

author: CatalinaWOW
author_rank: Super Contributor
timestamp: November 27, 2016, 04:32:48 am
content: The current attempts to continue to flow. The voltage will rise as high as needed to support this current flow. When the diode is connected as shown in your first drawing the current will flow through the diode, and the voltage will be one diode drop for current to continue flowing in the coil, allowing it to decay slowly. When voltage is again applied to the coil the diode steers in to the coil and current increases per the normal inductive time constant.In your second configuration the diode provides no path for continued current flow. The voltage across the coil will increase until it enables current to flow in some path. This may be an output transistor in your drive circuit as it reaches breakdown, it may be between turns of the coil due to arcs in that location, or it may be arcs between external wiring. Arcs and/or breakdown of transistors doesn't guarantee that the magic smoke will get out, but it has a high probability of doing it, if not on first exposure then on some later relay operation. That is why a protection diode is almost always included when a coil is switched in this manner. In some cases a capacitor is used, but this will create a resonant circuit with the coil potentially causing other problems.

author: tautech
author_rank: Super Contributor
timestamp: November 27, 2016, 04:34:55 am
content: Quote from: PotatoBox on November 27, 2016, 04:09:44 amHow high does back EMF get?Answer: as high as it needs to, to break down/cross any current path.Diode across the coil is the correct back EMF control method, not in series with the coil.

author: ruairi
author_rank: Frequent Contributor
timestamp: November 27, 2016, 05:01:01 am
content: W2AEW has an excellent video on this topic

author: Seekonk
author_rank: Super Contributor
timestamp: November 27, 2016, 12:12:08 pm
content: That explanation may not have been obvious. The second diagram is exactly the same as the first. Current still flows in the same direction, except this time it is through your driver circuit. Possibly destroying it. The diode in the second circuit does nothing to protect it.Parallel diodes do slow down a relay if ultra fast speed is important. In those cases a mov or other device is used to limit the voltage to some value can tolerate.

author: Brumby
author_rank: Unknown
timestamp: November 27, 2016, 12:42:30 pm
content: Quote from: PotatoBox on November 27, 2016, 04:09:44 amWhen the relay is turned on, your thinking would be correct - but it's not really helpful.The diode is there for when the relay gets turnedoff.When a relay goes from being off to on, current flows and a magnetic field builds up in the coil that attracts the armature which operates the switching. With power being maintained, the magnetic field is maintained and the relay holds position.What happens when power is removed from the relay, however, is quite something else.The magnetic field now does not have an electric current to maintain it, so the magnetic filed will collapse. Building up the magnetic field is a comparatively slow process - limited by the current supplied by the circuit it is in. However a collapsing magnetic field is limited only by the physics of the situation ... and occurs very quickly. Some simple arithmetic will tell you that the faster a magnetic field changes around a conductor, the greater the potential is generated. Because of this, a relay powered by even 12V can generate hundreds or even thousands of volts when it gets turned off. It's called "Back EMF". Fortunately, the polarity of this back EMF is opposite to the supply voltage, so the reverse diode across the coil is ideal to short out the back EMF and plays no part when the relay is powered.If you wonder about the magnitude of back EMF - just think about the ignition coil(s) in your car. They operate in the same way - "charging up" a magnetic field from 12V and then (when switched off) generating over 10KV in back EMF to zap through a spark plug... (Diesel vehicle drivers, please ignore.)