Relay (relay)
Uses a small coil current to switch another circuit.
Group: Switches · Kind: {"kind":"relay"}
When to use it
Use it when a control signal must switch a bigger load. Use Ideal Switch when no coil is needed.
Pins
| Pin | Domain | Meaning |
|---|---|---|
a1 |
electrical | Coil, one end |
a2 |
electrical | Coil, other end; either direction works |
com |
electrical | Common contact |
no |
electrical | Open until the coil is on |
nc |
electrical | Closed until the coil is on |
Common parameters
vrated: Coil voltage the relay is made for (Default: 12)rcoil: Coil resistance (Default: 400)tOperate: Delay before the contacts move (Default: 5m)tRelease: Delay before the contacts move back (Default: 3m)ron: Resistance of a closed contact (Default: 50m)
Parameters
| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
vrated |
V | 12 | 1 – 400 V | Coil voltage the relay is made for |
rcoil |
Ω | 400 | 1 – 100k Ω | Coil resistance |
lcoil |
H | 200m | 100u – 10 H | Inductance of the coil |
vpull |
V | optional (off) | 500m – 300 V | Coil voltage that pulls the relay in |
vdrop |
V | optional (off) | 50m – 100 V | Coil voltage where the relay lets go |
tOperate |
s | 5m | 100u – 100m s | Delay before the contacts move |
tRelease |
s | 3m | 100u – 100m s | Delay before the contacts move back |
ron |
Ω | 50m | 100u – 1 Ω | Resistance of a closed contact |
roff |
Ω | 1meg | 1k – 1000t Ω | Resistance of an open contact |
bounce |
s | 0 | 100u – 10m s | How long a closing contact chatters |
Parameter descriptions are in English in both languages.
Use for: Switching bigger loads · Galvanic isolation · Precharge bypass
Not for: Signal-driven switching without a coil → idealSwitch · Overcurrent protection → breaker
Formulas
| Formula | Equation | Source |
|---|---|---|
| Coil current | I = Vcoil/rcoil | IEC 61810-1:2015 (rated coil voltage and coil resistance) |
| Coil power | P = Vcoil²/rcoil | IEC 61810-1:2015 (coil power) |
| Time to contact closure | t = (lcoil/rcoil)·ln(Vcoil/(Vcoil − vpull)) + tOperate | Sedra & Smith, Microelectronic Circuits, 7th ed. (2015), Appendix E (single-time-constant circuits) |
Quick check
Inputs:
vcoil: Coil drive voltage = 12 Vrcoil: Coil resistance = 400 Ω,rcoillcoil: Coil inductance = 200m H,lcoilvpull: Pull-in voltage = 9 V,vpulltOperate: Operate delay = 5m s,tOperate
Outputs:
icoil: Coil current =vcoil/rcoilApcoil: Coil power =vcoil^2/rcoilWtclose: Time to contact closure =lcoil/rcoil*ln(vcoil/(vcoil - vpull)) + tOperates
Model logic
- The coil is rcoil in series with lcoil, so its current rises with the time constant lcoil/rcoil; the logic reads abs(coil current).
- An SR latch sets above vpull/rcoil and resets below vdrop/rcoil (reset wins); vpull and vdrop default to 75 % and 10 % of vrated.
- The contacts move tOperate after the pull-in crossing and tRelease after the drop-out crossing; no and nc are ideal switches of ron and roff, always opposite.
- With bounce above 0 a closing contact opens once, from a third to two thirds of bounce after closing; contact arcing and wear are not modelled.
Model
The coil is rcoil in series with lcoil, so its current rises with the time constant lcoil / rcoil. The relay operates when the coil current magnitude rises above vpull / rcoil and releases when it falls below vdrop / rcoil, and between the two it keeps its state. The contacts move tOperate after the pull-in crossing and tRelease after the drop-out crossing. The no and nc contacts are switches with resistance ron when closed and roff when open, always in opposite states. vpull and vdrop default to 75 % and 10 % of vrated. With bounce above zero, a closing contact opens again for the middle third of that time. The coil current is the signal name:i and the contact state is name:no.
Common mistakes
- A coil driven below vpull never operates, and a coil that is not driven back below vdrop never releases. Check that your drive covers 75 % and 10 % of vrated, or set vpull and vdrop from the datasheet.
- Cutting the coil drive while the coil carries current puts a high voltage across the coil, as in a real relay. Add a freewheeling Diode across a1 and a2, and note that it slows the release.
- The times are in seconds, so tOperate of 5 means five seconds, not 5m. A vdrop at or above vpull, a vpull above 1.5 times vrated or a negative time is refused before the run.
Problems rules: param.out_of_range
Datasheet and sources
Take vrated and rcoil from the coil table, vpull from the must-operate voltage, vdrop from the must-release voltage, and tOperate and tRelease from the operate and release times. Take ron from the initial contact resistance and roff from the insulation resistance, and estimate lcoil or keep the default, since it is rarely listed.
Example
Open the example with the command file.openExample and the name demo:relay.
Generated by cargo xtask reference from the usage texts and parameter specs. Do not edit by hand.