Coil Back-EMF Explained with Live Circuit Diagrams ── What the Flyback Diode Really Does

Part 1 of the series “Control-Circuit Protection and Troubleshooting with Live Circuit Diagrams”

One of the classic control-circuit failures goes like this: a relay or a solenoid valve is switched off by a PLC transistor output, and at that very instant the output device dies. The culprit is the back-EMF (surge voltage) that the coil in the load generates at the moment of turn-off, and the standard cure is a flyback diode wired in parallel with the coil. ── Well, so far this is in every textbook. But why the diode has to point that way, what you silently give up by adding it, and what happens if you install it backwards ── that part rarely sinks in from a static schematic and a few arrows.

In this article we watch those few milliseconds directly, using live circuit diagrams with real-time voltage and current charts. No protection, flyback diode, diode + Zener, TVS, RC snubber, and the dangerous reversed diode ── all on the same circuit with the same controls, so the differences between the methods are plainly visible. Every figure is interactive: toggle the output with the button and watch the chart spike at the OFF instant with your own eyes.

💡 Tip

If you would rather play with the figures before reading, jump to “The flyback diode ── a return path that kills the surge”. You can switch the protection in and out with a single button ── the highlight of this article.

What this article covers

Common questions and the sections that answer them.

Question Section
What is back-EMF, and why does switching a coil off produce a high voltage? §1
What actually happens if you switch off with no protection? §2 (live figure)
Why does a flyback diode work, and what does its orientation mean? §3 (live figure)
Is it true that a diode makes relays drop out more slowly? §4 (live figure)
What happens if the diode is installed backwards? §5 (live figure)
How do the alternatives (TVS, RC snubber) differ? §6 · §7 (live figures)
Which method should I actually use? §8 (comparison table) / FAQ

1. A coil’s current cannot stop on a dime ── what back-EMF really is

Relay coils, solenoid valves, contactor coils ── most of the “things that move” in a control cabinet are electromagnets, in other words coils. And a coil has one property that resistors and lamps do not: it hates having its current changed abruptly (self-inductance).

While current flows, a coil stores energy in its magnetic field. Open the switch, and the circuit demands “current to zero, right now” ── but the stored energy cannot vanish instantly. So the coil generates a voltage of its own, in whatever direction keeps the current flowing. That is back-EMF, also known as inductive kickback. Its magnitude is proportional to how abruptly the current is being cut, which is why a 24V circuit can casually produce spikes of several hundred volts when switched hard. It is the same story as water hammer: slam a faucet shut and the pipe bangs, because the momentum of the flow has to turn into a pressure spike somewhere. Here, the momentum of the current turns into a voltage spike.

And where does that voltage land? On the device that dared to interrupt the current ── the switching element. With a PLC transistor output that means the output transistor; with a relay contact it means the arc gap of the opening contact. The practical damage: destroyed semiconductors, contacts eroded by arcing, and noise radiated into everything nearby. “The output died the instant the solenoid valve switched off” ── this is what actually happened.

All the figures below share the same skeleton. Left of the vertical boundary is the external side (the coil load and its protection); right is the PLC side, a transistor sink output (NPN). The path is: 24V supply → series 1kΩ resistor → coil → indicator lamp → output transistor → 0V. The “Logic Y0” button on the panel plays the role of the program’s output command. The only thing that changes from figure to figure is the protection component placed across the coil.

These figures carry two pieces of equipment our previous articles did not have. First, the real-time charts above each figure: they plot 【V1】 (the voltage at the output transistor’s collector, C1) and 【I1】 (the coil current), showing a rolling window of roughly the last 0.05 seconds of simulated time. A surge is a one-instant event, so the “spike” left on these charts is your main observation tool. Second, the “Reset circuit” button at the top right of each panel, which reloads the figure back to its initial state whenever you want a clean start.

V1 Voltage at the output transistor’s collector (C1) ── watch for the surge spike I1 Coil current ── watch how fast it decays (= how fast the device releases)

💡 Tip

The 1kΩ series resistor is a teaching value chosen to match the coil current of a small 24V relay (around 20 mA). Also, the simulation only runs while the figure is on screen ── if a chart looks frozen, scroll back to the figure.

2. Switching off with no protection ── the baseline failure (Fig. 1)

The first figure deliberately has no protection at all. Every protection scheme that follows is read against the failure you see here. Turn “Logic Y0” ON, confirm that current flows through the coil, wait a moment, then switch it OFF ── and watch the 【V1】 chart and the C1 readout right after turn-off.

Loading simulator…

Output

C1 = —

V1 C1 [V]

I1 Coil [A]

Built with CircuitJS1 (Paul Falstad / Iain Sharp et al., GPL) · falstad.com/circuit

At the OFF instant the coil tries to keep its current going, but the transistor has stopped conducting and there is no return path. So the coil forcibly drags the switch-side node upward, and a needle-sharp spike far above the supply voltage appears at C1. You will see the panel flash a “surge warning” and a sharp spike remain on the 【V1】 chart. Meanwhile 【I1】 shows the coil current, with nowhere to go, ringing and collapsing.

Do this on real hardware and the transistor dies the moment the spike exceeds its voltage rating. Even if it survives once, the damage accumulates with every switching cycle until one output quietly fails months later ── or the spike travels along the wiring as noise and upsets nearby sensors and communications. All of these are failures seen in real plants.

⚠️ Common Pitfall

“It’s a 24V circuit, so a 30V-rated device has margin” ── that logic does not survive inductive loads. An unprotected surge is set by the coil and by how fast you cut the current, not by the supply voltage, so spikes of many times the supply voltage are completely ordinary. The right fix is not a higher voltage rating but an escape path for the current, as in the next section.

Note: in the simulation the post-OFF voltage rings and then settles. That is because the figure includes a small component equivalent to real-world wiring capacitance and leakage, added so the oscillation does not continue forever.

3. The flyback diode ── a return path that kills the surge (Fig. 2)

The standard cure is a single diode in parallel with the coil ── the flyback diode (also called a freewheeling or snubber diode). Orientation is everything: it goes in the direction that blocks current while the coil is energized (reverse-biased). Remember it as “cathode ── the band mark ── toward the supply’s + side”. During normal operation it might as well not exist; it only works at the OFF instant.

In the figure below you can switch this diode in and out with a button. First leave it at “Flyback diode: Off”, do an ON → OFF cycle, and confirm the surge. Then set “Flyback diode: On” and repeat the exact same steps. Same circuit, same controls ── only the 【V1】 spike disappears.

Loading simulator…

Output

C1 = —

Protection

Protection = none

V1 C1 [V]

I1 Coil [A]

Built with CircuitJS1 (Paul Falstad / Iain Sharp et al., GPL) · falstad.com/circuit

Here is the mechanism. At the OFF instant, the coil generates a voltage in the direction that keeps its current flowing ── and for the parallel diode, that voltage is exactly forward. Instead of having nowhere to go, the coil current now circulates through the diode and around the coil itself (the freewheeling path). Like a flywheel spinning down on its own inertia, the current keeps circulating while the stored energy is quietly dissipated as heat in the coil’s resistance and the diode. Seen from C1, the voltage never rises above the supply plus one diode drop (about 0.7V). A several-hundred-volt needle becomes a 0.7V bump.

No protection (Off) Diode in place (On)
C1 right after OFF 【V1】 Spikes to many times the supply Held near supply + 0.7V
Where the coil current goes Nowhere → surge and ringing Freewheels through the diode
How the current dies 【I1】 Rings and collapses fast Smooth, but lingers longer

The last row of the table is the one honest side effect of this method. Because the freewheeling path dissipates energy so gently, the current takes longer to reach zero. Compare the 【I1】 charts: without protection the current vanishes almost instantly, while with the diode it trails off in a long tail. What that tail means in practice is the subject of the next section.

4. The slow-release side effect, and diode + Zener (Fig. 3)

A relay or a solenoid valve releases ── the contact opens, the valve closes ── when its coil current falls below a certain level. So slow current decay means slow release, plain and simple. With a bare flyback diode, the voltage across the freewheeling loop is only about 0.7V, the current decays slowly, and a relay’s release time can stretch to several times its unprotected value. Manufacturers state this openly in their technical notes ── “surge suppressors lengthen release time” ── it is a well-known trade-off. For high-cycle-rate applications, or wherever the exact moment a contact opens matters to the control logic, this cannot be ignored.

The fix is not to remove the protection, but to raise the voltage at which the surge is clamped, on purpose. In the figure below, the freewheeling path contains a diode and a Zener diode (33V) in series. At turn-off, C1 tops out around “supply + 0.7V + 33V” ── still comfortably below the transistor’s rating, but because the energy is burned at a much higher voltage than a bare diode allows, the current visibly returns to zero sooner.

Loading simulator…

Output

C1 = —

V1 C1 [V]

I1 Coil [A]

Built with CircuitJS1 (Paul Falstad / Iain Sharp et al., GPL) · falstad.com/circuit

Same controls as before: ON → wait → OFF. Compare with “diode On” in Fig. 2: the 【V1】 plateau sits higher, and in exchange the 【I1】 tail is shorter. “How much surge do I tolerate” versus “how fast must it release” is a straight trade, and the Zener voltage is chosen from the device’s voltage rating on one side and the release-time requirement on the other. That is the design thinking behind this method.

💡 Tip

Many commercial solenoid valves and relay sockets come with a built-in protection diode (or diode + Zener equivalent). With those, no external diode is needed ── but note that the coil now has polarity. Wire + and − backwards and you get exactly the reversed-diode accident of the next section.

5. Install it backwards and it is not protection ── it is a short (Fig. 4)

⚠️ Dangerous demo

This figure is wired wrong on purpose. On real hardware this destroys components, so even in the simulator, tap “Logic Y0” only briefly and switch it straight back off.

The scary failure mode of the flyback diode is not forgetting it ── it is installing it backwards. A reversed diode is forward-biased exactly while the output is ON. The component that was supposed to protect the coil becomes a bypass that short-circuits the coil the moment it is energized, and a large current pours through the path: supply → series resistor → diode.

Loading simulator…

Output

C1 = —

V1 C1 [V]

I1 Coil [A]

Built with CircuitJS1 (Paul Falstad / Iain Sharp et al., GPL) · falstad.com/circuit

The moment you switch ON, the current dots run through the diode instead of the coil, and the coil barely works at all (a relay simply would not pull in). The teaching circuit has a series resistor limiting the damage, but real wiring has no such resistor ── the result is a burnt diode, a power supply in protective shutdown, or a destroyed output device. If the symptom is “we added the protection part, now the relay won’t operate ── and the part is hot”, suspect a reversed diode first.

Checking the orientation is simple. The diode’s band mark (cathode) goes toward the supply’s + side. With diode-equipped solenoid valves or relays, match the coil terminals’ +/− markings against the supply polarity. Those two checks are all it takes to rule this accident out.

6. The TVS diode ── clamping at a chosen voltage (Fig. 5)

A ready-made component built around the same idea as diode + Zener is the TVS diode (Transient Voltage Suppressor). It normally behaves as an insulator, and only when the voltage across it exceeds its design value does it conduct, capping the voltage right around that level. Being purpose-built for surge absorption, it responds fast and tolerates large momentary currents. In the figure below, a unidirectional TVS is approximated by a Zener diode (33V) placed across the coil.

Loading simulator…

Output

C1 = —

V1 C1 [V]

I1 Coil [A]

Built with CircuitJS1 (Paul Falstad / Iain Sharp et al., GPL) · falstad.com/circuit

Run the usual ON → OFF cycle and confirm two things: the 【V1】 peak tops out near 33V, and because the clamp voltage is high, the 【I1】 tail is shorter than in Fig. 2 ── faster release. For the TVS to stay inert during normal operation, its standoff voltage must be above the supply voltage, and how close above the supply you can set it is the key selection question. Real parts come in unidirectional and bidirectional versions with power-rating calculations of their own ── that belongs to a sequel in this series.

7. The RC snubber ── the entry point when a diode won’t do (Fig. 6)

Every protection so far used a polarized component. Which means: none of them can be used as-is on an AC coil, where the current reverses every half-cycle ── the diode would be forward-biased on one half-cycle and repeat the short circuit of Fig. 4. For AC coils, and for protecting relay contacts themselves, the usual choice is a resistor and capacitor in series: the RC snubber (also sold as “spark killers” or contact protectors).

Loading simulator…

Output

C1 = —

V1 C1 [V]

I1 Coil [A]

Built with CircuitJS1 (Paul Falstad / Iain Sharp et al., GPL) · falstad.com/circuit

At turn-off, the coil current that was about to be stranded flows into the capacitor first. A capacitor is precisely the component that absorbs abrupt voltage changes, so the C1 spike is blunted, while the series resistor tames the inrush and the ringing. Compared with Fig. 1, the 【V1】 peak is milder and its edges rounder. It is not the near-perfect hard clamp a diode gives you ── but having no polarity, it works on AC as well as DC, and that is its whole point. The values in the figure (0.1µF + 100Ω) are teaching values; real designs pick them from the load and the voltage (commercial spark killers come with the pair pre-selected).

8. Choosing a method ── first “DC or AC”, then “how fast must it release”

Here is everything from the six figures on one sheet. There is no perfect protection component: you choose by three questions ── how hard must the surge be suppressed, how fast must the device release, and is the coil DC or AC. That is the conclusion as of part 1.

Method Surge suppression Release speed Typical use In one line
None (Fig. 1) Destroys devices and contacts. Not an option
Diode (Fig. 2) Strongest Tends to be slow DC coils The default choice. Mind the orientation
Diode + Zener (Fig. 3) ✓ Strong Relatively fast DC coils When release time matters
TVS (Fig. 5) ✓ Design-dependent Relatively fast DC circuits Off-the-shelf clamp, fast response
RC snubber (Fig. 6) △ Design-dependent Relatively fast AC/DC, contacts No polarity ── works on AC

Placement follows a fixed rule too: put the protection component as close to the coil’s terminals as possible. The coil is the surge source, and the closer to the source you suppress it, the shorter the stretch of wiring that ever carries the high voltage. Some PLC output units have surge-absorption circuitry built in ── treat that as the last line of defense, not as a substitute for protection at the load.

In the sequels to this series we will cover the topics this article only pointed at: where the current goes when a DC motor is stopped (regeneration), a dedicated figure on why a plain diode cannot be used on an AC coil, and RC networks and varistors on the contact side ── all in the same live-circuit format.

Summary ── a surge is harmless once the current has somewhere to go

  • A coil’s current cannot stop instantly. Force it, and the coil generates a high voltage in whatever direction keeps the current flowing ── and that voltage lands on the switching device (§1, §2).
  • A flyback diode creates an escape path (freewheeling path) that exists only at the OFF instant. Orientation: band mark (cathode) toward the supply’s + side (§3).
  • The trade-off: diode protection slows the current decay, delaying relay and valve release. Where release time matters, raise the clamp voltage with diode + Zener or a TVS (§4, §6).
  • Installed backwards, the diode becomes a short circuit while energized. “We added protection and now it won’t operate ── and the part is hot” is the classic sign (§5).
  • Polarized protection cannot be used on AC coils. The RC snubber is the AC/DC-agnostic entry point (§7).
  • Protect right at the coil terminals; built-in protection on the PLC side is the last line of defense (§8).

The groundwork for this article ── PLC transistor (sink) outputs and how coil loads are wired ── is covered in “Understanding PNP and NPN in Electrical Design with Live Circuit Diagrams” and “Relay, Transistor, or Triac? Understanding PLC Output Types with Live Circuit Diagrams”, using the same interactive figures.

FAQ

Q1. What is back-EMF, in one sentence?

A. It is the voltage a coil generates on its own to keep its current flowing. The more abruptly the current is cut, the higher it gets ── several hundred volts even in a 24V circuit. It is also called surge voltage or inductive kickback.

Q2. Where exactly should the flyback diode go?

A. In parallel with the coil (relay, solenoid valve, etc.), as close to its terminals as possible. The coil is the surge source, so suppressing it at the source keeps the high voltage off the wiring. Mounting it at the load beats mounting it at the PLC terminal block.

Q3. How do I remember the diode orientation?

A. “Band mark (cathode) toward the supply’s + side.” Correctly installed, it carries no current while the coil is energized (reverse-biased) and freewheels the coil current only at turn-off. After installation, energize the coil and check that the diode stays cold ── that confirms it.

Q4. Is it true that a diode makes relays release more slowly?

A. Yes. The freewheeling voltage is only about 0.7V, so the current decays slowly and the release time can be several times the unprotected value. If release speed matters, raise the clamp voltage with diode + Zener or a TVS (§4, §6).

Q5. How do I pick the diode itself?

A. As a rule of thumb: reverse-voltage rating at least twice the supply voltage, forward-current rating at least the coil current. For a 24V relay coil, a garden-variety rectifier diode (1A, few-hundred-volt class) covers most cases. Confirm the final choice against the load’s and the diode’s datasheets.

Q6. Can I put a diode on an AC coil (AC solenoid valve, AC contactor)?

A. No. AC current reverses direction every half-cycle, so a polarized diode is guaranteed to short one of the half-cycles ── the same situation as the reversed diode in §5. Use non-polarized protection on AC coils: RC snubbers or varistors. A dedicated figure on why is planned for a sequel.

Q7. My PLC output unit has built-in protection. Do I still need an external one?

A. Treat the built-in circuit as the last line of defense. It reduces the chance of instantly killing the output device, but it does nothing about surges riding the wiring, radiated noise, or contact wear elsewhere. For inductive loads, protection at the load remains the baseline.

Q8. What about switching a coil with a relay contact instead of a transistor?

A. Same thinking: protect the coil being switched ── diode family for DC, RC or varistor for AC. Without protection, arcing across the opening contact erodes it and cuts the relay’s life by orders of magnitude. There is also the option of an RC network directly across the contact, which a sequel will cover.

Q9. Anything to watch for with diode-equipped solenoid valves and relays?

A. The coil acquires polarity. The built-in diode’s orientation assumes the +/− wiring is correct, so reversed wiring turns the built-in diode into a short-circuit path the moment power is applied (§5). Never skip checking the terminal markings against the supply polarity.

Q10. How does the simulation differ from real hardware?

A. The figures are stripped down to the skeleton of the principle. The coil is a teaching value (50mH with a 1kΩ series resistor), and wiring inductance, stray capacitance, temperature effects, and contact arcing are all omitted (the unprotected figures include just enough wiring-capacitance/leakage equivalent to keep the ringing from lasting forever). Use the figures to understand the principle; use manufacturers’ datasheets for real design numbers.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *