Tricky Circuit

Relay coil and its flyback diode

The coil keeps going after switch-off

A relay uses a magnetic coil to move switch contacts. A flyback diode provides a path for coil current after the driving switch opens. Watch the stored magnetic energy drain instead of disappearing instantly.

Open interactive experiment

EXPERIMENT BENCH

Change the circuit settings, predict the readings, then check a challenge. These are learning models, with the assumptions explained in each lesson.

Sign in to save progress. Guest progress stays on this device.

Open laboratory in a full window

Why it works

A settled coil is represented by resistance R and inductance L. Release samples its decay through an always-present ideal 0.7 V diode; the laboratory stays powered. No unprotected-voltage mode, contact movement, bounce or real relay release time is simulated.

Vs is coil supply, R winding resistance, L inductance, I coil current and t time after opening the switch. Vsw is switch-node voltage measured from 0 V; D marks the diode. mH is one thousandth of a henry, ms one thousandth of a second and µJ one millionth of a joule of energy. Before release I0 = Vs/R. After release the equation uses exp, exponential decay, and max, which prevents negative current. While current flows Vsw = Vs + 0.7 V; at zero current Vsw = Vs.

Difficulty
  1. Build · Build it

    Power on at supply 5 V, winding resistance 100 Ω and inductance 100 mH. Keep the coil energized: read 50 mA and 125 µJ.

    Need a hint?

    Vs = 5 V; R = 100 Ω; L = 100 mH → I = 50 mA; E = 125 µJ

  2. Explore · Explore the boundary

    With the same 5 V, 100 Ω and 100 mH, release the coil and sample 1 ms after switch-off. Read about 13.969 mA and switch-node voltage 5.7 V.

    Need a hint?

    Vs = 5 V; R = 100 Ω; L = 100 mH; t = 1 ms → I ≈ 13.969 mA; Vsw = 5.7 V

  3. Solve it · Solve the challenge

    Keep 5 V, 100 Ω and 100 mH; sample the released coil at 3 ms. Reach zero current and zero stored energy.

    Need a hint?

    Vs = 5 V; R = 100 Ω; L = 100 mH; t = 3 ms → I = 0 mA; E = 0 µJ

Extra reading and circuit recipes

The coil keeps going after switch-off

The driving switch opens, yet the current cannot stop instantly. The coil’s magnetic field gives up its stored energy and pushes current through a new loop: coil winding and diode. The diode’s orientation makes it block normal supply current and conduct during this decay.

I0 = Vs/R; I(t) = max((I0 + 0.7/R) × exp(−Rt/L) − 0.7/R, 0); E = ½LI²

Initially stored energy is E = ½LI². The winding and diode dissipate it during release. The fixed diode drop adds a voltage opposing the current, and the model stops the decay when the current reaches zero.

A useful pattern

With these 5 V, 100 Ω and 100 mH settings, the current reaches zero at about 2.097 ms. A fixed 0.7 V diode drop makes it reach zero in finite time; a pure exponential alone would approach zero forever.

Beyond the model

A low-voltage flyback path limits voltage stress but keeps current circulating. Real relay contacts may therefore release later than with a higher-voltage clamp; this electrical model does not predict their timing.

A useful trap to avoid

Release samples a previously settled coil; it does not simulate a coil that was energized for only a short time. Zero calculated coil current is not a measurement of when real contacts moved.

Only inductance doubles; supply, resistance and the 1 ms sampling time stay fixed. The remaining coil current…

  1. is larger
  2. is unchanged
  3. immediately becomes zero
Read more

Initial current Vs/R is unchanged, but larger inductance slows its decay, so more current remains at the same elapsed time.

Build it

Use 5 V, 100 Ω and 100 mH with the coil energized. The steady 50 mA stores 125 µJ, and the closed ideal switch sits at 0 V.

I = 50 mA; Vsw = 0 V; E = 125 µJ

Explore the boundary

Keep those values, release the coil and choose 1 ms. Read approximately 13.969 mA, 5.7 V at the switch node and 9.757 µJ still stored.

I ≈ 13.969 mA; Vsw = 5.7 V; E ≈ 9.757 µJ

Change one thing

At 5 V and 100 Ω, compare 100 mH with 200 mH at 1 ms after release. The initial current stays the same, but the larger inductance stores more energy and retains more current.

ti.com