lunedì 3 dicembre 2012

Why do we need a diode in reverse parallel to a relay?

When we drive a relay with a transistor we always see a diode in reverse parallel with it. Is just a precaution, some sort of ritual, can we remove it? The answer is NO, we can't remove it, it is not ritual, and avoiding to use it is a dangerous ( at least for the driver ) error.
Lets use the same circuit we see when we talk about saturation, but just put a coil instead of a resistive load. Even if there is no more the resistor, I put a series resistor of 46 Ohm in the coil parameters. The 46 mH inductance is not a random value, but a reasonable value for a mini relay for PCB.
As we can see there is not the required diode. What we could expect? The interesting part happens when the transistor switch off. When the transistor is on, into the coil there is a certain amount of energy as a magnetic field. By breaking the current such energy should dissipate somewhere, and this would happen as a current flowing into the coil itself and the parasitic capacitance of the circuit. Lets try to simulate the circuit to see how this happens:
The green line is the voltage on the BJT collector. Amazing! the voltage goes to more than 200V! Even if the highest voltage on the whole circuit is just 12 V ! So can you imagine what's happn to the poor BJT after some switches? It will probably die ungloriously :(
Let's try to add the always present diode:
We expect the energy now dissipate on the coil resistence trought the diode, so we have this result in simulation:
Now the blue line is the voltage on the transistor collector. There is still a little spike, but it is at most 13V, a voltage the BJT can easily play with, and now the circuit is safe.











So I really hope I managed to show why the opposite parallel diode is needed, in an easy to understand way.

1 commento: