An electromagnet is a temporary magnet created by passing an electrical current through a coil of wire, usually wrapped around a ferromagnetic core, to generate a controllable magnetic field. When you drop an electromagnet into a real circuit, it fundamentally changes the load profile: it introduces inductance, draws a high inrush current, stores energy in a magnetic field, and generates a high-voltage reverse polarity spike (back-EMF) when the circuit opens. If you are driving one with a microcontroller or transistor, ignoring these circuit changes will instantly destroy your switching components.

The Core Physics and a Worked Numeric Example

The pulling force of an electromagnet is dictated by its Ampere-turns (NI), which is the product of the current flowing through the wire and the number of wire loops around the core. According to Georgia State University's HyperPhysics, the magnetic field strength inside a solenoid is directly proportional to this NI value and the permeability of the core material. Magnetic Force ∝ (NI)²

Let’s run a worked numeric example to size a coil for a 12V DC DIY linear solenoid (like a custom door lock). We need enough force to pull a steel plunger, which requires roughly 1,000 to 1,500 Ampere-turns for a small mechanism.

Worked Example: 12V DC Solenoid Coil
  • Target: ~1,400 Ampere-turns at 12V DC.
  • Core: 1/2-inch diameter 1018 cold-rolled steel rod.
  • Wire: 28 AWG polyurethane-coated enameled copper (magnet wire).
  • Geometry: We wind 1,000 turns. The average circumference of the wound coil is 40mm (0.04m). Total wire length = 1,000 × 0.04m = 40 meters.
  • Resistance: 28 AWG copper has a resistance of ~0.2129 Ω/m. Total Resistance (R) = 40m × 0.2129 Ω/m = 8.51 Ω.
  • Current (I): Using Ohm’s Law (I = V/R), 12V / 8.51 Ω = 1.41 Amps.
  • Ampere-Turns (NI): 1.41A × 1,000 turns = 1,410 AT.
  • Power Dissipation: P = V × I = 12V × 1.41A = 16.9 Watts.

At 16.9W, this coil will get hot to the touch (approx. 60°C) if left energized continuously. For a continuous-duty magnetic lock, you would need to step up to 32 AWG wire to increase resistance and lower the current, or implement a pulse-width modulation (PWM) circuit to drop the holding voltage to 4V after the initial pull-in.

What People Commonly Confuse With Electromagnets

The most common bench mistake is treating an electromagnet exactly like an inductor or choke coil. While both are coils of wire that generate magnetic fields, their design goals are exact opposites:

  • Inductors (Chokes): Designed to contain the magnetic field. They use powdered iron or ferrite cores with distributed air gaps to store energy, filter AC noise, and oppose changes in current without saturating. You do not want an inductor to pull on external metal.
  • Electromagnets: Designed to leak the magnetic field out of the core and into an air gap to do mechanical work. They use solid, high-permeability soft iron or low-carbon steel cores to maximize flux density at the pole faces.

Another common confusion is assuming any steel will work as a core. Hardened steel or stainless steel (like 304 or 316) retains magnetism (remanence) or is non-magnetic (austenitic). If you use hardened steel, your electromagnet will stick to the plunger even after you cut the power. You must use "soft" magnetic materials like 1018 low-carbon steel or pure iron that lose their magnetism the moment the current stops.

Where You Meet This in Practice

You interact with electromagnets constantly in residential and industrial electrical systems, usually hidden inside plastic housings:

  • Relays and Contactors: The coil inside a 24V HVAC contactor is an electromagnet. When energized, it pulls a steel armature that physically slams heavy-duty contacts together to start a 5-ton compressor.
  • Solenoid Valves: In irrigation or pneumatic systems, an electromagnet lifts a small plunger against water or air pressure to open the valve.
  • Magnetic Locks (Maglocks): Used in commercial access control, these are massive, continuous-duty electromagnets that can hold 1,200 lbs of force, utilizing a perfectly flat mating surface to minimize the air gap.
  • Circuit Breakers: The magnetic trip mechanism inside a standard thermal-magnetic breaker uses a small electromagnet. During a short circuit, the massive current spike creates enough magnetic pull to instantly unlatch the mechanical switch.

Decision Tree: Sizing Your Coil and Core

Use this decision path to select the right materials for your specific application. As noted in the All About Circuits DC theory guide, matching your core permeability and wire insulation class to your duty cycle is critical for preventing thermal failure.

Application Scenario If Your Requirement Is... Then Select This Wire & Core
12V/24V Intermittent Pull (DIY locks, actuators) High force, low duty cycle (<25%), budget-friendly 28 AWG standard polyurethane magnet wire + 1018 cold-rolled steel rod
12V/24V Continuous Hold (Maglocks, holding relays) Low heat generation, 100% duty cycle, long life 32 AWG or 34 AWG wire (higher resistance) + Soft iron (Armco) core
120V/240V AC Contactors (Mains switching) AC operation, zero mechanical chatter Pre-wound AC bobbin with a shading coil (shaded pole) + Laminated silicon steel core to prevent eddy current heating
High-Temp Environment (Under-hood automotive, industrial) Ambient temps >105°C, solvent exposure Polyimide (Kapton) coated wire (Class H/C) + High-temp epoxy potting
The Default Bench Pick: If you are building a standard 12V or 24V DC linear solenoid for a robotics or home automation project and need a reliable starting point, buy a 1 lb spool of 28 AWG polyurethane-coated magnet wire and a 1/2-inch diameter 1018 cold-rolled steel rod. This combination provides an excellent balance of mechanical pull force, manageable heat for intermittent duty, and easy solderability (polyurethane coating melts away with a standard 400°C soldering iron tip, eliminating the need to scrape the wire).

Circuit Protection: Taming the Flyback Voltage

Because an electromagnet is an inductive load, it resists changes in current. When your driving transistor or mechanical switch opens the circuit, the magnetic field collapses rapidly. This induces a massive reverse voltage spike ($V = L \frac{di}{dt}$) that can easily exceed 100V, instantly punching through the junction of a driving MOSFET or BJT.

You must install a flyback diode (also called a freewheeling diode) in reverse bias across the electromagnet’s terminals. When the circuit opens, the diode provides a safe path for the collapsing field’s current to circulate and dissipate as heat.

  • Standard Release: Use a 1N4007 rectifier diode. It is cheap, handles 1A easily, and safely clamps the spike to ~0.7V. However, it causes the electromagnet to release slowly because it allows the current to decay gradually.
  • Fast Release: If you need the solenoid to drop out instantly (e.g., high-speed sorting actuators), use a TVS (Transient Voltage Suppression) diode or a Zener diode in series with a standard diode. This clamps the spike at a higher voltage (e.g., 24V or 36V), forcing the current to dissipate much faster and dropping the plunger immediately.

Frequently Asked Questions

Can I use a neodymium permanent magnet as the core for an electromagnet?
No. Neodymium is a "hard" magnetic material with high coercivity. Wrapping a coil around it and applying current will not effectively multiply its magnetic field; instead, you risk partially demagnetizing the permanent magnet if your applied field opposes its polarity. Always use soft magnetic materials like low-carbon steel or iron.

Why does my 120V AC electromagnet hum and vibrate?
AC current crosses zero 120 times a second (on a 60Hz grid). Every time the current hits zero, the magnetic field collapses, and the armature tries to spring back, causing a 120Hz mechanical chatter. AC electromagnets require a "shading coil" (a copper ring embedded in the pole face) that creates a secondary, phase-shifted magnetic field to hold the armature tight during the zero-crossings. If your AC contactor is humming loudly, the shading coil is likely cracked or the pole faces are dirty.

What is the absolute easiest way to test if my coil is burned out?
Disconnect power and use a multimeter to measure the DC resistance across the coil terminals. If it reads infinite (OL), the wire has snapped internally or at the terminal lug. If it reads near 0.0 Ω, the insulation has melted and the coil has shorted to itself or to the metal core.