ElectronicsInfolineLearnAll schools

Electromagnets & the Solenoid

11 min read

Before this: Magnetic Fields

Quick Answer

Electromagnetism is the production of a magnetic field by an electric current. Wind N turns over a length and the coil's field depends on the ampere-turns, the turns times the current, divided by that length. A ferromagnetic core multiplies the result until the core saturates.

Intuition

A nail, some wire, and a switch

Wind twenty turns of wire round an iron nail, touch the ends to a battery, and the nail picks up paperclips. Lift the wire off and they drop. An electromagnet needs nothing more than that, and it is the reason magnetic fields matter to electronics rather than only to geology.

A permanent magnet is fixed. Its strength is set at the factory, it cannot be turned off, and the only thing you can change is where you put it. An electromagnet is a magnet with a control input. You can switch it, reverse it, fade it up and down, and make it as weak or as strong as your supply and your patience allow. Every doorbell, relay, loudspeaker, motor and transformer in this course is built out of that one capability.

The trick that makes a coil worth winding is stacking. A single loop of wire produces a feeble field. Wind a second loop right beside it carrying the same current the same way round, and the two fields add. Wind four hundred and they all add. The wire has not got any better at making magnetism; you have simply arranged for the same current to pass the same point four hundred times, and the field counts every pass.

Practitioner

What ampere-turns buy you

Because turns and current enter the same way, the useful quantity is their product, called the magnetomotive force and quoted in ampere-turns:

Spread that mmf along the coil's length and you get the magnetising field H, in amperes per metre, which is what the coil is doing to the space inside it:

The flux density that results also depends on what is inside the coil, and putting the two together gives the working relationship for a long solenoid:

Worked example — A 400-turn coil, wound over 80 mm

With 400 turns carrying 0.5 A, the mmf is 200 A ampere-turns. Spread over a winding length of 80 mm, that is a magnetising field of 2500 A/m.

With nothing but air inside, and the magnetic constant 1.2566 µH/m, the flux density on the axis comes out at 3.14 mT.

A solenoid in section with its computed ampere-turns and axial flux density

Three millitesla is not much — about sixty times the Earth's field, from a coil drawing half an amp. Air is a poor thing to put inside an electromagnet. A ferromagnetic core is a much better one, and the factor by which it improves matters is its relative permeability, covered properly in permeability and core materials.

Worked example — The same coil, with and without a ferrite core

Drop the current to 10 mA and the air-cored coil gives only 62.8 µT.

Slide in a ferrite core of relative permeability 2000 and the same coil, at the same current, gives 126 mT — two thousand times more, for no extra power at all.

That multiplication costs nothing electrically. It is not free in every other sense, and the next layer is about the bill.

Two working habits follow from the shape of these relationships. Because turns and current appear only as their product, a coil specified in ampere-turns can be rewound for a different supply without touching the magnetics at all: halve the turns, double the current, and the field is unchanged. And because the length in the denominator is the winding length rather than the wire length, packing the same turns into a shorter coil raises the field, which is why solenoid actuators are short and stubby while sensing coils are often long and thin.

Direction follows the same right-hand grip rule the single conductor obeyed, applied to one turn and then repeated: thumb along the current in the winding, fingers curling into the bore. Point the thumb the other way, or reverse the supply, and the coil's north end swaps ends. A coil driven from an H-bridge can therefore attract or repel the same permanent magnet on command, which is the mechanism behind every latching relay and every voice coil in this course.

Engineer

Saturation, and where the arithmetic stops

Run the cored coil back up to the half-amp the air-cored version used, and the relationship predicts 6.28 T. No such flux density exists in any ordinary material. The strongest laboratory electromagnets reach a few tesla, and a ferrite gives up well below one.

What the relationship omits is that a core's permeability is not a constant. It is enormous while the core's domains still have room to line up with the applied field, and it collapses towards the value for empty space once they have all lined up. That collapse is saturation, and past it the core has nothing left to contribute.

The separation of H from B is what makes this tractable. H is the coil's own doing: ampere-turns per metre, independent of what sits inside the bore, and unchanged whether the core is ferrite, iron or nothing at all. B is the response, and only the response knows about the material. Writing the solenoid relationship as the product of those two — the field the coil applies, times what the material does with it — is the same statement split in the place where the non-linearity actually lives, and it is how core datasheets are drawn.

Worked example — Where this core runs out

Take 400 mT as an illustrative saturation level for a common ferrite — the grade's own datasheet is what governs in a real design. Rearranging the solenoid relationship for the current that reaches it gives 31.8 mA.

Flux density against coil current for an air core and a saturating ferrite core

Thirty-two milliamps. The coil is rated for far more, the wire will not notice, and the core is finished. Everything above that current goes into heat and into a slightly stronger field, at the permeability of air rather than of ferrite.

This is why the same coil appears in a datasheet with two quite different current ratings: a thermal one, set by the wire, and a saturation one, set by the core. Which of the two you hit first depends entirely on the core, and inductance falls off a cliff at the second — the point inductance makes about the long-solenoid relationship, seen from the other side.

Two further limits of the model deserve naming. It assumes the coil is long compared with its diameter, and a short fat coil produces materially less than it predicts, because the field spreads out of the ends instead of running straight through. And it says nothing about what happens outside the coil: an air-cored solenoid throws a substantial field into the room around it, which is why a toroid, whose field closes inside its own ring, is the quiet choice when a neighbouring circuit is listening. That difference is one of the practical roots of EMI and EMC.

Professional

Designing a coil that survives its own heat

An electromagnet's field is bought with ampere-turns, and ampere-turns are bought with either copper or power. More turns of thinner wire raises the resistance; fewer turns of thicker wire raises the current needed. Since the dissipation goes as the square of the current, thin-and-many usually wins where there is room for it, and where there is not, the coil runs hot.

Worked example — A relay coil on a 12 V rail

A coil of 400 Ω across 12 V draws 30.0 mA and dissipates 360 mW. With 3000 turns that is 90.0 A ampere-turns, continuously, for as long as the relay is held in.

That number explains two things you meet in relay datasheets. The first is why hold current is specified lower than pull-in current: once the armature has closed, the magnetic path has no air gap left in it and needs far fewer ampere-turns to stay closed, so a well-designed drive backs off after operating. The second is why coil resistance is quoted with a temperature: the copper's resistance climbs as the coil warms, the current falls, the ampere-turns fall with it, and a relay that was marginal when cold can drop out when hot.

Force is where the field does its work. For a straight conductor lying across a field, at right angles to it, the force is the product of the flux density, the current and the length of conductor actually in the field:

Worked example — A loudspeaker voice coil

A gap flux density of 1.0 T, with 6.0 metres of wire wound into that gap, carrying 1.0 A, gives 6.0 N of force on the cone.

Six newtons for one amp, from a coil small enough to sit in your palm, and the force reverses when the current does. A loudspeaker works on nothing more than that: a permanent magnet holds the gap flux density steady, the current carries the signal, and the cone follows. Read the same structure in the other direction and it is a microphone, which is the subject of motors and generators.

The last thing to design for is switch-off. A coil is an inductor, it stores energy in its field, and interrupting its current forces that energy out somewhere — usually across the contact or transistor that did the interrupting, at whatever voltage it takes. Relays and solenoids are the classic case, and the classic fix is a diode across the coil. Energy stored in an inductor sets out the arithmetic and the hazard in full; the habit worth forming now is that every coil you switch gets a defined path for its stored energy, chosen by you rather than found by the circuit.

Common mistakes

  • Quoting turns without current, or current without turns — neither alone tells you anything. A hundred turns at one amp and a thousand turns at a hundred milliamps produce identical mmf, and often the choice between them is thermal rather than magnetic.
  • Trusting the solenoid relationship past saturation — it is linear in current and the core is not. Above the knee, extra current buys heat and very little flux, and the inductance the coil was chosen for has already gone.
  • Ignoring the winding length — the same turns spread over twice the length give half the field. Turns per metre is the quantity that matters, not the turns.
  • Using a short, fat coil and expecting the long-solenoid answer — the relationship assumes length well above diameter. A squat coil leaks field out of its ends and falls short of the prediction.
  • Switching a coil with nothing across it — the collapsing field will find its own path out, and the voltage it reaches is set by how fast the current is interrupted rather than by the supply.

Frequently asked questions

What are ampere-turns, and why not just quote current?

Ampere-turns are the turns multiplied by the current, and they are what the magnetic circuit actually responds to. Doubling the turns and halving the current changes nothing magnetically, so a coil specified in ampere-turns can be rewound for a different supply voltage without redesigning the magnetics.

Does an iron core make an electromagnet stronger for free?

Electrically, yes — the same current gives a much larger flux density. The costs are weight, cost, losses when the field changes, and a hard ceiling at saturation that the air-cored version does not have.

Why does a relay need less current to hold than to operate?

Pulling in has to drive flux across an air gap, which is thousands of times harder than driving it through iron. Once the gap closes, the same flux needs far fewer ampere-turns, so the coil can be run at reduced current to save heat.

What is the difference between H and B?

H is what the coil applies, set by ampere-turns per metre and nothing else. B is what results, and it depends on the material as well. In empty space they are proportional; in a core they are not, and the ratio changes with how hard you drive it.

Why does a toroidal coil radiate less than a straight one?

Its magnetic path closes on itself inside the ring, so very little field escapes into the space around it. A straight solenoid has to return its flux through the room, and anything else in the room is in that return path.

Knowledge check

A 400-turn coil over 80 mm gives 3.14 mT in air at 0.5 A. What does 800 turns over the same length give at the same current? (Show answer)
6.28 mT. Flux density is proportional to turns per metre, so doubling the turns doubles it.
You need 200 ampere-turns from a 1000-turn coil. What current? (Show answer)
200 mA — the mmf is turns times current, so the current is the mmf divided by the turns.
The same coil with a ferrite core of relative permeability 2000 saturates at 31.8 mA. What does raising the current to 100 mA buy? (Show answer)
Almost nothing magnetically. Past saturation the core behaves like air, so the extra current adds only the small air-cored contribution, and adds heat in proportion to its square.
A voice coil sits in a 1.0 T gap with 6.0 metres of wire in the field. What force does 1.0 A produce, and what happens if the current reverses? (Show answer)
6.0 N, and reversing the current reverses the force. That is how the cone is pushed and pulled by an alternating signal.