Freewheeling diode or resistor? How to protect circuits

If you have ever switched a relay or a small motor with a microcontroller, you may be familiar with the following situation: You switch off the output - and suddenly the circuit goes haywire. Or worse: the controller dies quietly.

What is happening?

Induction voltage - and a good one at that.
The good old Lenz's law is to blame, which states:

“A coil wants to maintain the current - and resists with voltage.”

Fortunately, there are simple protective measures: the famous Freewheeling diode - or in some cases also a Resistor. In this article I'll show you, when you should use which solution, what exactly happens - and why many tutorials only tell you half the truth.

Why do voltage peaks occur in coils?

When current flows through a coil, it builds up a magnetic field. If you switch off the current, the field collapses, and the coil “pushes” the current further through the circuit - whatever the cost.
The result: High voltages for short periods, often many 10 V or even >100 V.
This voltage then seeks a path - e.g. through the switching transistor → RIP Transistor.

The classic solution: freewheeling diode (also called “flyback diode”)

The freewheeling diode „freewheeling diode“ or flyback diode „flyback diode“ bezeichnet – wird is switched antiparallel to the coil, so that they Blocks in normal operation, but becomes conductive when switched off.

It conducts the current that the coil still “feeds” when it is switched off back through the coil in a circuit.
Advantage: The resulting voltage peak remains low (only around 0.7 V), the energy is dissipated “softly” and sensitive components such as transistors or microcontrollers remain protected.

But beware: the circuit switches off more slowly!

This softness has its price:
The current flow through the freewheeling diode ensures that the magnetic field collapses more slowly. With relays or motors, this can lead to Delayed shutdown which is not always desirable.

💡 Side note for advanced users:
The freewheeling diode is often too slow for transistor circuits with high switching frequencies or PWM. Here, faster “snubber” networks or Z-diodes are used instead.

Alternative: The freewheeling resistor (R instead of freewheeling diode)

Particularly with small relays or coils, a Resistance parallel to the coil be switched. This “burns” the induction energy into heat.

Advantage:

  • No slow shutdown - the magnetic field collapses quickly.

  • Ideal for applications where switching off quickly is important (e.g. precise controls).

Disadvantage:

  • The voltage peak is higher than with the diode.

  • The transistor may have to withstand more voltage.

💡 Tip:
A resistor with 1 kΩ in a small relay is often sufficient to limit voltage peaks - without a delay as with the diode.

Diode or resistor - which is better?

CriterionFreewheeling diodeResistance (R)
Voltage peakVery low (0.7 V)Medium to high
Switch-off delayYesNo
Load for transistorlowhigher
Energy reductionSlow & gentlefast & dissipative
Size & pricevery small & inexpensiveslightly larger, also inexpensive

Conclusion

For most hobby applications, the classic Freewheeling diode (flyback diode) is the best solution:
Simple, safe, proven.

But:
If you build fast circuits, where timing is crucial, or you have very small loads, it's worth taking a look at the free-wheeling resistance.
Both have their merits – and that is precisely what is often overlooked.

FAQ – Frequently asked questions

What does a free-wheeling diode do?

It protects circuits from induction voltage by returning the current from a coil to the circuit when it is switched off.

Why can't I connect a diode the wrong way round?

Inverted = short circuit. Always install so that it blocks during operation and conducts when switched off (cathode to positive).

When is a resistor better than a freewheeling diode?

If you need fast shutdown or the coil stores very little energy – e.g., in small signal relays.

Can I combine a diode and a resistor?

Yes, e.g., diode + parallel resistor → protects AND accelerates. Or Z-diode for defined peak voltage.