How to Drive Relays using Transistors and Flyback Diodes to Protect Against Harmful Inductive Voltage Spikes
- 7 days ago
- 2 min read

What it does
Diodes clamp harmful inductive spikes when relays de-energize, protecting surrounding circuitry.
How it works
When relays de-energize, their coil (an inductive element) causes large voltage spikes at the relay-MOSFET junction. Diodes are used clamp this voltage spike to a safe level so it does not exceed the drain-source voltage rating (VDS) of the MOSFET, potentially damaging the device. Here's how it works.
De-energized (initial state). When no voltage is present at the MOSFET's Gate, the MOSFET remains in a high-impedance state and no current flows through the device. There is no voltage drop across the relay's coil, so the relay remains off.
Energized state. When voltage is applied to the MOSFET's Gate, the MOSFET enters a low impedance state and current flows through the device. This creates a voltage drop across the relay's coil, and the relay turns on.
De-energizing state. When voltage is removed from the MOSFET's Gate, the MOSFET enters a high-impedance state and current stops flowing through the device. The relay's coil, however, still has energy stored in its magnetic field which begins to quickly collapse, forcing a massive reverse voltage that tries to keep current flowing through the air or MOSFET. A flyback diode across the relay's coil provides a path for this current to flow and clamps the voltage across the relay's coil to approximately 1 V or less. This approach, while sufficient for most relay applications, has drawbacks in that it causes the relay's magnetic field to collapse more slowly and increases the release time of the relay. This can shorten the life of the relay's contacts due to arcing under heavy loads. To prevent this, a Zener diode can be added to the path along with the flyback diode. This allows a higher voltage to be present across the relay's coil which helps the magnetic field collapse faster and the relay to turn off quicker with less arcing across the relay's contacts. Designers, however, must ensure that the reverse voltage across the Zener and flyback diode pair, when summed with the supply voltage (at the top of the relay) does not exceed VDS of the MOSFET.
