Electrical

Electromechanical Relay

A small current switching a big one with a magnet

An electromechanical relay is an electrically operated switch in which a small current through a coil becomes an electromagnet that pulls a hinged armature, snapping a separate set of contacts open or closed to control a much larger load. The two circuits never touch — energy crosses the air gap as a magnetic field — so a 30 mA, 5 V signal from a microcontroller can switch a 16 A, 250 V mains circuit with full galvanic isolation. A return spring opens the contacts the instant coil current is removed. The same component sits inside your car's starter circuit, your furnace control board, industrial PLCs and the click you hear when an HVAC compressor kicks on.

  • Coil forceF = (B²·A) / (2μ₀)
  • Pull-in voltage≈ 75% of rated
  • Drop-out voltage≈ 10–20% of rated
  • Operate / release time5–15 ms / 2–10 ms
  • Contact ratingup to 16 A @ 250 VAC
  • Coil-to-contact isolation4–5 kV typical

Interactive visualization

Press play, or step through manually. The visualization is yours to drive — try it before reading on.

Open visualization fullscreen ↗

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

How a relay works

Strip a relay to its essentials and you find five parts: a coil of fine wire wound on an iron core, a hinged iron armature, a return spring, a set of contacts, and a frame (the yoke) that completes the magnetic circuit. Push current through the coil and it becomes an electromagnet. The field threads through the core, jumps the small air gap to the armature, and pulls the armature toward the pole face. The armature is mechanically coupled to a movable contact, so as it swings in it presses that contact against a fixed one, completing the load circuit.

The crucial point — the whole reason relays exist — is that the coil circuit and the contact circuit are electrically separate. Energy crosses from one to the other only as a magnetic field across an air gap. This is galvanic isolation. A 5 V logic signal drawing 30 mA can therefore switch a 230 V, 10 A mains heater, and a fault on the heater side cannot push dangerous voltage back into your microcontroller.

The force that pulls the armature

The attractive force across the air gap between core and armature is set by the magnetic flux density B in that gap and the pole-face area A:

F = (B² · A) / (2 · μ₀)

where:
  F   = pull force across the air gap (N)
  B   = flux density in the gap (T)
  A   = pole-face area (m²)
  μ₀  = 4π × 10⁻⁷  (T·m/A)

and the flux is driven by the magnetomotive force:

  MMF = N · I        (ampere-turns)
  B   ≈ μ₀ · N · I / g    (g = air-gap length, m)

Two facts fall straight out of these equations and explain almost everything a relay does. First, force scales with the square of flux, so it is highly nonlinear in coil current. Second, B is inversely proportional to the air-gap length g. When the armature is fully open, g is large, B is small, and the force is weak; the relay needs a healthy current to start moving. But the instant the armature begins to close, g shrinks, B climbs, and the force grows explosively — so the armature does not creep shut, it snaps shut. That snap is what gives a clean, bounce-limited contact closure and the audible click.

Pull-in, drop-out and hysteresis

Because force depends on the gap, the voltage to close a relay is much higher than the voltage at which it will release. This is the relay's built-in hysteresis, and it is a feature, not a defect — it stops the armature chattering near the threshold.

ParameterTypical valueWhat it means
Pull-in (operate) voltage~75% of rated coil VMinimum voltage that seats the armature against the spring
Drop-out (release) voltage~10–20% of rated coil VVoltage you must fall below for the spring to reopen contacts
Must-operate guarantee≤ rated coil VManufacturer guarantees pull-in at or below nameplate voltage
Coil resistance (12 V relay)~320–400 ΩSets coil current ≈ 30–40 mA at 12 V
Coil power~200–500 mWHolding power once seated

A subtle consequence: because seated force is large, you can often hold a relay closed at far below its pull-in voltage. Latching schemes and "economizer" coils exploit this by pulling in at full voltage, then dropping to a lower hold voltage to save power and heat.

Contact arrangements and ratings

Relay contacts are described by their pole and throw count, using the same notation as manual switches. A pole is an independent switch the relay operates; a throw is a position each pole can connect to.

  • SPST-NO (Form A): single contact, normally open — closes when energized. The simplest power switch.
  • SPST-NC (Form B): single contact, normally closed — opens when energized. Used for fail-safe cutoffs.
  • SPDT (Form C): a common terminal that transfers between a normally-closed and a normally-open contact. The most versatile small relay.
  • DPDT / 4PDT: two or four Form-C sets ganged on one armature — switch several circuits at once, in step.

The contact rating is not a single number. A relay marked "10 A 250 VAC / 10 A 30 VDC" can switch far less DC at higher voltage, because DC arcs do not self-extinguish at a current zero-crossing the way AC arcs do. Contact resistance is typically 50–100 mΩ when new and rises as the contacts erode, so relays are poor for switching microvolt-level signals unless they use gold-flashed contacts intended for "dry" low-current duty.

Driving the coil: the flyback diode

The coil is an inductor. When you switch it off, the stored magnetic energy (½LI²) has to go somewhere, and the collapsing field generates a reverse voltage spike governed by:

V_spike = -L · di/dt

A 12 V relay coil with L ≈ 100 mH switched off in 1 µs:
  V_spike ≈ 0.1 × (0.04 A / 1 µs)
          ≈ 4000 V   (clamped in practice, but lethal to a bare transistor)

That spike will punch through the base–collector junction of a switching transistor. The fix is a flyback (freewheeling) diode wired across the coil, reverse-biased in normal use. When the transistor turns off, the diode conducts and lets the coil current recirculate and decay harmlessly. The cost is slower release: the recirculating current keeps the armature held for an extra millisecond or two. If you need fast release, add a Zener in series with the diode so the spike is clamped to a higher (but bounded) voltage, dumping the energy faster.

Relay vs. MOSFET vs. solid-state relay

Electromechanical relayPower MOSFETSolid-state relay (SSR)
Galvanic isolationYes, inherent (4–5 kV)NoneYes, via opto-coupler
On-state loss~50 mΩ contact, near-zeroI²R in R_DS(on)~1–1.5 V drop (triac/SCR)
Off-state leakageEssentially zero (true open)µAmA-scale
Switching speed5–15 ms operatens–µsµs to half-cycle (zero-cross)
Cycle life10⁵–10⁷ (mechanical wear)~unlimited~unlimited (no moving parts)
AC and DCBoth, one partDC (or with bridge)AC types common; DC types exist
Audible / silentAudible clickSilentSilent
Failure modeStuck open or welded shutUsually shortedUsually shorted

The headline trade-off: a relay gives you a true mechanical open circuit, isolation, and zero conduction loss, at the price of slow switching, audible noise, and a finite number of operations. Semiconductors switch fast and forever but always leak a little and always dissipate heat while conducting.

Worked example: sizing a coil driver

You want an Arduino (5 V GPIO, ~20 mA limit) to switch a 12 V relay whose coil is 400 Ω. Can the pin drive it directly, and what does the transistor need to handle?

Coil current at 12 V:
  I_coil = V / R = 12 / 400 = 30 mA

A 5 V pin limited to 20 mA cannot supply 30 mA, and the coil
needs 12 V anyway — so a logic-level NPN/MOSFET is required.

Base resistor for a BJT (β ≈ 100, want I_C = 30 mA):
  I_B(min) = I_C / β = 30 mA / 100 = 0.3 mA
  Drive hard (×5 overdrive) → I_B = 1.5 mA
  R_B = (5 V − 0.7 V) / 1.5 mA ≈ 2.9 kΩ → use 2.2 kΩ

Transistor must survive the flyback before the diode clamps:
  Pick V_CEO ≥ 40 V (e.g. 2N2222 at 40 V, or a logic MOSFET)
  Add 1N4148 / 1N4007 flyback diode across the coil.

So: one small transistor, one base resistor, one flyback diode, and the relay's own contacts then handle the 12 V — or 230 V — load. The microcontroller never sees more than 5 V.

Failure modes and trade-offs

  • Contact welding. Closing into a high inrush (capacitor banks, incandescent or LED lamps, motors) can momentarily melt the contact spots; if they re-solidify while touching, the relay welds shut and will not release. Mitigate with correctly rated contacts, AgSnO₂ alloys, pre-charge resistors, or inrush-limiting NTCs.
  • Arc erosion. Every break draws an arc that vaporizes and transfers metal. DC and inductive loads sustain the arc longest, so relays are derated heavily for DC — a "10 A 250 VAC" relay may be rated only 0.4 A at 110 VDC.
  • Contact bounce. The armature snaps in and the contacts physically rebound a few times over the first 0.5–2 ms, generating a burst of make/break edges. Harmless for a heater, but a logic circuit reading the contact must debounce it.
  • Coil overheating. Holding power becomes heat; coil resistance rises with temperature, lowering current and force, so a hot relay may drop out. Economizer drives or latching relays avoid continuous holding power.
  • Slow switching. 5–15 ms operate time rules relays out of PWM and fast switching duty — that is MOSFET/SSR territory.
  • Mechanical wear-out. Springs fatigue and bearings wear; mechanical life (no load) might be 10⁷ cycles while electrical life under full load can be 10⁵ or less. The electrical life is the one that matters in service.
  • Orientation and shock. Vibration can momentarily open seated contacts or bounce open contacts closed; aerospace and automotive relays are qualified for shock and specified mounting orientations.

Frequently asked questions

How does an electromechanical relay work?

A current through the relay's coil turns it into an electromagnet. The magnetic field pulls a hinged iron armature toward the coil's pole face. The armature is mechanically linked to a movable contact, so when it swings in it presses that contact against (or away from) a fixed contact, switching the load circuit. A return spring holds the armature open when the coil is de-energized, so removing coil current snaps the contacts back to rest. The coil typically needs only tens of milliamps while the contacts can carry tens of amps.

What is the difference between pull-in and drop-out voltage?

Pull-in (or operate) voltage is the minimum coil voltage that produces enough magnetic force to overcome the return spring and seat the armature — typically around 75% of the rated coil voltage. Drop-out (or release) voltage is the voltage you must fall below for the spring to pull the armature back open, usually around 10% to 20% of rated. The gap between them is hysteresis: once the armature is seated, the air gap is tiny, so the same flux produces far more force and the relay stays latched well below its pull-in voltage.

Why do relays need a flyback diode across the coil?

The coil is an inductor storing energy in its magnetic field. When the driving transistor switches off, the current cannot stop instantly, so the collapsing field generates a large reverse voltage spike (V = -L di/dt) that can reach hundreds of volts and destroy the transistor. A flyback (freewheeling) diode placed across the coil, reverse-biased in normal operation, gives that current a path to circulate and decay safely. The trade-off is slower release: the diode keeps current flowing, so the relay drops out more slowly. A diode in series with a Zener or resistor speeds release at the cost of a higher but bounded spike.

What is galvanic isolation and why does a relay provide it?

Galvanic isolation means there is no conductive path between two circuits — they communicate only through a field, not through shared electrons. In a relay the coil and the contacts are physically separate: energy crosses as a magnetic field across an air gap. This lets a 3.3 V microcontroller switch 240 V mains while the two sides stay electrically independent, often rated for several kilovolts of isolation. It protects low-voltage logic from high-voltage faults and breaks ground loops.

When should I use a relay instead of a MOSFET or solid-state relay?

Use an electromechanical relay when you need a true open circuit (near-zero leakage and milliohm-level on-resistance), inherent galvanic isolation, the ability to switch AC or DC with one part, and tolerance to surge currents and reverse polarity. Choose a MOSFET or solid-state relay when you need silent operation, millions to billions of switching cycles, microsecond switching, or fast PWM — things a mechanical relay's contacts and 5-to-15 ms operate time cannot do. Relays wear out mechanically and bounce; semiconductors leak and dissipate heat while conducting.

What causes relay contacts to wear out or weld shut?

Every make and break draws a tiny arc that erodes and transfers contact metal. Inductive loads (motors, solenoids) sustain the arc longer and accelerate erosion, which is why relays are derated for inductive use. Inrush current from capacitive or lamp loads can momentarily melt the contact spots; if the contacts close into that surge and the molten metal solidifies before they fully seat, they can weld shut. Mitigations include snubbers (RC across the contacts), correctly rated contacts, gold-flashed contacts for dry low-current signals, and choosing AgSnO2 contact alloys for high-make-current duty.