Relay Simulator: Coil, Contacts, Hysteresis

A relay is an electrically operated switch in which a small coil current magnetises an electromagnet that moves an armature and opens or closes isolated contacts. It pulls in at a higher coil voltage than it drops out, which gives hysteresis. A flyback diode across the coil protects the driver from the voltage spike v=L di/dtv = L\,\mathrm{d}i/\mathrm{d}t when it switches off.

  • Power off
  • Coil and core
  • Hinged armature
  • Contacts
  • Magnetic flux
  • Drag to rotate

Parameters

Coil data, switching thresholds and contact rating

Editable

Educational model with ideal switching thresholds · Not a substitute for a manufacturer datasheet

Live values

Off

0.0 s

ContactPower off
Coil current0mA
Coil power0W
Contact current0A
Pull-in / drop-out9 / 1.2V

Charts

Follow the contact through the hysteresis loop and see what the coil draws at each voltage.

Switching hysteresis

The contact closes at pull-in when the voltage rises, but opens only at the much lower drop-out when it falls.

Coil current and power

The coil is a resistor: current grows linearly with voltage and power with its square.

Watch a small coil current pull an armature onto the core, close a contact that switches a much larger load, and release only after the voltage falls well below the pull-in level.

What is an electromechanical relay?

A switch moved by a magnet

A relay is an electrically operated switch in which a small coil current magnetises an electromagnet that moves an armature and opens or closes isolated contacts. It pulls in at a higher coil voltage than it drops out, which gives hysteresis. A flyback diode across the coil protects the driver from the voltage spike v=L di/dtv = L\,\mathrm{d}i/\mathrm{d}t when it switches off.

Pull-in, drop-out and hysteresis

The armature moves only when the coil current produces enough magnetic force to overcome the return spring. The voltage at which this happens is the pull-in voltage, usually 70 to 80 percent of the rated coil voltage. Once the armature has closed, the air gap is small and less force is needed to hold it, so the relay releases only when the voltage falls to the lower drop-out voltage, often 10 to 30 percent of rated. That gap between the two thresholds is the hysteresis loop, and it prevents chattering.

More about this simulator

Where it is used

Relays switch loads that a transistor or microcontroller pin cannot drive directly: heaters, lamps, motors, solenoid valves, automotive circuits and mains appliances. They also appear in industrial control panels and protection equipment, where galvanic isolation and the ability to switch both polarities matter. Driving a relay from a transistor requires a flyback diode across the coil to absorb the voltage spike when the coil is switched off. For fast or very frequent switching, a solid-state relay is the usual alternative. Run a hands-on relay simulation: this free relay simulator works online in your browser, with live readouts beside the 3D model. Compare it with the inductor simulator and the NPN transistor simulator. The glossary defines pull-in voltage.

Frequently asked questions

What is the difference between pull-in and drop-out voltage?
Pull-in voltage is the coil voltage at which the armature moves and closes the contact. Drop-out voltage is the lower value at which it releases again. Because less force is needed once the air gap has closed, the two differ, and that hysteresis keeps the relay from chattering near the threshold.

What you will learn

  • Calculate the coil current and coil power from coil voltage and coil resistance, for example 30 mA and 360 mW for a 12 V relay with a 400 Ω coil.
  • Determine the pull-in and drop-out voltages from the rated coil voltage and the pull-in and drop-out percentages.
  • Explain why the contact position inside the holding band depends on whether the coil voltage was rising or falling.
  • Compare the small coil current with the load current switched by the contact and identify when the contact rating is exceeded.
  • Predict what happens to the hysteresis band when the drop-out percentage is set equal to or above the pull-in percentage.
Model assumptions & references

Model assumptions and limitations

  • The coil is treated as a pure DC resistance: coil current is |V|/R and power is V²/R. Resistance is constant (minimum 1 Ω) with no temperature rise, and coil polarity is ignored.
  • Pull-in and drop-out voltages are inputs set as percentages of the rated coil voltage (minimum 0.1 V, pull-in at least 1 %); spring force, air gap and magnetic force are not calculated.
  • Drop-out is limited to the pull-in voltage; if it is set at or above pull-in, there is no hysteresis band.
  • Hysteresis memory: the contact closes at or above pull-in, opens at or below drop-out and keeps its previous state in between. A cold start begins with the relay released.
  • The magnetic field is proportional to the coil current and is not limited by core saturation, so it keeps growing above the rated voltage.
  • The contact switches instantly at the thresholds: there is no operate or release time, no contact bounce, no coil inductance dynamics and no flyback voltage.
  • Only the normally open contact current is calculated (the load current while closed, otherwise zero); exceeding the contact rating is only flagged, with no arcing, welding, wear or inductive-load derating modelled.

References

  • The Art of Electronics — Paul Horowitz, Winfield Hill. Covers practical relay use, driving relay coils from transistors and protecting the driver with a flyback diode.
  • Electric Machinery — A. E. Fitzgerald, Charles Kingsley Jr., Stephen D. Umans. Explains electromechanical energy conversion and the magnetic force that pulls an armature across an air gap.
  • Electric Contacts: Theory and Application — Ragnar Holm. Covers the physics of switching contacts, including contact ratings, arcing, welding and wear.