When makers and students ask what do diodes do in a circuit, the textbook answer is simple: they act as a one-way check valve for electrical current. But on the workbench, we exploit this one-way behavior to solve specific, destructive problems. The most critical application of this is protecting solid-state switches from inductive voltage spikes using a flyback diode.
This guide moves past abstract theory. We will design a complete reverse-biased flyback topology across a mechanical relay coil, select exact component values, analyze what happens when parts fail, and walk through breadboard verification.
The Core Topology: Flyback Protection Across an Inductive Load
When current flows through an inductor (like a relay coil or DC motor), it stores energy in a magnetic field. When the driving switch opens, the magnetic field collapses. According to Faraday’s law ($V = -L \frac{di}{dt}$), the inductor will generate whatever voltage is necessary to keep current flowing in the same direction. If your MOSFET or BJT opens the circuit in nanoseconds, that voltage spike can easily exceed 100V, instantly avalanche-breaking your 20V logic-level switch.
To prevent this, we place a diode in parallel with the inductor, oriented so it is reverse-biased during normal operation.
Topology Node Definitions
- Node A (VCC): The positive supply rail (e.g., +12V DC). Connected to one side of the relay coil and the diode cathode.
- Node B (Switched Low-Side): The junction between the relay coil, the diode anode, and the drain/collector of the driving transistor.
- Node C (GND): The ground rail. Connected to the source/emitter of the driving transistor.
When the transistor turns ON, current flows from Node A, through the coil, to Node B, and down to Node C. The diode sees 12V in reverse and blocks current. When the transistor turns OFF, the coil's collapsing field pushes current out of Node B. The diode becomes forward-biased, routing the recirculating current back up to Node A, clamping the voltage at Node B to roughly $VCC + 0.7V$.
Behavior Matrix and Extreme Failure Modes
Understanding diode circuit behavior requires looking at state changes and edge cases. Here is how the topology reacts to switching events and component failures.
| Circuit State / Condition | Voltage at Node B | Current Path | Physical Result |
|---|---|---|---|
| Transistor ON (Steady State) | ~0.2V (Vce_sat) | VCC → Coil → Transistor → GND | Relay pulls in. Diode is reverse-biased (blocks). |
| Transistor OFF (Normal Flyback) | ~12.7V (VCC + Vf) | Coil → Diode → VCC → Coil | Magnetic energy dissipates as heat in coil resistance. Transistor is safe. |
| Transistor OFF (Diode OPEN) | >100V (Spike) | Coil → Parasitic capacitance / Transistor | Inductive spike exceeds transistor Vds_max. Transistor suffers avalanche breakdown and shorts out. |
| Transistor ON (Diode SHORTED) | ~0V | VCC → Shorted Diode → Transistor → GND | Dead short across the power supply. Transistor or power supply burns out immediately. |
Design Walkthrough: Sizing the Components
Let’s size this for a real-world load: the Omron G5V-2 12VDC signal relay. According to the manufacturer datasheet, this relay has a coil resistance of roughly 240Ω, drawing about 50mA of steady-state current.
1. Calculate Peak Diode Current
The moment the transistor opens, the inductor attempts to maintain the exact same current it was flowing just before the switch opened. Therefore, the peak forward current ($I_F$) the diode must handle is exactly the coil's steady-state current: 50mA.
2. Calculate Reverse Voltage
When the transistor is ON, the diode cathode sits at 12V (Node A) and the anode sits at ~0V (Node B). The peak repetitive reverse voltage ($V_{RRM}$) the diode must block is 12V.
3. Select the Diode
We need a diode rated for >50mA forward current and >12V reverse voltage.
The Pick: The 1N4148 signal diode. It is rated for 200mA continuous forward current and 100V reverse voltage.
Why not the 1N4007? The 1N4007 is a rectifier diode rated for 1A and 1000V. While it won't burn out, its reverse recovery time ($t_{rr}$) is roughly 30µs. The 1N4148 has a $t_{rr}$ of 4ns. In high-speed PWM applications driving motors or fast-switching relays, the 1N4007 will momentarily conduct in reverse during that 30µs window, causing efficiency loss and high-frequency ringing.
Decision Tree: Choosing the Right Clamping Topology
A standard flyback diode isn't the only way to clamp an inductive spike. Use this decision matrix to terminate your design choice based on your specific switching requirements.
| Application Requirement | Topology Choice | Pros & Cons | Final Component Pick |
|---|---|---|---|
| General purpose relay switching (< 10 Hz) | Standard Flyback Diode | Pro: Cheapest, simple. Con: Slow relay release time (coil dissipates energy slowly at 0.7V). |
1N4148 (or 1N400x for heavy contactors) |
| Fast relay release needed (e.g., fuel injectors, high-speed sorting) | Zener + Flyback Diode in Series | Pro: Clamps at higher voltage (e.g., 24V), burning off coil energy 30x faster. Con: Requires higher Vds rating on the driving MOSFET. |
1N4148 + 15V Zener (BZX55C15) |
| AC inductive loads (motors, solenoids) | RC Snubber Network | Pro: Works with alternating current. Con: Bulky, requires tuning R and C to the load impedance. |
100Ω Resistor + 0.1µF X2 Film Cap |
Default Recommendation: For 90% of hobbyist and microcontroller-driven DC relay projects, terminate your design with a standard 1N4148 placed directly across the coil.
Step-by-Step Breadboard Verification
Do not trust the color band on a glass diode blindly; manufacturing tolerances and faded paint can lead to reverse installation, which results in a dead short. Follow this verification sequence before applying power to your microcontroller.
- Isolate the Diode: Remove the 1N4148 from the breadboard. Set your digital multimeter (DMM) to the Diode Test mode (usually indicated by a diode symbol).
- Forward Bias Test: Place the red probe on the anode (the end without the black band) and the black probe on the cathode (the end with the black band). The DMM should read between 0.5V and 0.7V.
- Reverse Bias Test: Swap the probes. The DMM should display "OL" (Open Loop) or "1" (depending on the meter), confirming the diode blocks reverse current.
- Install and Verify Orientation: Insert the diode into the breadboard. The cathode (banded end) must connect to the row tied to Node A (VCC). The anode must connect to the row tied to Node B (the transistor drain/collector).
- Continuity Check (Unpowered): With the power supply disconnected, place the DMM in continuity mode across Node A and Node B. It should read "OL". If it beeps, your diode is installed backward, or your driving transistor is already shorted.
- Live Voltage Verification: Power the circuit. Trigger the transistor ON. Measure Node B to GND; it should read < 1V. Trigger the transistor OFF. Measure Node B to GND; it should read exactly VCC (e.g., 12.0V). If you see a massive spike on an oscilloscope, your diode is faulty or the breadboard contact is intermittent.
Why Standard Flyback Beats the Alternatives
Engineers sometimes attempt to use Metal Oxide Varistors (MOVs) or Transient Voltage Suppression (TVS) diodes across DC relay coils to clamp spikes. While TVS diodes (like the SMAJ15A) react in picoseconds, they are designed to absorb brief transient energy (like ESD or lightning strikes), not the continuous, repetitive energy dump of a collapsing relay coil. A TVS diode subjected to 10 Hz relay switching will overheat and fail short within hours.
Similarly, an RC snubber is excellent for AC contactors but is a poor choice for DC microcontroller circuits. The capacitor in an RC snubber will charge up and hold the relay coil voltage above the dropout threshold, causing the relay to chatter or fail to release cleanly when the transistor turns off.
The standard silicon flyback diode remains the undisputed champion for DC inductive clamping. It is specifically engineered to handle continuous forward current, costs fractions of a cent, and safely recirculates the coil's stored magnetic energy back into the local power rail until it dissipates as heat in the coil's internal resistance. When designing your next motor driver or relay board, stick the 1N4148 across the coil and your switching transistors will outlive the rest of the circuit.






