Skip to content
You Start with one site
Amounts in Start with one site
Electronics · Concept

Diode and the flyback diode

One idea Beginner 5 min read
Found this useful?

A check valve in a water pipe lets water through in one direction and stops it in the other. A diode is that valve for current. Its most common job in equipment is the flyback diode: one diode across each coil that a transistor switches, so that the coil cannot destroy the transistor.

The coilA coil resists any change in its current.It keeps the current flowing
No diodeThe current has nowhere to go, so the voltage rises until something breaks.A spike of hundreds of volts
With a diodeThe current flows around the coil and the diode until it dies away.The collector stays near 5.7 V

See it

Predict first

A transistor switches off a 5 V relay coil that has no diode across it. At that moment, what does the voltage at the transistor's collector do?

Watch it build: a relay coil, a transistor and a diode
+5 V relaycoil 0 V pin 3.3 V: on 3.3 V: on 0 V: off 0 V: off coil current70 mAtransistor on collectorabout 700 V the transistorblocks only 40 V no diode cathode anode diode0 mAit blocks collector5.7 Vsafe loop current70 mA → 0in a few ms
  1. The transistor is on. 70 mA flows down through the relay coil.
  2. The transistor switches off with no diode. The coil raises the collector to hundreds of volts.
  3. A diode across the coil, cathode to +5 V. While the transistor is on, the diode blocks.
  4. The transistor switches off. The coil current flows around through the diode. The collector stays at 5.7 V.
  5. The loop current dies away in a few milliseconds, and the relay releases.

The idea

A relay coil is a coil of wire, and a coil resists any change in its current. While the transistor is on, 70 mA flows down through the coil.

Switch the transistor off and the coil tries to keep its 70 mA flowing. With nowhere to go, it raises the collector voltage as high as it must:

V = L × ΔI ÷ Δt

V is the voltage the coil makes, L its inductance in henries, ΔI the change of current in amperes, Δt the time of the change in seconds

A diode has two leads: the anode and the cathode. A stripe on the body marks the cathode. Current flows from anode to cathode once the anode is about 0.7 V more positive (for silicon), and almost none flows the other way. Fit one across the coil with its cathode to +5 V. While the transistor is on, it is reverse biased and does nothing.

When the transistor switches off now, the coil current flows around the loop of coil and diode. The collector rises only to 5 V + 0.7 V = 5.7 V.

The current dies away in a few milliseconds, so the relay releases a little later. This does not work on a coil fed with AC, which needs a different suppressor.

One worked number

The question

A relay coil of 0.1 H (a typical small relay) carries 70 mA. The transistor stops the current in 10 µs. What voltage could the coil make with no diode, and what does the collector reach with one?

Show the worked solution, 3 steps
  1. Write everything in base units

    L = 0.1 H, ΔI = 0.070 A, Δt = 10 µs = 0.000010 s.

  2. Use the formula

    V = 0.1 × 0.070 ÷ 0.000010 = 700 V. That is 17.5 times the 40 V a 2N2222 can block. In practice the voltage rises until the transistor breaks down.

  3. With the diode

    The diode conducts as soon as the collector passes 5 V + 0.7 V, so the collector stops at 5.7 V. Compare steps 2 and 4 of the figure.

The mistake to avoid

The direction of the flyback diode does not matter. It does. With the stripe at the transistor end, the diode conducts as soon as the transistor turns on and joins +5 V to 0 V: a short circuit. The diode or the transistor burns. The stripe goes to the + side of the coil.

Check yourself

Question 1

A silicon diode in series with a 12 V solar charge circuit stops the battery from discharging into the panel at night. In the day it carries 5 A. How much heat does the diode make?

Question 2

A new relay board is built with the flyback diode reversed: the stripe is at the transistor end of the coil. What happens when the pin turns the transistor on?

Question 3

After flyback diodes are fitted, a technician sees that each relay releases a few milliseconds later than before. Why?

Where you meet it

  • Relay outputs on controllersThe relay that starts a pump or an alarm has a flyback diode beside its coil.
  • Solenoid valvesA DC valve on an irrigation line or a borehole outlet needs one when a transistor switches it.
  • Solar panelsBypass diodes in the junction box let the current pass a shaded group of cells.
  • Reverse polarity protectionA diode in the supply input of a sensor node blocks the current if the battery is reversed.
Key points
  • A diode conducts from anode to cathode, keeping about 0.7 V, and blocks the other way.
  • A coil that is switched off makes a spike unless its current has a path.
  • A flyback diode across the coil, stripe to the + side, gives that path.
  • A reversed flyback diode is a short circuit.
Found this useful?

Discussion

    Comments show your name. Be kind, stay on the topic.