The energy stored in a magnetic field is the physical work required to establish an electrical current through an inductor, held as potential energy in the surrounding magnetic flux and violently released as voltage when the current path is interrupted. In a real circuit, this stored energy dictates your flyback voltage spikes, forcing you to either overspecify your semiconductor voltage ratings or add clamping components to prevent catastrophic avalanche breakdown. Beginners commonly confuse the capacity to store energy (inductance, measured in Henries) with the actual stored energy (measured in Joules), and they frequently mix up magnetic field energy ($\frac{1}{2}LI^2$) with electric field energy in capacitors ($\frac{1}{2}CV^2$).
The Core Physics and the Math That Matters
To calculate the exact energy stored in a magnetic field, you use the following formula:
E = ½ × L × I²
Where:
- E = Energy in Joules (J)
- L = Inductance in Henries (H)
- I = Current in Amperes (A)
Notice that the current is squared. This means doubling your inductance only doubles the stored energy, but doubling your current quadruples it. This non-linear relationship is why high-current inductive loads (like large contactors or motor windings) are vastly more destructive to switching transistors than low-current signal relays, even if their inductance values are similar.
Think of an inductor as the electrical equivalent of a mechanical flywheel. Current is the rotational speed, and inductance is the mass. You cannot stop a heavy, spinning flywheel instantly without snapping the drive shaft. Similarly, you cannot stop inductor current instantly without generating a massive voltage spike that breaks down your semiconductor switch.
Worked Example: Calculating Flyback Energy in a Solenoid Valve
Let’s look at a real-world component: a Festo VUVG 24VDC industrial solenoid valve.
- Coil Resistance (R): 24 Ω
- Supply Voltage (V): 24 VDC
- Steady-State Current (I): 1 A (using Ohm's Law: 24V / 24Ω)
- Coil Inductance (L): 80 mH (0.08 H)
Plugging these values into our formula:
E = 0.5 × 0.08 H × (1 A)² = 0.04 Joules (40 mJ)
Forty millijoules sounds tiny, but it is more than enough to destroy a standard logic-level MOSFET. If you use an IRLZ44N MOSFET (rated for 55V Vds) to switch this valve off, and the transistor turns off in 100 nanoseconds, the rate of current change ($di/dt$) is $10^7$ A/s.
The resulting flyback voltage spike is $V = L(di/dt) = 0.08 \times 10^7 =$ 800,000 Volts. In reality, parasitic capacitance and the MOSFET's avalanche breakdown will clamp this before it reaches 800kV, but the spike will easily exceed the 55V rating, instantly punching through the silicon die and shorting the drain to the source.
Where You Meet This in Practice
Understanding the energy stored in a magnetic field is not just academic; it dictates component selection across several major electrical domains:
1. Relay Coils and Contactors (Flyback Protection)
Every time a mechanical relay opens, the collapsing magnetic field induces a high-voltage spike. In DC circuits, this causes arcing across the physical switch contacts (welding them shut over time) or destroys the driving transistor. In AC circuits, it causes electromagnetic interference (EMI) that resets nearby microcontrollers.
2. Switch-Mode Power Supplies (SMPS)
In buck, boost, and flyback converters, the inductor is supposed to store and release energy. The energy stored in the magnetic field during the switch's 'ON' time is transferred to the output capacitor during the 'OFF' time. If you select an inductor with too low a saturation current, the core saturates, inductance drops to near zero, and the stored energy limits vanish, resulting in a short circuit through your switching FET.
3. Automotive Ignition Coils
An ignition coil is an inductor designed to maximize magnetic energy storage. The engine control unit (ECU) charges the primary winding with high current, storing several dozen millijoules. When the switch opens, the energy is transferred to the secondary winding, stepping the voltage up to 30,000V+ to jump the spark plug gap.
Decision Tree: Sizing Clamping Components by Stored Energy
Do not guess your flyback diode. Use the calculated magnetic energy to select the correct clamping topology. For deeper theory on inductor behavior, refer to standard references like Electronics Tutorials or manufacturer application notes on inductive switching.
| Stored Energy Range | Typical Application | Clamping Strategy | Concrete Part Pick |
|---|---|---|---|
| < 5 mJ | Small signal relays, reed switches, <50mA coils | Standard fast-switching diode or rely on MOSFET avalanche rating if repetitive energy is low. | 1N4148 or BAV99 |
| 5 mJ to 50 mJ | Standard 12V/24V PCB relays, small pneumatic solenoids | Reverse-biased standard rectifier diode across the coil. For faster relay drop-out times, use a Zener or TVS in series with the diode. | 1N4007 (Standard) or 1N5819 (Schottky) |
| 50 mJ to 500 mJ | Large DIN-rail contactors, magnetic brakes, heavy solenoids | Bidirectional TVS diode (for AC/DC) or RC Snubber network. Standard diodes will overheat and fail from the surge current. | SMBJ24CA (TVS) or 100Ω + 0.1µF 250V (RC Snubber) |
| > 500 mJ | Industrial lifting magnets, large motor field windings | Active dynamic braking circuits or heavy-duty Metal Oxide Varistors (MOVs) paired with contactors. | EPCOS/TDK B722 Series MOV |
Frequently Asked Questions
Does the flyback diode dissipate the stored energy?
Yes. When the switch opens, the current recirculates through the diode and the coil's internal resistance. The energy stored in the magnetic field is converted into heat. A standard 1N4007 diode drops about 0.7V, meaning the bulk of the energy is actually dissipated as $I^2R$ heat inside the copper windings of the coil itself, which is why relay coils get warm during rapid PWM cycling.
Why would I use a TVS diode instead of a cheap 1N4007 rectifier?
It comes down to decay time. A standard rectifier clamps the flyback voltage to roughly 0.7V. Because $V = L(di/dt)$, a low clamping voltage means a slow rate of current decay. This causes the relay armature to drop out slowly, which can cause contact chatter. A TVS diode clamps at a much higher voltage (e.g., 24V), forcing the current to decay rapidly and ensuring a crisp, fast relay drop-out.
How do I handle the energy stored in a magnetic field for AC contactors?
You cannot use a standard reverse-biased DC diode on an AC coil, as it will short-circuit the AC supply on the negative half-cycle. Instead, use an RC snubber (resistor-capacitor network) wired in parallel with the coil, or a bidirectional TVS diode. The capacitor absorbs the high-frequency spike, while the resistor dissipates the energy and prevents LC resonance.
The Default Recommendation for 90% of Projects
If you are building a custom PCB or wiring a control panel and need to switch a generic 12V or 24V DC relay, solenoid, or small contactor, do not overcomplicate the clamping circuit. Calculate your expected energy; if it falls under 50 mJ, default to a 1N4007 diode wired in reverse-bias directly across the coil terminals (cathode to positive, anode to negative). It costs roughly $0.02, handles the 1A continuous surge without breaking a sweat, and will reliably protect your $2.00 switching MOSFET from the energy stored in the magnetic field. For high-speed PWM applications where slow relay drop-out is unacceptable, upgrade to a 24V bidirectional TVS diode (SMBJ24CA) to force a faster collapse of the magnetic flux.






