Sub topic 13
Switching off an inductor: voltage spikes and flyback diodes
This chapter assumes you know v = L di/dt, that inductor current cannot change instantly, and the RL time constant L/R. It also assumes you can read a basic diode circuit.
Why opening a switch causes a spike
An inductor current cannot jump. If a switch interrupts the current in a few nanoseconds, di/dt becomes very large, so v = L di/dt becomes very large too.
Take a 10 mH coil carrying 2 A. Suppose the switch opens and the current falls to zero in 1 µs.
L = 10e-3 # henries
di = -2.0 # amperes (current falls from 2 A to 0)
dt = 1e-6 # seconds (1 microsecond)
v = L * di / dt
print(v) # -20000.0 voltsThe result is 20 kV in magnitude. No real circuit reaches that figure, because the voltage rises until something conducts. Usually the switch contacts arc, or a transistor breaks down. Either one can destroy the switch.
The energy is the same story. The coil holds (1/2) L I² = 0.02 J at 2 A. That energy must go somewhere, and without a path it goes into the arc or the semiconductor.
What the polarity does
While the current flows, the coil voltage is positive at the end where the current enters. When the switch opens, the inductor tries to keep the same current in the same direction. To do that, its voltage reverses polarity. The end that was connected to the supply swings negative, and the switch node swings far above the supply.
The flyback diode
A flyback diode (also called a freewheeling or snubber diode) gives the current somewhere to go. It is placed across the inductor, reverse-biased during normal operation.
- Switch closed: the diode sees the supply voltage in reverse and does not conduct.
- Switch opens: the inductor voltage reverses, the diode becomes forward-biased, and the coil current circulates through the diode.
The switch node is now clamped at about the supply voltage plus one diode drop, roughly 0.7 V for a silicon diode. The spike disappears.
How fast the current decays
After the switch opens, the loop contains the coil, its winding resistance, and the diode. The current decays exponentially with time constant L/R_loop. Here the loop resistance is small, so the current decays slowly. That has a side effect: a relay with a plain diode releases more slowly, because the current takes longer to fall below the drop-out level.
import math
I0 = 0.12 # amperes at the moment of switch-off
L = 0.5 # henries
R = 100.0 # ohms, coil winding resistance
tau = L / R # 5 ms
for k in range(4):
t = k * tau
i = I0 * math.exp(-t / tau)
print(f"t = {k} tau: i = {i * 1000:.1f} mA")Adding a resistor or a Zener diode in series with the flyback diode raises the loop voltage and speeds up the decay. The cost is a higher clamp voltage across the switch.
Common errors
- Installing the diode in the wrong direction. It then conducts when the switch is closed and shorts the supply.
- Using a diode too slow for the circuit, or rated below the coil current. It must carry the full coil current at the moment of switch-off.
- Forgetting that the clamp voltage appears across the switch. A transistor must be rated for the supply plus the diode drop, plus any series clamp element.
- Expecting the diode to help with AC coils. It only works for DC-driven coils.
Check your understanding
Exercise
A relay coil carries 0.25 A at 12 V and has an inductance of 0.2 H. A transistor opens the circuit, and a flyback diode with a 0.7 V drop is connected across the coil. What voltage does the transistor collector see just after turn-off, and what is the coil's stored energy?
Show answer
The diode conducts and clamps the collector at the supply plus the diode drop: 12 V + 0.7 V = 12.7 V. The stored energy is (1/2) L I² = 0.5 × 0.2 × 0.25² = 0.00625 J, or 6.25 mJ. This energy is dissipated in the coil's winding resistance and the diode.
Exercise
Without a flyback diode, why does the voltage across the opening switch rise instead of staying at the supply voltage?
Show answer
The inductor current cannot change instantly. Opening the switch forces di/dt to be very large and negative, so v = L di/dt becomes a large reversed voltage that adds to the supply at the switch node. The voltage keeps rising until an arc or a breakdown gives the current a path.