Every DC motor project has a hidden danger that can silently destroy transistors, microcontrollers, and motor driver ICs: back-EMF voltage spikes. These spikes — generated by the motor’s own magnetic field collapsing when power is cut — can be 10x, 50x, or even 100x the supply voltage, all compressed into a microsecond pulse. A single unprotected switch-off event can permanently damage your driver IC or Arduino.
The solution is a simple, cheap component: the flyback diode (also called a freewheeling diode, snubber diode, or catch diode). In this guide, we’ll explain exactly what back-EMF is, why it’s dangerous, how flyback diodes work, how to select the right diode, and how to correctly wire it in common Arduino motor circuits.
What Is Back-EMF?
When electric current flows through a wire coil (inductor), it creates a magnetic field. This stored magnetic energy is what drives the motor’s rotation. Now, when you suddenly cut off the current — by turning off a transistor, for example — the magnetic field cannot disappear instantaneously. It collapses, and as it collapses, it generates a voltage (by Faraday’s law of electromagnetic induction) to try to maintain the current flow.
This voltage is called back-EMF (back Electromotive Force), or in the context of switching circuits, an inductive kickback spike. It appears across the motor terminals as a large, brief voltage spike of opposite polarity to the original supply voltage.
The magnitude of this spike depends on the inductance of the motor coil and how fast the current is switched off:
V_spike = L × (ΔI / Δt)
Where:
L = motor coil inductance (mH)
ΔI = change in current (A)
Δt = time to cut current (seconds)
A transistor switching off in nanoseconds with a motor drawing 1A through 10 mH of inductance can produce spikes of hundreds of volts — even though the supply is only 12V.
There’s also a second type of back-EMF: the generator voltage produced by a spinning motor. Even after the motor is powered off, if the shaft is still spinning (due to inertia), the motor acts as a generator and produces a voltage. This is continuous (not a spike) but still needs to be handled in regenerative braking designs.
Why Back-EMF Spikes Are Dangerous
Modern transistors, MOSFETs, and motor driver ICs have absolute maximum voltage ratings. A common NPN transistor like 2N2222 has a Vceo (collector-emitter breakdown voltage) of 40V. A popular logic-level MOSFET like the IRL520 is rated for 100V. An L293D motor driver IC’s output pins are rated for 36V.
But what if the motor supply is 12V and the spike reaches 80V? The transistor or IC fails — often with spectacular results. This is why you sometimes see burnt smell, smoke, or an IC that works fine until the motor is switched off for the first time.
Even if the spike doesn’t immediately destroy the component, repeated spikes cause cumulative degradation:
- Each spike slightly damages the semiconductor junction
- After many switching cycles (thousands or millions), the component’s threshold voltage shifts
- The device eventually fails — but intermittently and mysteriously, long after the initial assembly
This “slow death” mode is why many makers experience circuits that “work fine for a week then stop working.”
How Flyback Diodes Work
A flyback diode is connected in reverse-parallel across the motor — that is, with the diode’s cathode connected to the positive motor terminal and the anode to the negative motor terminal. In normal operation (motor running), this is a reverse-biased diode, so no current flows through it — it’s electrically invisible.
When the motor’s power is cut and the inductive spike occurs, the spike reverses polarity. Now the diode is forward biased: it conducts, providing a low-resistance path for the spike current to circulate. The energy dissipates harmlessly in the diode (as heat) rather than appearing as a destructive voltage spike across the switching transistor.
The diode effectively clamps the voltage to approximately Vsupply + Vf (where Vf is the diode’s forward voltage, typically 0.7V for silicon diodes and 0.3V for Schottky diodes). This keeps the spike safely within the transistor’s or driver IC’s maximum voltage rating.
The name “flyback diode” comes from older TV CRT circuits where a similar diode handled the “flyback” pulse when the electron beam flew back to start a new scan line — but the principle is identical.
Choosing the Right Flyback Diode
Not all diodes are suitable for flyback protection. The key parameters to match to your circuit are:
1. Reverse Voltage (PIV / PRV)
The diode must withstand the motor supply voltage in normal reverse-biased operation. For a 12V motor supply, use a diode rated for at least 40V (add a comfortable safety margin). For a 24V supply, use 60V+ rating.
2. Forward Current
During the spike, the diode must carry the full motor current. For a 1A motor, use a 1A diode minimum. For safety, use 2–3× the motor’s stall current. For a motor with 2A stall current, use a 5A diode.
3. Recovery Speed
This is crucial for PWM circuits. When PWM switches at high frequency (e.g., 20 kHz), the diode switches in and out of conduction rapidly. A slow diode can’t recover in time between pulses, causing current to flow in the wrong direction and generating heat or even destroying the diode.
- 1N4001–1N4007 series: Standard silicon diodes, 1A rating, reverse recovery time ~2–4 µs. Fine for slow switching, not ideal for PWM above 20 kHz.
- 1N5819 / 1N5822 (Schottky): Recovery time <10 ns, lower forward voltage (0.3–0.45V). Preferred for PWM motor circuits and higher frequencies.
- 1N5399 / 1N5408: 1.5A or 3A standard diodes for higher current motors with slow switching.
- MBR series Schottky (MBR1545, MBR2045, etc.): High-current Schottky diodes for high-power motor circuits.
Recommended Diode Choices by Application
| Application | Motor Current | Recommended Diode |
|---|---|---|
| Small DC toy motor (<5V) | <200 mA | 1N4148 or 1N4001 |
| Arduino project (5–12V) | 200 mA – 1A | 1N4001 or 1N5819 |
| PWM motor control (any) | Any | 1N5819 Schottky (preferred) |
| High-power DC motor (12–24V) | 1A – 5A | 1N5822 or MBR2045 |
| Industrial / Robot motor (24–48V) | 5A+ | MBR4045 or similar high-current Schottky |
Circuit Diagrams & Wiring
Basic NPN Transistor Motor Switch with Flyback Diode
This is the most fundamental motor drive circuit. A single NPN transistor switches the motor on/off, controlled by an Arduino digital pin.
Component list:
- NPN transistor (2N2222, BC547, TIP120 for high current)
- 1 kΩ base resistor
- 1N4001 or 1N5819 diode
- DC motor
- External power supply (for motor)
Connections:
- Arduino pin → 1 kΩ resistor → Transistor Base
- Transistor Emitter → GND (shared with Arduino GND)
- Transistor Collector → Motor negative terminal
- Motor positive terminal → Motor power supply (+12V)
- Flyback diode: Cathode (banded end) → Motor + terminal (+12V line), Anode → Motor – terminal (Collector/motor junction)
Critical point: The diode’s cathode MUST connect to the higher voltage side (supply rail). If you install the diode backwards, it will short-circuit the supply and immediately burn out the transistor and/or diode.
MOSFET Motor Switch with Flyback Diode
For higher currents or logic-level control, a MOSFET is preferred over a bipolar transistor.
Connections with N-channel MOSFET (e.g., IRL520, IRF540):
- Arduino pin → 10 kΩ resistor → MOSFET Gate
- 10 kΩ pull-down resistor from Gate to GND (prevents floating gate at startup)
- MOSFET Source → GND
- MOSFET Drain → Motor negative terminal
- Motor positive terminal → Power supply
- Flyback diode: Cathode → Power supply rail, Anode → Drain/Motor– junction
Note: Many MOSFETs have a built-in body diode that provides some flyback protection inherently. However, the body diode has a slow recovery time and high forward voltage (0.7–1V). For best protection, still add an external Schottky diode in parallel with the body diode.
25GA-370 12V 12RPM DC Reducer Gear Motor
A 12V geared DC motor frequently used in robotics and automation. Gear reduction gives high torque at low speed. Always pair with a flyback diode (1N5819 recommended) for reliable switching protection.
Back-EMF Protection in H-Bridge Circuits
An H-bridge allows bidirectional motor control by routing current in either direction through the motor. It uses 4 transistors/MOSFETs arranged in a bridge. Back-EMF protection requires 4 flyback diodes — one across each switch in the bridge.
The good news: most integrated H-bridge motor driver ICs already include internal protection diodes. The L293D, L298N, L9110S, TB6612FNG, and DRV8833 all include internal flyback diodes. You don’t need to add external ones for the motor terminals when using these ICs.
However, there are still cases where additional external protection is warranted:
- High-inductance motors: The internal diodes may not be fast enough or rated for the full spike current. Add external Schottky diodes in parallel with internal ones.
- Brushless motors (BLDCs): Require 6-switch bridge (3 H-bridges), and the BLDC ESC typically handles protection internally.
- Long wire runs: Wire inductance adds to motor inductance. Add 100 nF ceramic capacitors across motor terminals at the motor (not at the driver) to suppress localized spikes.
Special Considerations with PWM Control
When a motor is controlled via PWM, the transistor (or driver IC’s output stage) switches on and off at the PWM frequency — often 1 kHz, 5 kHz, or 20 kHz. Each switching event produces an inductive spike.
At high PWM frequencies, this means thousands of spike events per second. The cumulative effect is significant if protection is inadequate:
- The flyback diode conducts briefly on every OFF cycle
- At 20 kHz, the diode switches at 40,000 times per second (on + off each cycle)
- A slow diode (1N4001, recovery ~4 µs) cannot fully recover in 50 µs (at 20 kHz). It partially conducts during the ON phase, creating shoot-through current
For PWM-controlled motors, always use Schottky diodes. A 1N5819 has recovery time <10 ns — it can handle PWM frequencies up to hundreds of kHz without issue.
Additionally, add a 100 nF ceramic decoupling capacitor directly at the motor power pins (between Vmotors and GND on the driver PCB). This handles very high frequency transients that even fast diodes can’t fully suppress.
Additional Protection Techniques
1. TVS Diode (Transient Voltage Suppressor)
A TVS diode (like 1.5KE15A or P6KE series) clamps voltage more aggressively than a regular diode. It conducts at a defined breakdown voltage and absorbs much more energy per event. Use TVS diodes in parallel with the motor or driver supply rail for high-energy spike environments.
2. RC Snubber Network
A resistor-capacitor snubber (e.g., 10 Ω + 100 nF in series across the motor) dampens high-frequency oscillations that occur when the inductive spike interacts with parasitic capacitances. Particularly useful in high-frequency PWM circuits.
3. Motor Supply Decoupling Capacitor
A large electrolytic capacitor (470 µF – 1000 µF) across the motor supply rails serves as an energy reservoir. It absorbs spike energy and also buffers the inrush current when the motor starts, preventing voltage dips that reset microcontrollers.
25GA-370 12V 12RPM DC Reducer Gear Motor with Encoder
Gear motor with built-in quadrature encoder for closed-loop position and speed control. For encoder-based feedback systems, back-EMF protection is even more critical to protect the encoder electronics.
Common Mistakes to Avoid
Mistake 1: Installing the diode backwards
A reverse-installed flyback diode short-circuits the power supply whenever the motor is powered. It will immediately burn out the diode, transistor, or both. Always verify: cathode (marked with a band/stripe) connects to the positive supply side.
Mistake 2: Using a slow diode with PWM
Using a 1N4001 in a 20 kHz PWM circuit. The slow recovery creates partial conduction during ON phases, adding unwanted dissipation. Use Schottky diodes for any PWM application.
Mistake 3: Placing the diode at the driver, not at the motor
Ideally, the flyback diode should be placed as close to the motor terminals as physically possible — not far away at the driver PCB. Wire inductance between the diode and motor means the spike must travel through the wiring before being clamped. Short wires and close placement give best protection.
Mistake 4: Assuming driver IC protection is sufficient for all cases
Internal diodes in L293D and similar ICs are typically rated for the IC’s maximum current, not the motor’s stall current. If your motor can stall at 3A but the IC’s internal diodes are rated for 1.5A, add external Schottky diodes.
Mistake 5: Skipping protection on “small” motors
Even a small 5V toy motor can generate spikes of 50–100V when switched rapidly. The absolute voltage rating of the transistor matters, not the supply voltage. Always add flyback protection regardless of motor size.
Frequently Asked Questions
What happens if I don’t use a flyback diode?
Without a flyback diode, the inductive voltage spike from the motor appears directly across the switching transistor or driver IC output. This spike can exceed the component’s breakdown voltage, causing immediate failure (smoke, burnt smell, non-functional circuit) or gradual degradation over many switching cycles. The Arduino itself can also be damaged if the spike couples through power supply traces.
Can I use a 1N4007 instead of a 1N4001?
Yes. The 1N4007 has the same current rating (1A) as the 1N4001 but a higher reverse voltage rating (1000V vs 50V). Both are equally suitable for motor protection in 5–24V circuits. In practice, the 1N4007 is slightly more versatile since it can be used in higher-voltage circuits without concern.
Does the L298N motor driver need external flyback diodes?
The L298N has internal protection diodes on the same chip. However, for high-inductance or high-current motors, adding external Schottky diodes in parallel with the internal ones improves protection. Many L298N breakout boards already include external diodes. Check your specific board’s schematic.
What is the difference between a flyback diode and a Zener diode for protection?
A flyback diode clamps by conducting the spike current back through the motor coil. A Zener diode (or TVS diode) clamps the voltage to its breakdown voltage by conducting any excess current to ground. Zener/TVS diodes clamp at a defined voltage level and dissipate the spike energy as heat. In motor circuits, a flyback diode is the standard protection; TVS diodes are used as additional protection in high-energy spike environments.
How close does the flyback diode need to be to the motor?
As physically close as possible. Every centimeter of wire between the diode and motor terminals adds inductance, which the spike must still travel through. For best protection, solder the diode directly across the motor’s terminal tabs. If using a driver board, a diode at the motor is better than one only at the board.
My motor driver IC already has built-in diodes. Do I still need external ones?
For most hobbyist applications with motors up to 1A, the internal diodes are sufficient. For motors with high stall currents (above the IC’s internal diode rating), long connecting wires, high PWM frequencies, or inductive spikes exceeding the IC’s supply voltage rating — add external Schottky diodes for extra protection.
Conclusion
Back-EMF protection via flyback diodes is one of the most fundamental — and most overlooked — practices in DC motor circuit design. The good news is that the solution is trivially cheap: a single diode costing a few rupees can protect a motor driver IC or microcontroller worth hundreds of rupees.
The rules are simple: always add a flyback diode across every motor you switch; install it with the cathode toward the positive supply; use Schottky diodes for PWM circuits; place it as close to the motor as possible; and supplement with decoupling capacitors on the power rail for best results.
Build the habit of including flyback protection in every motor circuit you design, and you’ll avoid one of the most frustrating failure modes in electronics projects.
Add comment