In physics, a magnet is defined as any object or material that generates a persistent magnetic field, exerting an attractive or repulsive force on ferromagnetic materials and interacting with moving electrical charges. In a real circuit or installation, magnetism fundamentally changes how energy is stored and transferred, dictating the physical actuation of electromechanical relays, the impedance of inductors, and the destructive voltage spikes (back-EMF) generated when current is interrupted.
The Physics of Magnetism: Fields, Flux, and Ferromagnetism
To move beyond textbook abstractions, we have to separate the cause of magnetism from the effect. When you run current through a coil or observe a permanent magnet, you are dealing with two distinct but related vector quantities: Magnetic Field Strength ($H$) and Magnetic Flux Density ($B$).
Magnetic Field Strength ($H$), measured in Amperes per meter (A/m), is the effort you put into the system. It is driven purely by the current and the geometry of your coil, regardless of what material is inside it. Magnetic Flux Density ($B$), measured in Tesla (T), is the actual result—the concentration of magnetic field lines passing through a given area. The bridge between the two is permeability ($\mu$), which describes how easily a material supports the formation of a magnetic field within itself.
| Property | Symbol | Unit | What it means on the bench |
|---|---|---|---|
| Magnetic Field Strength | $H$ | A/m | The 'push' generated by your coil's current and turns. |
| Magnetic Flux Density | $B$ | Tesla (T) | The actual magnetic 'crowding' that creates physical force. |
| Permeability | $\mu$ | H/m | The core material's multiplier effect (iron vs. air). |
For a deeper look at the mathematical relationship between these vectors, the HyperPhysics project at Georgia State University provides excellent interactive vector breakdowns.
Worked Numeric Example: Sizing a 12V DC Solenoid
Let’s calculate the physical pull force of a custom-wound 12V DC relay coil to see how these physics translate to real mechanical work. Assume we have a mild steel core with a relative permeability ($\mu_r$) of 400, wound with 500 turns of wire over a 5 cm (0.05 m) length. The coil resistance is 60 $\Omega$, meaning at 12V, it draws 0.2 A.
Step 1: Calculate Magnetic Field Strength ($H$)
$H = (N \times I) / L$
$H = (500 \times 0.2) / 0.05 = 2,000 \text{ A/m}$
Step 2: Calculate Flux Density ($B$)
Using the permeability of free space ($\mu_0 \approx 1.256 \times 10^{-6} \text{ T}\cdot\text{m/A}$):
$B = \mu_0 \times \mu_r \times H$
$B = (1.256 \times 10^{-6}) \times 400 \times 2,000 \approx 1.0 \text{ Tesla}$
Step 3: Calculate Pull Force ($F$)
The force exerted on a flat steel armature is $F = (B^2 \times A) / (2 \times \mu_0)$. If our core cross-sectional area ($A$) is 1 cm² (0.0001 m²):
$F = (1.0^2 \times 0.0001) / (2 \times 1.256 \times 10^{-6})$
Where You Meet Magnetism in Practical Circuits
You don't need to be building MRI machines to deal with magnetic fields. Here is where this physics definition directly impacts your daily bench and jobsite work:
- Relays and Contactors: Electromagnets convert electrical current into mechanical motion to isolate high-voltage AC loads from low-voltage DC control circuits (like an ESP32 GPIO driving a 240V water heater).
- Inductors and Transformers: These components store energy in magnetic fields. The physics of core saturation dictates why a buck converter inductor fails if you exceed its rated DC bias current.
- Hall Effect Sensors: Devices like the ACS712 measure current by detecting the magnetic flux density generated by a conductor, allowing for non-invasive AC/DC current monitoring.
- EMI and Signal Integrity: Stray magnetic fields from unshielded power inductors can induce noise in high-impedance analog traces, ruining your ADC readings. This is why physical layout and magnetic shielding matter in mixed-signal PCB design.
Bench Scenario Walkthrough: The Air Gap Drop-Out Failure
Theory assumes perfect conditions; the workbench rarely delivers. Here is a real-world scenario where ignoring the physics of magnetic reluctance caused a system failure.
- Setup: I was designing a custom 24V DC magnetic latching relay for a solar battery disconnect. I used a high-permeability silicon steel core and wound 800 turns of 24 AWG magnet wire. The armature was machined from cold-rolled steel.
- Numbers: Based on the math above, the coil should generate 60 N of holding force at 0.5A. The mechanical spring return was rated for 15 N. I had a comfortable 4x safety margin.
- Outcome: On the bench, the relay chattered violently and failed to latch. It drew the expected 0.5A but produced only about 10 N of force—well below the spring threshold.
- What went wrong: The mating surface of the armature had a microscopic 0.5mm layer of non-magnetic zinc plating from the hardware store, plus a slight machining burr. This created an effective 'air gap' of roughly 0.6mm. Think of magnetic flux like highway traffic and the iron core as a wide-open freeway; an air gap is a sudden one-lane dirt road bottleneck that brings the flow to a crawl. Because air has a relative permeability of 1 (compared to steel's 400+), that tiny 0.6mm gap increased the total magnetic circuit reluctance by a factor of 5. This slashed the flux density and dropped the pull force below the spring threshold.
The Fix: I milled the mating surfaces flat, masked them during plating, and added a 0.1mm brass shim to prevent residual magnetism from keeping the relay stuck when power was removed.
Common Confusions and Troubleshooting FAQs
What do people commonly confuse magnetism with in electronics?
The most common confusion is mixing up Magnetic Field ($H$) and Magnetic Flux Density ($B$). Hobbyists often assume that doubling the current in an electromagnet will double the physical pull force. However, if the iron core reaches magnetic saturation (usually around 1.5 to 2.0 Tesla for standard steels), increasing $H$ further will barely increase $B$. The core simply cannot hold any more magnetic flux, and the extra current just generates waste heat. For a great primer on core saturation, check out the All About Circuits DC textbook chapter on magnetic flux.
Why does a magnet/inductor fry my microcontroller?
This is the physics of back-EMF (electromotive force). When you de-energize a relay coil, the magnetic field collapses rapidly. According to Faraday’s Law of Induction, a changing magnetic field induces a voltage. Because the collapse happens in milliseconds, the induced voltage spikes to hundreds of volts in reverse polarity, instantly destroying the output transistor on your Arduino or ESP32. Always use a flyback diode (like a 1N4007) wired in reverse bias across the coil to safely recirculate this energy.
Are permanent magnets and electromagnets treated the same in circuit design?
No. In circuit analysis, electromagnets (inductors/coils) are treated as reactive components that store energy and oppose changes in current. Permanent magnets are generally treated as external environmental factors. However, in motor design (like BLDC or stepper motors), the permanent magnets on the rotor interact with the electromagnets on the stator, generating back-EMF that limits the motor's top speed. If you are driving motors, the Adafruit Motor Selection Guide is a highly practical resource for matching these magnetic forces to your driver boards.






