Skip to content
Electronics 15 min read

Relay Flyback Diode: Why You Need One and Which to Use

Observation recorded
Cinematic poster of lightning lighting up the cloud tops of a tropical storm, seen from orbit, with the title "The Flyback Diode" in large condensed type and the line "Catch the coil's kick.".

A 12 V relay coil draws a modest 43.6 mA. Switch it off with a transistor and, for a few microseconds, the coil tries to keep that 43.6 mA flowing through whatever it can find. TE Connectivity, one of the largest relay makers, says a 12 V relay can generate 1,000 to 1,500 V at turn-off. That is why every relay circuit you have ever seen has a diode across the coil.

What most tutorials skip is that the diode has a cost. It makes the relay release later and its contacts open more slowly, and TE goes as far as saying its impact on relay performance "can be devastating". There is a two-part fix that costs one extra component. This post works through both, with real coil numbers.

Quick answerA relay coil is an inductor, so its current cannot stop instantly; cut it off and the voltage spikes to hundreds of volts. A flyback diode across the coil gives the current a path and clamps the spike to about 0.7 V above the supply. Add a zener in series with the diode to let the current die faster and the contacts open cleanly.
Infographic: Why does a relay need a diode? A drawing shows a relay's copper coil with a flyback diode across its pins. Without suppression a 12 V relay can generate 1,000 to 1,500 V; a diode clamps the transistor to 12.7 V. A line chart of coil current after switch-off, in coil time constants, shows it reaching the 6.5 mA release level after 1.63 tau with a plain diode, sooner with a 560 ohm resistor, and after 0.33 tau with a diode plus 24 V zener, 5.0 times faster. Tiles: 12.7 V on the transistor with a plain diode; 36.7 V with the zener; a 1N4148 suits small relays.
Tap the image to view it full size. View the accessible, editable SVG.

Why does a relay coil create a voltage spike?

An inductor obeys V=L di/dtV = L\,di/dt. While the relay is on, the coil stores energy in its magnetic field, and the current through it cannot change instantly without an infinite voltage. When your transistor turns off in a microsecond or so, it asks the current to go from 43.6 mA to zero in that time. The coil answers with whatever voltage is needed to keep the current flowing.

Our example is an Omron G2R-1 12 VDC power relay: 275 Ω coil, 43.6 mA rated current, 5 ms maximum release time. Omron does not publish the coil inductance, so for the worked numbers below we assume L = 0.5 H. That figure is our assumption for illustration, not a datasheet value. The important ratios in this post do not depend on it, and the end of the post shows how to measure yours.

What the coil "wants" if the switch opens in 1 µs

I0=12 V/275 Ω=43.6 mAdi/dt=0.0436 A/1 μs=43 600 A/sV=L di/dt=0.5×43 600≈22 000 V\begin{aligned}I_0 &= 12\ \mathrm{V}/275\ \Omega = 43.6\ \mathrm{mA} \\ di/dt &= 0.0436\ \mathrm{A}/1\ \mu\mathrm{s} = 43\,600\ \mathrm{A/s} \\ V &= L\,di/dt = 0.5 \times 43\,600 \\ &\approx \mathbf{22\,000\ V}\end{aligned}

Energy that has to go somewhere

E=12LI2=0.5×0.5×0.04362=0.48 mJ\begin{aligned}E &= \tfrac12 L I^2 = 0.5 \times 0.5 \times 0.0436^2 \\ &= 0.48\ \mathrm{mJ}\end{aligned}

It never actually reaches 22 kV. Long before that, something breaks down: the transistor avalanches, or the stray capacitance of the winding and wiring charges up and rings. That is why measured spikes land at hundreds to about 1,500 V. The energy is tiny, under a millijoule, but dumping it repeatedly into a transistor rated for 40 or 60 V is how relay drivers die after a few thousand cycles. The same physics, inductor current refusing to change instantly, is what makes a buck converter work, used there on purpose.

What does a flyback diode actually do?

The diode sits across the coil, reverse-biased while the relay is on, so it does nothing. At turn-off, the coil voltage reverses (the bottom of the coil swings above the supply) and the diode becomes forward-biased. Now the coil current circulates round a small loop, coil to diode and back, and the voltage at the transistor is clamped to the supply plus one diode drop: 12.7 V instead of a kilovolt.

Three schematics of a 12 volt relay coil with 275 ohm resistance switched by a low-side MOSFET from a microcontroller. Left: a 1N4148 flyback diode across the coil, switch sees 12.7 volts. Middle: the diode in series with a 24 volt zener, switch sees 36.7 volts. Right: a bidirectional 33 volt TVS across the coil, switch sees about 45 volts.
Figure 1. Three ways to suppress the coil. Left: plain flyback diode, cathode to +12 V. Middle: diode plus a back-to-back zener, which lets the voltage rise to a chosen limit. Right: a bidirectional TVS (transient voltage suppressor) across the coil, which works without regard to polarity.

The coil current then decays through the coil's own resistance. With nothing but 275 Ω and 0.7 V opposing it, that decay is slow, with time constant τ=L/R\tau = L/R. That slowness is the hidden cost.

The misconception: “the flyback diode protects the relay”

The diode protects the transistor. It does nothing for the relay, and it actively hurts the relay's contacts.

A relay releases when the magnetic pull falls below the return spring's force. The magnetic pull follows the coil current. With only a diode, the current lingers, so the armature lets go later, and it accelerates away more slowly because the field is still partly holding it as it moves. Contacts that separate slowly draw a longer arc, especially when they are breaking a DC or inductive load. TE's application notes describe the result as random "tack welding" of normally-open contacts and recommend against diode-only suppression for relays that switch real loads.

We can put numbers on the delay. After switch-off, the circuit is the coil's inductance and resistance in series with a fixed clamp voltage Vclamp (0.7 V for a diode, 0.7 V plus VZ with a zener). Solving L di/dt=−(iR+Vclamp)L\,di/dt = -(iR + V_{\mathrm{clamp}}):

i(t)=(I0+Ia) e−t/τ−IaIa=Vclamp/R,τ=L/R\begin{aligned}i(t) &= (I_0 + I_a)\,e^{-t/\tau} - I_a \\ I_a &= V_{\mathrm{clamp}}/R,\quad \tau = L/R\end{aligned}

Time to fall to the release current Ir:

tr=τln⁡I0+IaIr+Iat_r = \tau \ln\frac{I_0 + I_a}{I_r + I_a}

We use the G2R's guaranteed must-release level, 15% of rated: Ir=0.15×43.6=6.5 mAI_r = 0.15 \times 43.6 = 6.5\ \mathrm{mA}.

Plain diode (Vclamp = 0.7 V):

Ia=0.7/275=2.5 mAtr=τln⁡(46.1/9.0)=τln⁡5.12=1.63 τ\begin{aligned}I_a &= 0.7/275 = 2.5\ \mathrm{mA} \\ t_r &= \tau \ln(46.1/9.0) = \tau \ln 5.12 \\ &= \mathbf{1.63\,\tau}\end{aligned}

Diode + 24 V zener (Vclamp = 24.7 V):

Ia=24.7/275=89.8 mAtr=τln⁡(133.4/96.3)=τln⁡1.385=0.33 τ\begin{aligned}I_a &= 24.7/275 = 89.8\ \mathrm{mA} \\ t_r &= \tau \ln(133.4/96.3) = \tau \ln 1.385 \\ &= \mathbf{0.33\,\tau}\end{aligned}

Ratio: 1.63 / 0.33 = 5.0× faster with the zener. With the assumed L = 0.5 H, τ=0.5/275=1.8 ms\tau = 0.5/275 = 1.8\ \mathrm{ms}, so 3.0 ms versus 0.6 ms.

Three milliseconds of extra delay may sound harmless, but compare it with the G2R's own release-time specification of 5 ms maximum. The diode can add more delay than the relay's whole rated release time, and worse, the contacts move slowly during the opening that matters for arcing.

Coil current as a percentage of 43.6 milliamps versus time in units of the coil time constant after switch-off. The plain diode curve decays slowly and crosses the 15 percent release level at 1.63 tau; diode plus 560 ohms at 0.59 tau; diode plus 24 volt zener at 0.33 tau; 33 volt TVS at 0.26 tau.
Figure 2. Coil current after switch-off, computed from the equation above for the G2R-1 12 V coil. The time axis is in coil time constants (τ=L/R\tau = L/R) so the comparison holds whatever your coil's inductance. The real release point is usually earlier than the guaranteed 15% level, but the ranking does not change.

The first-order model leaves out one effect that only helps the argument: as the armature moves away, the magnetic gap opens, the inductance drops, and the moving armature induces a back-voltage of its own. A fast-collapsing current lets that motion happen quickly. A slowly decaying one fights it.

How does a diode plus zener fix it?

Put a zener diode in series with the flyback diode, cathode to cathode, as in the middle of Figure 1. During normal operation the rectifier diode blocks. At turn-off, the current flows forward through the rectifier and backward through the zener, which holds its breakdown voltage VZ. The coil now has 24.7 V pushing its current down instead of 0.7 V, and the energy is dumped about five times faster.

The price is a higher voltage on the switch: the supply plus the diode drop plus VZ. Figure 3 shows the trade.

Voltage across the driver transistor versus time after switch-off. With no suppression a spike goes off the chart to hundreds or over a thousand volts. With a plain diode the switch sits at 12.7 volts for a long time. With diode plus 560 ohms it starts at 37 volts and decays. With diode plus 24 volt zener it holds 36.7 volts for 0.4 tau then drops to the 12 volt supply.
Figure 3. Voltage across the switching transistor. The zener version holds 36.7 V briefly and finishes early; the plain diode holds 12.7 V for much longer. Without any suppression, TE quotes 1,000 to 1,500 V for a 12 V relay. The shaded band is above a 40 V transistor rating.

How to choose the zener voltage

Work backwards from your switch's voltage rating:

VZ≤Vrating×derating−Vsupply(max)−VFV_Z \le V_{\mathrm{rating}} \times \text{derating} - V_{\mathrm{supply(max)}} - V_F

60 V MOSFET, 80% derating, 12 V supply that can reach 14.4 V:

VZ≤0.8×60−14.4−0.7=32.9 VV_Z \le 0.8 \times 60 - 14.4 - 0.7 = 32.9\ \mathrm{V}

That calls for a 24 V or 27 V zener. With a 40 V transistor:

VZ≤0.8×40−14.4−0.7=16.9 VV_Z \le 0.8 \times 40 - 14.4 - 0.7 = 16.9\ \mathrm{V}

That calls for a 15 V zener.

Power is not a concern for a small relay. The zener only sees the coil current (43.6 mA peak) for well under a millisecond per release. A 1 W part such as the 1N4749A (24 V) is generous. For relays switched many times a second, multiply the coil energy by the switching rate and check the average.

Comparing the alternatives: diode, resistor, zener and TVS

TE lists four practical options, and they all fit the same equation with a different clamp. A resistor Rs in series with the diode gives a clamp that starts at I0Rs and shrinks as the current decays; TE's sizing rule is simply R=Vpeak/IcoilR = V_{\mathrm{peak}}/I_{\mathrm{coil}}. A TVS across the coil is effectively a zener that works in both directions and needs no separate diode.

Paired bar chart for five suppression methods. Current decay time to the release level in coil time constants: diode only 1.63, diode plus 560 ohm resistor 0.59, diode plus 12 volt zener 0.53, diode plus 24 volt zener 0.33, 33 volt TVS 0.26. Peak switch voltage: 12.7, 37.1, 24.7, 36.7 and 45.0 volts.
Figure 4. The trade-off in one chart, for the 12 V G2R coil. Every method that releases faster does so by letting the switch voltage rise. The zener and TVS give the most speed per volt because they hold a constant clamp until the current reaches zero.

Notice that the 560 Ω resistor and the 24 V zener both put about 37 V on the switch, but the zener releases nearly twice as fast. A resistor's clamp voltage falls with the current, so it is strong at the start and weak when you need it most. A constant clamp spends the whole voltage budget all the way down.

When is a plain diode the right answer? TE notes that when the important load is on the normally-closed contact, slower armature motion can actually reduce contact bounce on closing. A plain diode is also fine when the contacts switch low-power signals, when release timing does not matter, or for very small signal relays where arcing is negligible.

Which diode should you use for a relay?

  • Reverse voltage above the coil supply, with margin. Anything 50 V or more covers 5 to 24 V coils.
  • Current at least the coil current. Peak flyback current equals the coil current at turn-off and only decays from there.
  • Speed does not matter much. Relay coils switch in milliseconds, not nanoseconds.

A Vishay 1N4148 is rated 100 V, 300 mA continuous and 2 A for a 1 µs surge, which covers most PCB relays up to a few watts of coil. A 1N4007 (1,000 V, 1 A) is the universal choice for larger contactor coils. Mount it right at the relay, not back at the driver, so that the current loop is small and the spike never travels down your wires. And check the orientation: stripe to the positive side. Backwards, the diode shorts the supply through your transistor the moment the relay turns on.

How do you measure your relay’s time constant?

Because the conclusions scale with τ, it is worth measuring. TE describes the method: apply rated DC voltage while holding the armature seated, and time how long the coil current takes to rise to about 63% of its final value. That time is τ, and L=τRL = \tau R. With a 1 Ω sense resistor in the ground return and a scope, it takes five minutes. Inductance is higher with the armature seated than open, and it varies with drive level, so measure at rated voltage.

Do solid state relays need a flyback diode?

The input of a solid state relay is an LED, not a coil, so there is nothing to suppress on the control side. The output is a different story. A DC SSR (a MOSFET inside) that switches a solenoid, motor or another relay coil sees exactly the same kickback from that load, so it needs a diode or TVS across the load. AC SSRs switching inductive loads usually need a snubber or varistor instead; follow the maker's guidance.

Short version: always suppress a relay coil. Use a plain diode for signal relays and convenience. For relays that break real current, use a diode plus a zener sized to your transistor's voltage rating, or a TVS, and the contacts will open about five times faster.

FAQ

Do I need a flyback diode on a relay?

Yes, whenever a transistor or IC switches the coil. When the coil current is interrupted the inductance drives the voltage up until something conducts; TE Connectivity notes a 12 V relay can generate 1,000 to 1,500 V. A diode, diode plus zener, TVS or resistor across the coil gives that current a safe path.

Which way does the flyback diode go on a relay?

Reverse-biased during normal operation: the cathode (the striped end) goes to the positive supply side of the coil and the anode to the side connected to the switching transistor. Installed backwards it short-circuits the supply through the transistor as soon as the relay is switched on.

What diode should I use for a relay coil?

Any silicon diode whose reverse voltage rating exceeds the coil supply and whose current rating covers the coil current. A 1N4148 (100 V, 300 mA continuous) suits small 5 V and 12 V relays; a 1N4007 (1,000 V, 1 A) suits larger coils. Speed is not critical for relay coils.

Does a flyback diode slow down a relay?

Yes. With only a diode across the coil, the current decays slowly through the coil's own resistance, so the armature releases later and the contacts open more slowly. For a 12 V coil the current takes about five times longer to reach the release level than with a 24 V zener added in series with the diode.

Do solid state relays need a flyback diode?

Not on the input, which is an LED rather than a coil. But a DC solid state relay that switches an inductive load such as a solenoid or motor still needs suppression across that load, because the load's inductance produces the same kickback the relay coil would.

Sources

  1. TE Connectivity, "Relay Coil Suppression with DC Relays" (1,000 to 1,500 V for a 12 V relay; diode-only effect on contacts; diode plus zener recommendation; resistor sizing R = Vpeak / Icoil; TVS clamping): te.com relay coil suppression
  2. TE Connectivity, "Coil Suppression Can Reduce Relay Life" (slowest flux decay with a simple diode shunt; near-optimal with a zener in series): te.com coil suppression and relay life
  3. TE Connectivity, "Determining Relay Coil Inductance" (L = tR method; seated versus unseated armature): te.com determining relay coil inductance
  4. Omron, G2R PCB power relay datasheet (12 VDC coil 43.6 mA, 275 Ω; must-release 15% min; DC release time 5 ms max): omronfs.omron.com en-g2r.pdf
  5. Vishay, 1N4148 small signal diode datasheet (100 V, 300 mA, 2 A surge at 1 µs): vishay.com/docs/81857/1n4148.pdf
  6. Vishay, 1N4001 to 1N4007 rectifier datasheet: vishay.com/docs/88503/1n4001.pdf
  7. Vishay, 1N4728A to 1N4764A 1 W zener datasheet (1N4749A, 24 V): vishay.com/docs/85816/1n4728a.pdf
  8. Wikipedia, "Flyback diode" (delayed relay drop-out; zener and resistor alternatives): en.wikipedia.org/wiki/Flyback_diode

Method note: decay curves use the first-order L/R model with a constant clamp voltage and ignore armature motion. Coil inductance (0.5 H) is an illustrative assumption; all ratios are independent of it.

Header image: NASA (image iss073e0330134), regraded for this article.

Related observations
Electronics 555 Timer Frequency Formula: Where 1.44 Comes From Projects Building Your Own Quadcopter Drone: Essential Parts and Specifications in India Electronics Button Debounce Capacitor Value: How to Size the RC
Transmit