An electromagnet is a type of magnet in which the magnetic field is produced by an electric current flowing through a wire coil, typically wrapped around a ferromagnetic core, allowing the magnetic force to be turned on, off, or varied by adjusting the current. Unlike permanent magnets that rely on the intrinsic alignment of atomic domains in materials like neodymium, an electromagnet gives the circuit designer direct control over the magnetic flux density simply by altering the applied voltage or the coil's physical geometry.
The Core Physics: How Current Creates Magnetic Flux
When direct current (DC) or alternating current (AC) flows through a conductor, it generates a circular magnetic field around the wire, governed by Ampère’s Law. By winding the wire into a helical coil (a solenoid), these individual circular fields superimpose and combine into a strong, unified, linear magnetic field down the center of the coil.
To amplify this field, we insert a ferromagnetic core—like soft iron or silicon steel—into the coil. The core provides a low-reluctance path for the magnetic flux. Think of the wire coil as a water pump and the magnetic core as a highly conductive pipe; the current (pump pressure) pushes magnetic flux through the core (pipe), but unlike water, the magnetic flux loops back on itself and the core eventually "chokes" or saturates, refusing to carry any more flux regardless of how much current you push.
The choice of core material dictates the efficiency and limits of your electromagnet. If you push a core past its saturation flux density ($B_{sat}$), the relative permeability drops toward that of air, and any additional current simply generates waste heat ($I^2R$ losses) rather than stronger magnetic holding force.
| Core Material | Relative Permeability ($\mu_r$) | Saturation Flux Density ($B_{sat}$) | Primary Use Case |
|---|---|---|---|
| Air / Vacuum | 1 | N/A (Linear) | High-frequency RF coils, applications where saturation must be strictly avoided |
| Manganese-Zinc Ferrite | 1,000 - 15,000 | ~0.4 T | High-frequency switching power supplies, EMI suppression chokes |
| Mild Steel (1018) | ~2,000 | ~1.6 T | DIY electromagnets, basic magnetic locks, low-frequency actuators |
| Silicon Electrical Steel (M19) | ~4,000 | ~2.0 T | AC contactors, transformer cores, industrial motor stators |
| Permalloy (80% Ni, 20% Fe) | ~100,000 | ~0.8 T | Highly sensitive telecom relays, precision magnetic shielding |
For a deeper look at the foundational equations governing these fields, the Georgia State University HyperPhysics database provides excellent interactive vector breakdowns of magnetic field generation.
Worked Example: Sizing an Electromagnet Coil for a 500N Maglock
Let’s translate the electromagnetism theory into a practical bench calculation. Suppose you are building a custom electromagnetic door lock (maglock) that needs to hold a heavy fire door shut. The mechanical design requires a magnetic flux density of 0.8 Tesla (T) across an air gap of 2 mm (0.002 m) when the door is closed.
In a magnetic circuit, the air gap dominates the reluctance. Assuming the steel core's reluctance is negligible compared to the air gap, we can calculate the required Ampere-turns ($NI$) using the simplified formula:
$B = \frac{\mu_0 \cdot N \cdot I}{l_g}$
Where:
$B$ = Target flux density (0.8 T)
$\mu_0$ = Permeability of free space ($4\pi \times 10^{-7}$ T·m/A, or approx $1.2566 \times 10^{-6}$)
$N$ = Number of turns
$I$ = Current in Amps
$l_g$ = Air gap length (0.002 m)
Rearranging to solve for Ampere-turns ($NI$):
$NI = \frac{B \cdot l_g}{\mu_0} = \frac{0.8 \cdot 0.002}{1.2566 \times 10^{-6}} \approx \mathbf{1273 \text{ Ampere-turns}}$
Now, we must select our electrical parameters. If we power this from a standard 12V DC supply and want to limit the steady-state current to 0.5 A to keep coil heating manageable, we can find the required number of turns:
$N = \frac{1273}{0.5} = \mathbf{2546 \text{ turns}}$
To achieve 2546 turns while maintaining a 24-ohm coil resistance (which yields our 0.5A at 12V via Ohm's Law), you would wind approximately 28 AWG polyurethane-enameled copper magnet wire onto a bobbin. If the bobbin window area is too small to physically fit 2546 turns of 28 AWG wire, you must iterate: either increase the supply voltage to push less current through more turns of thinner wire (e.g., 32 AWG), or accept a higher current with fewer turns of thicker wire, which will require a larger thermal mass or a heat sink to dissipate the $I^2R$ copper losses.
Where You Meet Electromagnets in Electrical Installations
Understanding the electromagnet definition in physics is only half the battle; knowing how it behaves in a real circuit is what prevents blown fuses and fried microcontrollers. When you wire an electromagnet into an installation, it fundamentally changes the circuit's impedance profile.
1. Inductance and Inrush Current
Because an electromagnet is essentially a large inductor, it opposes changes in current. When you first apply voltage, the current ramps up slowly based on the circuit's L/R time constant. Furthermore, in devices like AC contactors (e.g., Schneider Electric TeSys series), the inductance is relatively low when the armature is open (large air gap). This results in a massive inrush current—often 5 to 10 times the sealed (holding) current. Once the armature pulls in and closes the air gap, the inductance spikes, and the current drops to the holding level. If the armature gets mechanically jammed and fails to pull in, the coil will overheat and burn out in minutes because it remains stuck in the high-inrush state.
2. Flyback Voltage (Back-EMF)
When you de-energize an electromagnet, the collapsing magnetic field induces a massive voltage spike in the opposite direction ($V = -L \cdot di/dt$). This spike can easily exceed hundreds of volts, even on a 12V system.
Never switch an inductive electromagnet coil with a mechanical relay, toggle switch, or solid-state transistor without a snubber network. For DC coils, wire a standard 1N4007 rectifier diode in reverse-bias directly across the coil terminals. When the circuit opens, the diode provides a safe recirculation path for the collapsing magnetic energy, clamping the voltage spike to roughly 0.7V above the supply rail and preventing catastrophic arcing across your switch contacts or the destruction of your driving MOSFET.
3. AC vs. DC Coil Architectures
If you tear down an AC electromagnet (like those inside industrial motor starters), you will notice a heavy copper ring embedded in the face of the steel core. This is a shading coil. Because AC current crosses zero 120 times a second (on a 60Hz grid), the magnetic pull would drop to zero and cause the armature to violently chatter. The shading coil acts as a shorted secondary transformer winding, creating a phase-shifted magnetic field that maintains holding force during the zero-crossings. DC electromagnets do not need shading coils, but they often require an economizer circuit to drop the voltage after pull-in to prevent thermal failure.
Common Confusions: Electromagnets vs. Solenoids vs. Permanent Magnets
Even experienced makers and junior electricians frequently mix up these terms, leading to incorrect part selection for automation projects.
What is the difference between an electromagnet and a solenoid?
While all solenoids are technically electromagnets, their mechanical design goals are entirely different. An electromagnet is optimized for maximum holding force across a microscopic air gap (like a maglock or a contactor). A solenoid is optimized for linear stroke and motion over a longer distance (like a door latch actuator or a pneumatic valve spool). If you try to use a long-stroke solenoid as a holding electromagnet, it will overheat and fail to hold securely; if you use a holding electromagnet expecting it to pull a lever from an inch away, it will generate almost zero force.
Can I just use a permanent magnet instead to save power?
Not if you need to release the load. Permanent magnets (like N52 Neodymium) provide immense holding force with zero continuous power draw, but turning them off requires physically sliding them away from the target or using a complex mechanical cam to break the magnetic circuit. In fail-safe applications (like fire door maglocks), electromagnets are legally required because they automatically release when building power is cut during a fire.
Why does my DC electromagnet get so hot even when it's just "holding"?
A DC electromagnet relies entirely on the continuous flow of current through the copper wire's resistance to maintain the magnetic field. The heat generated is equal to $I^2R$. If your coil is getting too hot to touch (exceeding the thermal rating of the wire enamel, typically 105°C for standard Class A wire), you need to either increase the number of turns with thinner wire to raise the resistance (lowering the current), or implement a PWM (Pulse Width Modulation) driver that drops the duty cycle to 20% once the armature is fully seated.






