Energy from a magnetic field is the potential work stored in the space around a current-carrying conductor or inductor, calculated as half the inductance multiplied by the square of the current. When you build a physical circuit, this stored energy dictates the physical size of your magnetics, forces you to add flyback diodes to prevent arcing, and serves as the fundamental mechanism that allows switch-mode power supplies (SMPS) to step voltages up or down. Beginners commonly confuse magnetic field energy (stored via current in an inductor) with electric field energy (stored via voltage in a capacitor), or mistakenly believe permanent magnets contain usable, extractable electrical energy waiting to be tapped.
The Physics and Math of Magnetic Energy Storage
Unlike a battery, which stores energy chemically, an inductor stores energy kinetically in the form of a magnetic field. Think of an inductor like a mechanical flywheel: the inductance is the mass of the wheel, and the current is its rotational velocity. You have to apply force (voltage) to get it spinning (build current), and once it is spinning, it resists any attempt to stop it suddenly.
The exact amount of energy stored is defined by a straightforward equation:
Where: W = Energy in Joules (J), L = Inductance in Henries (H), I = Current in Amperes (A)
Worked Numeric Example: The 50kV Inductive Spike
Let us look at a real-world scenario using a 10 mH power inductor (such as a Würth Elektronik 74477410) carrying a steady 5 A DC current. First, we calculate the stored magnetic energy:
- W = 0.5 × 0.010 H × (5 A)²
- W = 0.5 × 0.010 × 25
- W = 0.125 Joules (125 mJ)
125 mJ does not sound like much—it is roughly the kinetic energy of a tennis ball moving at 3 mph. But in electronics, the danger is not just the total energy; it is the rate at which that energy is released. If your microcontroller turns off the MOSFET controlling this inductor in just 1 microsecond (1 µs), the current attempts to drop from 5 A to 0 A instantly. The collapsing magnetic field induces a back-EMF (voltage spike) calculated by V = L × (di/dt):
- V = 0.010 H × (5 A / 0.000001 s)
- V = 50,000 Volts
Where You Meet This in Practice
You rarely calculate magnetic field energy just for the sake of theory; you manage it to prevent catastrophic hardware failure or to intentionally transfer power. Here is where it shows up on the workbench.
1. Relay and Solenoid Flyback Diodes
Mechanical relays and solenoids are essentially large inductors. When the transistor driving the coil turns off, the collapsing magnetic field generates a massive reverse voltage spike. We place a freewheeling diode (like a 1N4148 or 1N4007) in reverse bias across the coil. When the spike occurs, the diode becomes forward-biased, creating a short circuit that allows the stored magnetic energy to circulate and burn off as heat in the coil's internal resistance. Pro tip: For high-frequency PWM driving, use a fast-recovery diode or a Schottky diode; the standard 1N4007 has a slow reverse recovery time that can cause it to fail under rapid switching.
2. Switch-Mode Power Supplies (SMPS)
In a boost converter, energy from a magnetic field is intentionally harvested to increase voltage. A MOSFET switches on, allowing current to build up in the inductor (storing energy). The MOSFET then switches off, and the inductor's collapsing magnetic field forces the current through a diode into an output capacitor at a higher voltage than the input source. According to Electronics Tutorials, this transfer of magnetic energy is what allows modern buck and boost regulators to achieve 90%+ efficiency compared to the massive heat losses of linear regulators.
3. Inductive Kickback and Microcontroller Resets
If you have ever wired a small brushed DC motor directly to the same ground plane as an ESP32 or Arduino, you have likely experienced random brownout resets when the motor stops. The motor's windings act as an inductor. When power is cut, the energy from the magnetic field pushes a high-current transient through the ground trace. Because PCB traces have slight resistance, this transient lifts the local ground reference (ground bounce), tricking the ESP32's brownout detector into thinking the 3.3V rail has collapsed, triggering a reset. The fix is physical separation of grounds or adding a TVS (Transient Voltage Suppression) diode like the SMBJ15A directly across the motor terminals.
Magnetic Field Energy vs. Electric Field Energy
To truly master circuit theory, you must understand the duality between inductors (magnetic field) and capacitors (electric field). As detailed in foundational physics resources like Georgia State University's HyperPhysics, these two components are mathematical mirrors of one another.
| Characteristic | Inductor (Magnetic Field) | Capacitor (Electric Field) |
|---|---|---|
| Storage Medium | Magnetic field in/around the core | Electric field in the dielectric |
| Energy Formula | W = ½ L I² | W = ½ C V² |
| Primary Variable | Current (resists change in current) | Voltage (resists change in voltage) |
| DC Steady State | Short circuit (0V drop) | Open circuit (0A flow) |
| Catastrophic Failure | Core saturation / Insulation breakdown from back-EMF | Dielectric breakdown / Thermal venting (explosion) |
FAQ: Extracting and Managing Energy from Magnetic Fields
Can you generate free energy from a permanent magnet's magnetic field?
No. This is a persistent myth in hobbyist circles. A permanent magnet possesses a static magnetic field, but energy from a magnetic field can only be extracted when the field is changing (collapsing or expanding) relative to a conductor, as described by Faraday's Law of Induction. Moving a coil past a permanent magnet requires mechanical work to overcome the magnetic resistance (Lenz's Law). You are converting your mechanical energy into electrical energy, not extracting 'free' energy from the magnet itself. The magnet is just the coupling medium, not the fuel source.
How do I safely dissipate energy from a magnetic field when switching off a large inductor?
For low-frequency switching (like a simple relay), a standard freewheeling diode is sufficient. However, for high-power or high-frequency applications (like a 48V DC motor or a switching regulator), a simple diode dissipates the energy too slowly, which can cause the next PWM cycle to start before the inductor has fully discharged, leading to core saturation. In these cases, use an RCD (Resistor-Capacitor-Diode) snubber network or a bidirectional TVS diode. A TVS diode clamps the voltage spike to a safe, specific level (e.g., 60V), allowing the magnetic energy to dissipate much faster as heat in the diode junction without exceeding the MOSFET's Vds rating.
Why does my ESP32 reset when I turn off a nearby DC motor?
This is caused by ground bounce resulting from the motor's inductive kickback. When the motor stops, the collapsing magnetic field forces a high-current transient through your circuit's return path. Because copper traces have finite resistance, Ohm's law dictates that this transient current creates a momentary voltage spike across the ground trace. If the ESP32's ground pin is lifted even 200mV above the power supply's true ground, its internal brownout detector interprets this as a drop in the 3.3V VCC rail and triggers a safety reset. Fix this by routing the motor's high-current ground return directly to the power supply terminal (star grounding), keeping it physically separate from the ESP32's sensitive logic ground.






