Magnetism is the physical force generated by moving electrical charges that attracts or repels magnetic materials and induces voltage in nearby conductors. When you run current through a wire, you don't just get heat; you get a magnetic field. In a real circuit, this changes everything: it introduces inductance, causes current to lag voltage, stores energy, and generates destructive back-EMF (electromotive force) when you try to switch the circuit off. If you are designing a driver for a relay, motor, or solenoid, ignoring the magnetic properties of your load will result in melted silicon and failed prototypes.
The Core Mechanism: Moving Charges and Magnetic Fields
Whenever electrons flow through a conductor, they generate a concentric magnetic field around that wire. This is the foundation of electromagnetism. If you coil that wire, the individual magnetic fields of each loop叠加 (stack) together, creating a concentrated magnetic flux through the center of the coil.
This is where the concept of inductance is born. Inductance ($L$), measured in Henries (H), is a circuit's inherent opposition to a change in current. Think of an inductor like a heavy water wheel in a flume. When you open the sluice gate (apply voltage), the heavy wheel takes time to overcome its inertia and spin up to full speed (current lags voltage). When you suddenly slam the gate shut (open the switch), the heavy wheel's momentum forces the water to keep moving, creating a massive pressure spike (voltage spike) that can burst the pipes. For a deeper look at how this behaves in DC circuits, the All About Circuits textbook on inductors provides excellent foundational schematics.
What Magnetism Changes in a Real Circuit (With Math)
In a purely resistive circuit, voltage and current are perfectly in phase. Magnetism changes this by storing energy in the magnetic field ($E = \frac{1}{2}LI^2$). When you open a switch, the magnetic field collapses. The inductor will generate whatever voltage is necessary to keep the current flowing, even if it means ionizing the air across a switch contact or punching through the gate oxide of a MOSFET.
Worked Numeric Example: The Back-EMF Spike
The voltage spike generated by a collapsing magnetic field is calculated using Faraday's law of induction:
V = L × (di / dt)
- Inductance (L): 50 mH (0.05 H)
- Steady-state Current (I): 100 mA (0.1 A)
- Switch-off time (dt): 1 µs (0.000001 s)
When the MOSFET turns off, the current drops from 0.1 A to 0 A in 1 microsecond. Let's calculate the spike:
V = 0.05 × (0.1 / 0.000001) = 5,000 Volts
The IRLZ44N has a maximum drain-source voltage ($V_{DSS}$) of just 55V. That 5,000V spike will instantly avalanche the semiconductor junction, permanently destroying your MOSFET. This is why you must provide a safe path for the magnetic energy to dissipate.
Where You Meet This in Practice
You will encounter the practical effects of magnetism in almost every electromechanical and power conversion project on your workbench:
- Relays and Contactors: The coil is a pure inductor. The magnetic field pulls the armature to close the contacts. When de-energized, the collapsing field causes the classic "spark" across the switch or transistor driving it.
- Transformers: These rely on mutual inductance. The changing magnetic field in the primary winding induces a proportional voltage in the secondary winding based on the turns ratio.
- DC Motors: As the motor spins, it acts as a generator, producing a back-EMF that opposes the supply voltage. This is why a motor draws massive stall current when starting (no back-EMF yet) and drops to a lower running current as it speeds up.
- Inductors and Chokes: Used in buck/boost converters to temporarily store magnetic energy and release it to smooth out current delivery to a load.
Common Confusions: Flux vs. Density and Permanent vs. Electro
When reading datasheets for transformers or inductors, DIYers frequently mix up a few key magnetic terms.
Magnetic Flux (Webers) vs. Flux Density (Teslas)
Magnetic Flux ($\Phi$) is the total amount of magnetic field passing through a given area, measured in Webers (Wb). Flux Density ($B$) is how tightly packed those magnetic field lines are in a specific spot, measured in Teslas (T) or Gauss. Analogy: Flux is the total gallons of water flowing through a pipe; flux density is the water pressure (gallons per square inch). Core saturation happens when the flux density exceeds the material's limit, causing inductance to plummet.
Electromagnetism vs. Permanent Magnetism
Permanent magnets (like neodymium) have aligned magnetic domains that stay locked in place. Electromagnets rely on current. A common mistake in circuit design is assuming an electromagnet's core behaves linearly. In reality, ferromagnetic cores exhibit hysteresis—they retain a small amount of magnetism (remanence) after the current is removed, and require a reverse voltage (coercivity) to truly reset to zero. This is critical in AC transformer design but mostly negligible for simple DC relay drivers.
Decision Tree: Protecting Switches from Inductive Kickback
Because magnetism guarantees a voltage spike when you interrupt an inductive load, you must install a snubber or flyback device. Use this decision table to select the exact component for your workbench build.
| Load Type & Switching Profile | Protection Mechanism | Concrete Part Pick | Why This Pick? |
|---|---|---|---|
| DC Relay / Solenoid (Slow switching, < 10 Hz, simple on/off) |
Standard Flyback Diode (Reverse biased across coil) | 1N4007 (1A, 1000V) | Cheap, handles the slow decay of the magnetic field. Clamps spike to ~0.7V above supply. |
| DC Solenoid / Valve (Fast PWM control, < 1 µs switching) |
TVS (Transient Voltage Suppression) Diode | SMAJ15A (15V clamp, 400W peak) | Standard diodes are too slow for fast PWM. TVS clamps in picoseconds, saving your MOSFET. |
| AC Contactor / Motor (Mains voltage, zero-cross switching) |
RC Snubber Network (Resistor + Capacitor in series) | 100Ω + 0.1µF (X2 safety rated) | Diodes don't work on AC. The capacitor absorbs the spike; the resistor damps the LC resonance. |
Frequently Asked Questions
Can I just use a higher voltage MOSFET to survive the back-EMF spike?
No. While a 600V MOSFET might survive the 5,000V spike calculated earlier, the spike will still find a way to arc across your PCB traces, cause electromagnetic interference (EMI) that resets your microcontroller, or eventually degrade the silicon through repeated avalanche stress. Always suppress the magnetic energy at the source.
Does the physical orientation of the flyback diode matter?
Absolutely. The cathode (stripe) of the diode must point toward the positive supply voltage. If you install it backward, the diode will act as a dead short across your power supply the moment you energize the coil, instantly blowing your fuse or destroying your power supply.
Why do solid-state relays (SSRs) not need flyback diodes on the load side?
Most AC SSRs use TRIACs or back-to-back SCRs that naturally turn off at the "zero-cross" point of the AC sine wave. Because the current is already at zero when the switch opens, $di/dt$ is minimal, meaning the magnetic field collapses gently without generating a massive voltage spike. For more on SSR mechanics, check out the SparkFun Relays Tutorial.
What happens if I put an iron core inside my air-core inductor?
The magnetic permeability of iron is thousands of times higher than air. Inserting an iron or ferrite core will drastically increase your inductance ($L$), allowing you to store much more magnetic energy in a smaller physical footprint. However, it also introduces core losses (eddy currents and hysteresis) and a hard saturation limit.






