# Choosing the correct flyback diode

Is there a formula to figure out the appropriate flyback diode rating vs the current flowing through a relay? Maybe I'm asking the wrong question and it's only a voltage consideration.

The diode will have to withstand the full operating voltage of the relay (since it will be anti-parallel to it) and also the full operating current since this current will flow through the diode when the relay turns off. This is because the current through an inductor can't change instantaneously (dI/dt is proportional to the voltage across the inductor), which means that once the controlling transistor switches off, the full relay current has to go somewhere.

If you want the relay to turn off faster, you'll have to increase the voltage across it during turn-off, which you can do with an additional Zener diode in series with the flyback diode. That way the current through the relay's coil decays faster. Of course this means that the driver (i.e. transistor) driving the relay has to withstand this higher voltage.

The power rating of the diode most likely won't matter as you're not going to switch the relay at a high enough frequency to dissipate substantial power in the diode. If you want to calculate it anyway, the formula for the diode's power dissipation is P = 1/2 I²Lf, where I is the relay current, L the relay's inductance, and f the frequency at which you switch the relay on and off.

• I appreciate your response and would up vote the answer if I had enough reputation points to do so. Commented May 22, 2021 at 0:37
• @Jonathan S, but we usually use Schottky diodes for the flyback, not Zenors: (1) raspberrypi.org/forums/… (2) raspberrypi.org/forums/… Commented May 22, 2021 at 1:58
• But if you use zeners/TVS as flyback diodes, you will have to put another regular diode in series. Otherwise the Zener will forward conduct, shunting the load. Probably you meant to suggest the Zener in addition, but your post does not emphasize this enough, Imo. Commented May 22, 2021 at 8:00
• @tobalt You're right, I've added that! Commented May 22, 2021 at 10:14
• @tobalt I don't understand. At switch off, the coil will push the collector voltage of the driver transistor up to the supply voltage + 0.7 V roughly, or 0.7 V + V_z if Jonathan S.' zener is applied. Commented May 22, 2021 at 16:11

If you accidentally choose a diode with a lower current rating than the inductor current, you will usually get away with it. Diodes, especially cheap silicon diodes, tend to be 'as tough as old boots' and have a surge current rating orders of magnitude higher than their continuous rating (because they have to survive the switch-on surge into a big reservoir capacitor when used as a bridge rectifier). For instance, a 1 amp 1N400x diode can take a 8 ms surge of 30 A, the 3 A 1N540x will take 200 A, even a 100 mA 1N4148 is rated for a 4 A surge.