An electromagnet is a temporary magnet created by passing an electric current through a coil of wire, usually wrapped around a ferromagnetic core, generating a magnetic field that disappears when the current stops. In a real circuit, adding an electromagnet introduces significant inductance, which resists changes in current, causes phase shifts in AC systems, and generates destructive high-voltage spikes when switched off in DC systems. Beginners frequently confuse general electromagnets with solenoids; while a solenoid is a specific type of electromagnet engineered to produce linear mechanical motion (like a plunger), a standard electromagnet is primarily designed to generate a static magnetic holding force or transfer magnetic flux.
The Physics of the Coil: Ampere-Turns and Reluctance
To understand how an electromagnet works, you have to look past the physical wire and focus on the magnetic circuit. The strength of an electromagnet is not determined by voltage alone, but by its Magnetomotive Force (MMF), measured in Ampere-turns (AT). The formula is straightforward:
MMF = N × I
Where N is the number of wire turns and I is the current in amperes. You can achieve 1,000 AT by pushing 10 amps through 100 turns, or by pushing 0.1 amps through 10,000 turns. The physical limits of your wire gauge and power supply dictate which route you take.
However, MMF is just the 'pressure' pushing the magnetic field. The actual magnetic flux (measured in Webers) depends on the reluctance of the core material. Think of magnetomotive force (MMF) as water pressure, the magnetic flux as the water flow rate, and the core's reluctance as a narrow section of pipe resisting that flow. Air has incredibly high reluctance. If your coil is just wrapped around a plastic tube (an air-core electromagnet), most of your MMF is wasted. By inserting a ferromagnetic core—like mild steel, silicon steel, or iron—you drop the reluctance by a factor of 1,000 to 5,000, concentrating the flux lines into a powerful, usable magnetic field.
According to Georgia State University's HyperPhysics, the permeability of the core material is the critical multiplier in electromagnet design, but it comes with a catch: magnetic saturation. Once all the magnetic domains in the steel core are aligned, adding more current yields almost zero additional holding force, and all that extra electrical energy simply turns into waste heat.
Worked Example: Sizing a 12V DC Bench Electromagnet
Let’s move from theory to the workbench. Suppose you need to wind a 12V DC holding electromagnet to act as a custom magnetic lock for a cabinet door. You want a continuous duty cycle (it stays on indefinitely) without melting the insulation off the wire.
- Power Supply: 12V DC regulated
- Target Current: 0.5A (to keep thermal dissipation manageable for continuous duty without active cooling)
- Wire: 26 AWG enameled copper magnet wire (Resistance: 40.81 Ω per 1,000 ft at 20°C)
- Core: 1-inch diameter mild steel rod
- Coil Form: 1.5-inch outer diameter (yielding an average turn circumference of ~4.71 inches)
Step 1: Calculate Required Resistance
Using Ohm’s Law (R = V / I), we need a total coil resistance of 12V / 0.5A = 24 Ω.
Step 2: Calculate Wire Length
Since 26 AWG wire has 40.81 Ω per 1,000 ft, the length required for 24 Ω is:
(24 Ω / 40.81 Ω) × 1,000 ft = 588 feet of wire.
Step 3: Calculate Number of Turns
The average length of one turn around the 1.5-inch form is 4.71 inches, or 0.3925 feet.
588 ft / 0.3925 ft per turn = 1,498 turns.
Step 4: Calculate Magnetomotive Force (MMF)
MMF = 1,498 turns × 0.5A = 749 Ampere-turns.
This 749 AT coil will generate a surprisingly strong holding force on the mild steel rod—easily enough to hold a 15 lb steel plate flush against the pole face. As noted in the All About Circuits DC textbook, the tightness of the winding and the physical contact area between the core and the target metal will ultimately dictate the real-world pull force, but the electrical sizing guarantees the coil won't burn up on your bench.
Where You Meet Electromagnets in Practice (And What Confuses Makers)
You interact with electromagnets constantly in electrical installations and electronics projects, though they are usually hidden inside other components.
- Relays and Contactors: The 'coil' listed on a relay datasheet is just an electromagnet. When energized, it pulls a steel armature that closes the high-current mechanical contacts.
- Transformers: A transformer is essentially an AC electromagnet. The primary winding creates a constantly collapsing and expanding magnetic field in the laminated silicon-steel core, which induces a voltage in the secondary winding.
- Maglocks (Electromagnetic Locks): Used in commercial access control. These are pure, massive electromagnets designed for maximum holding force (often 1,200 lbs) rather than mechanical movement.
The Solenoid Confusion: Makers often use the terms interchangeably, but a solenoid is designed to move a plunger through the center of the coil to do mechanical work (like a starter motor solenoid or a sprinkler valve). An electromagnet is designed to hold a surface against its pole face. Solenoids usually have high inrush currents and require duty-cycle limits to prevent overheating, whereas holding electromagnets are often designed for continuous 100% duty cycles.
The Inductive Kickback Hazard: Because an electromagnet is a massive inductor, it stores energy in its magnetic field. When you abruptly cut power to a DC electromagnet using a transistor or a microcontroller GPIO pin, the collapsing magnetic field induces a massive reverse voltage spike (often hundreds of volts). If you wire a 12V relay coil directly to an ESP32 or Arduino without a flyback diode (like a 1N4007 wired in reverse across the coil terminals), that voltage spike will travel backward and instantly brick your microcontroller's silicon. Always provide a path for the inductive energy to dissipate.
Frequently Asked Questions
How does an electromagnet work with AC vs DC current?
With DC current, the electromagnet produces a steady, constant magnetic field with fixed North and South poles. With AC current, the magnetic field constantly expands, collapses, and reverses polarity at the line frequency (e.g., 60 times a second in North America). This causes two major issues in AC electromagnets: eddy currents (which generate massive heat in solid steel cores) and zero-crossing chatter (where the magnetic force drops to zero 120 times a second, causing the armature to buzz). To fix this, AC electromagnets use laminated steel cores (thin insulated sheets) to stop eddy currents, and a copper 'shading ring' embedded in the pole face to keep the magnetic flux from hitting absolute zero during the AC crossover.
Why do electromagnets get hot and how do I prevent burnout?
Electromagnets get hot due to $I^2R$ (copper) losses in the wire and, in AC systems, eddy current and hysteresis losses in the core. To prevent burnout in DC coils, you must size the wire gauge so the steady-state current doesn't exceed the wire's thermal limits (e.g., keeping current density below 500 circular mils per amp). For intermittent-use electromagnets (like a junkyard crane or a starter solenoid), manufacturers use thinner wire and rely on a low duty cycle (e.g., 25% on, 75% off) to allow cooling. If your continuous-duty electromagnet is too hot to touch (exceeding 60°C on the casing), you need to increase the number of turns with a higher-resistance, thinner wire to lower the current draw while maintaining the same Ampere-turns.
What happens to a circuit when an electromagnet is switched off?
When the switch opens, the circuit current attempts to drop to zero instantly. However, the inductor (electromagnet) resists this change in current ($V = L \times di/dt$). The collapsing magnetic field forces the voltage across the coil to spike dramatically in the opposite polarity to keep the current flowing. In a mechanical switch, this causes a visible arc across the contacts, eventually pitting and destroying them. In solid-state circuits, it exceeds the breakdown voltage of the switching transistor, destroying it. Installing a freewheeling (flyback) diode in parallel with the coil clamps this spike to a safe ~0.7V, allowing the stored magnetic energy to circulate and safely dissipate as heat.






