Design the operation of an electromagnetic relay — the electrically operated switch that lets a small control signal switch a large power circuit. Adjust the coil turns, resistance, applied voltage, air gap and return-spring force to see the magnetic pull and pull-in (operate) voltage update in real time, and find a relay that latches its contacts reliably.
Parameters
Coil turns N
turns
Total turns of fine wire wound on the core
Coil resistance R
Ω
DC resistance of the winding (sets the current)
Applied voltage V
V
Control voltage applied to the coil
Armature air gap g
mm
Gap between armature and pole when open
Return-spring force F_s
N
Spring force holding the armature open
Pole cross-section A
mm²
Area through which flux crosses the gap
Results
—
Coil current (A)
—
MMF (A·turns)
—
Gap flux density (T)
—
Magnetic pull (N)
—
Pull-in voltage (V)
—
Operation verdict
—
Relay cross-section — pull-in animation
The coil turns the core into an electromagnet and the flux crosses the air gap to pull the armature. When the magnetic pull exceeds the return-spring force the armature snaps shut and the contacts close; if it does not, the armature stays open.
Air-gap magnetic pull F and flux density B. N: coil turns, I: coil current, g: air gap, A: pole cross-section, μ₀: permeability of free space. The magnetic pull grows with the square of the coil current and is very sensitive to the air gap g.
Coil current I (V: applied voltage, R: coil resistance) and the minimum pull-in voltage V_pull-in at which the magnetic pull just equals the return-spring force F_s.
How an Electromagnetic Relay Operates
🙋
A "relay" is that component that makes a clicking sound, right? What is it actually doing?
🎓
In short, a relay is an electrically operated switch. It is one of the quietly important components in all of electrical engineering: it lets a small, safe, low-power control signal switch a large — possibly dangerous — power circuit, and the two sides are completely electrically isolated. A few milliamps from a microcontroller can switch a 100 V motor, and the relay does that safely.
🙋
Using electricity to move a switch — how does that work in detail?
🎓
Inside it is an electromagnet. A coil of many thousands of turns of fine wire is wound on an iron core. When you apply the control voltage, current flows in the coil and turns the core into an electromagnet. Its field reaches across a small air gap and pulls on a hinged iron armature. Holding the armature open is a return spring. So a relay lives or dies by a single, simple force contest: the magnetic pull on one side and the spring force on the other.
🙋
A force contest — whichever wins decides the contacts. How does the pull change as I raise the voltage?
🎓
While the voltage is low the spring wins and the contacts stay at rest. As you raise the voltage the pull grows — and crucially it grows with the square of the current. It is also very sensitive to the gap: a longer gap weakens the field fast. Move the "applied voltage" slider on the left and watch the pull curve below shoot up like a parabola. At one particular voltage the pull finally equals and then exceeds the spring force — the armature snaps shut and the contacts change over. That is "pull-in", and that voltage is the pull-in (operate) voltage.
🙋
Once it has snapped shut, does it stay shut even if I lower the voltage?
🎓
That is the interesting part. Once the armature is shut the gap is almost zero, so the magnetic pull is now far stronger than it was at the moment of pull-in. The relay stays held even if you drop the voltage well below the pull-in value, and it only releases at a distinctly lower drop-out voltage. That difference between pull-in and drop-out is a hysteresis, and it is exactly what gives a relay its clean, chatter-free, decisive switching action.
🙋
When designing one, how should I set the pull-in voltage?
🎓
In practice the rule is to leave plenty of margin on the pull-in voltage. The supply voltage drifts, and as the ambient temperature rises the copper winding resistance climbs (copper rises about 0.4% per °C), which cuts the current. So choose the turns, gap and spring force so that the pull-in voltage stays at about 70-80% or less of the lowest expected supply voltage. Use this tool to watch the balance between magnetic pull and spring force and design on the safe side.
Frequently Asked Questions
The pull-in voltage is the minimum applied voltage at which the magnetic pull just equals the return-spring force. From the air-gap pull F = B²A/(2μ₀) and the flux density B = μ₀NI/g, you solve for the current I that makes F equal the spring force: pullInCurrent = g·√(2·springForce/(μ₀·A))/N, and then multiply by resistance: pullInVoltage = pullInCurrent·R. This tool uses that formula to find the operate voltage and compares it with the present applied voltage to decide whether the relay operates.
Magnetic pull is inversely proportional to the square of the air gap g, so it is extremely sensitive to the gap. Once the armature snaps shut the gap is almost zero, and the pull is far stronger than it was at the moment of pull-in. As a result the relay stays held even when the applied voltage falls well below the pull-in value, and it only releases at a distinctly lower drop-out voltage. This difference between pull-in and drop-out is a hysteresis, and it gives the relay its clean, chatter-free, decisive switching action.
The magnetic pull is F = B²A/(2μ₀) with B = μ₀NI/g. The most effective change is reducing the air gap g, since F is inversely proportional to g squared. Next, raise the magnetomotive force NI (turns times current) — add turns, or lower the resistance so a given voltage drives more current. A larger pole cross-section A increases F proportionally. Note that more turns also raise the resistance, and closing the gap too far causes contact problems with assembly tolerances, so it is a balanced trade-off in practice.
If the magnetic pull is below the return-spring force, the armature does not latch and the contacts do not change over. Fixes are: (1) raise the applied voltage to increase the current, (2) close the air gap to raise the flux density, (3) weaken the return spring, and (4) add coil turns or enlarge the pole area. In practice, allow for supply-voltage variation and the rise in coil resistance with temperature (copper rises about 0.4% per °C), and keep the pull-in voltage well below the minimum supply voltage with adequate margin (around 70-80% or less).
Real-World Applications
Automotive electrical systems: A car carries dozens of relays. Headlights, wipers, fuel pump, starter motor and the air-conditioning compressor clutch — almost every load that draws large current is switched through a relay. The thin wiring at switches and the ECU never carries the load current; it only carries the small primary current of the relay, which keeps the wiring thin, cheap and safe. Because automotive supplies swing widely (a 12 V system can range roughly 9-16 V) and the temperature range is harsh, margin design on the pull-in voltage is especially important.
Industrial sequence control: Inside a control panel, PLC outputs, power relays and various auxiliary relays form logic circuits. Motor forward/reverse, heater on/off and interlocks (safety conditions) are realized by combinations of relay contacts. Because a relay isolates its input from its output, it is also used to separate a noisy power circuit from a sensitive control circuit.
Home appliances and office equipment: Microwave ovens, washing machines, air-conditioner outdoor units, and the fusing heaters of printers and copiers all rely on relays to safely switch 100 V / 200 V mains loads from a microcontroller. For heater and motor loads with large inrush current, the contact rating is given generous headroom to prevent welding, sometimes combined with zero-cross switching.
Protective relays in power systems: In substations and switchgear, "protective relays" guard the grid by detecting faults such as overcurrent, earth fault and overvoltage and tripping the breaker. Setting the operate voltage and operate time (the thresholds) is at the heart of system protection, and the idea this tool illustrates — that a threshold is set by the force balance between magnetic pull and spring force — is also the basis for understanding how such protective relays are set.
Common Misconceptions and Pitfalls
The most common mistake is assuming "if I apply the rated voltage it will always operate". A relay datasheet quotes a "rated voltage", but pull-in is actually guaranteed at the lower "operate voltage (pull-in voltage)". Conversely, an already-latched relay releases at the still lower "release voltage (drop-out voltage)". In applications where the supply voltage drifts, or where the coil warms up and its resistance rises, a design that sits right at the rated value will produce an intermittent, hard-to-reproduce "sometimes does not operate" fault. Always keep margin so the pull-in voltage is exceeded even at the minimum supply voltage.
Next, underestimating the effect of the air gap. The magnetic pull F scales with B², which means it is effectively inversely proportional to the square of the gap g. Even a slightly larger gap drops the pull sharply. The "magnetic pull vs air gap" chart in this tool shows that steep fall clearly. On a real device the gap drifts from the design value due to assembly tolerances, wear of the moving parts, trapped debris and mounting orientation. The safe approach is to confirm pull-in not only at the design value but also at the worst-case tolerance (the gap at its largest).
Finally, remember that this tool's calculation is an idealized model that neglects the iron reluctance and assumes the air gap dominates the magnetic reluctance. A real iron core magnetically saturates as the flux density grows, so beyond a point raising the current no longer raises the flux — and thus the pull. Also, because of the coil's inductance, the current takes time to build up after the voltage is applied, and this sets the relay's "operate time". This tool is for intuitively understanding the static force balance and the pull-in threshold; magnetic saturation, transient response and contact bounce must be considered separately.
How to Use
Set coil turns (typically 500–5000 for industrial relays) and coil resistance (0.5–50 Ω) to define the electromagnet winding.
Input applied voltage (5–24 V DC for logic-level relays, 110–240 V for industrial units) and initial air gap (0.5–3 mm) between armature and pole face.
Run the simulator to calculate coil current, magnetomotive force (MMF), gap flux density, and magnetic pull force, then compare against pull-in threshold to determine if the relay will energize.
Worked Example
A 12 V industrial relay has 1200 coil turns, 8 Ω resistance, and 1.5 mm air gap. Applied voltage = 12 V gives coil current I = 12 ÷ 8 = 1.5 A. MMF = 1200 × 1.5 = 1800 A·turns. Using reluctance model with gap cross-section 25 mm², gap flux density B ≈ 0.45 T. Magnetic pull F = B²·A / (2μ₀) ≈ 2.1 N. If mechanical spring force is 1.8 N, the relay energizes. Pull-in voltage required ≈ 10.2 V.
Practical Notes
Higher turns and lower resistance increase MMF efficiency; 12 V relays with 2000+ turns pull in reliably even at 10 V supply sag.
Air gap critically affects pull-in voltage—doubling gap from 1 mm to 2 mm quadruples reluctance, requiring ~1.4× higher amperage and 40% higher voltage.
Copper losses heat the coil; for 24/7 duty cycles use coil resistance ≤15 Ω to keep dissipation under 5 W; verify thermal rating in data sheet.
Ferromagnetic core saturation (B_sat ≈ 1.6–2.0 T for steel laminations) limits flux density gain beyond 3000 A·turns—check measured gap flux, not just MMF.