How does an Electromagnet Work?

Science — James William Steven Parker

An electromagnet is a device that produces a magnetic field by passing electric current through a conductor, usually a coil of wire. When current flows through the wire, it generates a magnetic field around the conductor. If the wire is wound into many turns, the magnetic fields produced by the individual turns combine, producing a substantially stronger and more organised field inside and around the coil.

A coil designed to produce a strong magnetic field is called a solenoid when it has an approximately cylindrical geometry. An iron or other ferromagnetic core is often inserted into the coil because the material becomes magnetised and concentrates magnetic flux through the core and surrounding magnetic circuit. Unlike an ordinary permanent magnet, an electromagnet can usually be switched on and off by controlling the current. Its strength can also be varied by changing the current, number of turns or magnetic circuit. This controllability makes electromagnets fundamental to relays, electric motors, loudspeakers, lifting magnets, valves, actuators, magnetic locks and many other devices.

The magnetic field around a straight current carrying wire forms circular patterns around the wire, with direction determined by the right hand grip rule. If the right hand thumb points in the conventional direction of current, the curled fingers indicate the direction of the magnetic field around the conductor. When the wire is wound into a coil, the circular fields from adjacent turns reinforce one another inside the coil and partially cancel outside depending on the geometry.

For a long ideal solenoid, the magnetic field inside is approximately proportional to the permeability of the material, the number of turns per unit length and the current. A simplified expression in a vacuum is B approximately equal to mu zero n I, where mu zero is the permeability of free space, n is turns per unit length and I is current. Real coils have finite length, field leakage and nonuniform magnetic fields, so the ideal equation is an approximation. The coil geometry determines both field strength and field distribution.

A ferromagnetic core greatly increases the magnetic field that can be produced for a given current because the applied field aligns magnetic domains and magnetises the material. Iron is particularly useful because it has high magnetic permeability and can strongly concentrate magnetic flux. The core does not create the magnetic field independently of the current in the coil. Instead, the current generates the magnetising field and the material responds by becoming magnetised.

Soft magnetic materials are often preferred for electromagnets because they magnetise readily and lose much of their magnetisation when the current is removed. Hard magnetic materials are better suited to permanent magnets because they retain magnetisation. Real core materials also exhibit saturation, meaning that increasing current eventually produces diminishing increases in magnetisation. Hysteresis causes the magnetic response to depend partly on the material's previous magnetic state, and energy can be lost as heat during repeated magnetisation cycles.

The strength of an electromagnet depends on several interacting factors. Increasing current generally increases the magnetic field until magnetic saturation or other practical limits are reached. Increasing the number of turns can increase the magnetomotive effect of the coil, particularly when the coil geometry is maintained. Reducing the magnetic reluctance of the magnetic circuit can also increase useful magnetic flux. A ferromagnetic core with an appropriate shape can guide flux efficiently through a desired path.

Air gaps are often deliberately included in electromagnetic devices because they affect inductance, force and energy storage. The wire's resistance determines how much electrical power is converted into heat, with power approximately equal to I squared R for a resistive coil. Excessive current can therefore overheat the winding and damage insulation. Engineers balance magnetic performance against electrical losses, temperature, weight, size, material properties and required response time when designing electromagnets.

An electromagnet can produce mechanical force because magnetic fields interact with magnetic materials and magnetic moments. If an iron object is placed near an energised electromagnet, the magnetic field magnetises the object and produces a force drawing it toward regions of stronger magnetic field. This principle is used in lifting magnets for handling ferromagnetic materials. Electromagnetic relays use a coil to attract an armature and mechanically switch contacts. Solenoid valves use electromagnetic force to move a plunger and control fluids.

Electric motors use coils and magnetic fields to create torque rather than simply attracting an iron object. Loudspeakers pass varying current through a coil located in a magnetic field, producing forces that move a diaphragm and generate sound. These applications demonstrate that an electromagnet is not merely a magnet powered by electricity. It is an electrical to magnetic energy conversion device whose field can produce controlled forces and motion.

Electromagnets can operate with direct current or alternating current, but their behaviour differs. With direct current, the magnetic field has a substantially steady direction after transients have died away. With alternating current, the field changes direction and magnitude periodically. An iron core subjected to alternating magnetisation can experience hysteresis and eddy current losses, producing heat. Laminated cores or ferrite materials can reduce eddy current losses in appropriate applications.

Electromagnetic devices designed for high frequency operation often use materials with suitable magnetic properties and carefully controlled geometry. The inductance of the coil also matters because changing current produces an induced voltage that opposes the change according to Lenz's law. This means that an electromagnet cannot necessarily be switched instantaneously. The electrical and magnetic properties of the coil form a coupled dynamic system in which resistance, inductance, core behaviour and applied voltage determine how quickly the current and field respond.

Electromagnets are closely related to the broader principle that electric currents generate magnetic fields. This relationship is one component of classical electromagnetism and is quantitatively described by Ampere's law and the Maxwell equations. A changing magnetic field can also induce an electric field, establishing the reciprocal relationship that makes electromagnetic induction possible. Thus an electromagnet can also behave as an inductor, storing energy in its magnetic field when current flows.

In an ideal linear inductor, stored magnetic energy is one half L I squared, where L is inductance and I is current. When current changes, energy can be returned to the circuit or dissipated through resistance and other mechanisms. Real magnetic cores make the relationship between current and flux nonlinear, especially near saturation. Understanding electromagnets therefore requires considering both field generation and energy storage.

The historical development of electromagnets followed the discovery that electric currents affect magnetic needles and magnetic materials. After Oersted demonstrated the magnetic effect of electric current, researchers developed coils and solenoids capable of producing strong controllable magnetic fields. William Sturgeon constructed early practical electromagnets, and Joseph Henry developed powerful electromagnets and investigated electromagnetic induction and relays. Electromagnets subsequently became central to telegraphy, electrical switching and machinery.

Modern electromagnets range from tiny coils inside electronic actuators to enormous superconducting magnets used in scientific instruments and particle accelerators. Superconducting electromagnets can carry very large currents with extremely low electrical resistance when maintained below their critical conditions, enabling exceptionally strong magnetic fields. The fundamental operating principle remains the same across these scales: electric current creates a magnetic field, and appropriate geometry and magnetic materials concentrate and control that field to produce useful electromagnetic forces and energy storage.