Devices: relays, switches, motors and audio
Relays, switches and buttons, motors and actuators, buzzers and speakers. The parameter tables use the same columns as Devices: passives. Every part has labelled fields with units in the inspector and in All parameters, and the live stimulus of a sensor (light, temperature, field, strain, distance, load) is its main field, first in the list, with a slider range that fits it. A field that shows auto takes a value derived from other parameters until you type one (for example the must-operate voltage of a relay is 0.75 of its coil voltage). Clear it to go back. A variant placed from the library starts with its own typical values, such as 1 kΩ for a Pt1000 or 1.2 V dropout for an AMS1117. A part placed from the library can start with its own values, and a part made with the Part Wizard takes them from its datasheet fields (Part templates reference).
34.1Relays
| Type | Pins | Variants | Class |
|---|---|---|---|
relay (K) | spdt: coil+, coil-, com, no, nc. spst_no and reed: coil+, coil-, com, no. spst_nc: coil+, coil-, com, nc. dpst_no: 6 pins. dpdt: coil+, coil-, com1, no1, nc1, com2, no2, nc2. 4pdt: 14 pins. | spdt, spst_no, spst_nc, dpst_no, dpdt, 4pdt, reed | approximate, coil exact (verified ±0.01 %) |
A real relay: the coil is a resistance in series with an inductance that grows as the armature closes, and the armature picks up when the coil current reaches vpick / rcoil and drops out below vdrop / rcoil, so pick-up and drop-out are found to the exact instant. t_op and t_rel are the datasheet operate and release times: a step to the rated coil voltage closes the NO contact t_op later, the rise of the coil current to pick-up included, and removing the coil power closes the NC contact t_rel later. A lower coil voltage, a hot coil or a flyback diode makes the relay slower, as on the bench. Normally closed contacts open when the armature is 40 % of the way, so a changeover contact breaks before it makes. A pulse shorter than the travel time never closes the NO contact. Placed from the library (K): 5 V coil, 70 Ω, 50 mΩ contacts, 5 ms operate, 3 ms release.
| Parameter | Key | Unit | Default | Range | Value comes from | What it does |
|---|---|---|---|---|---|---|
| Nominal coil voltage | vcoil | V | 5 | > 0 | Default, inspector, part file | Sets the default pick-up and drop-out. A coil voltage above 1.5 x vcoil warns. |
| Coil resistance | rcoil | Ω | 70 (reed 500) | > 0 | Default, inspector, part file | Datasheet coil resistance, or V² / P. |
| Must-operate voltage | vpick | V | 0.75 x vcoil | > 0 | Default, inspector, part file | |
| Must-release voltage | vdrop | V | 0.1 x vcoil | ≥ 0, below vpick | Default, inspector, part file | |
| Operate time | t_op | s | 5 ms (reed 0.5 ms) | ≥ 0 | Default, inspector, part file | Datasheet operate time: from the rated coil voltage applied to the NO contact closed. |
| Release time | t_rel | s | 3 ms (reed 0.1 ms) | ≥ 0 | Default, inspector, part file | Datasheet release time without a diode: from the coil power removed to the NC contact closed. |
| Contact resistance | ron | Ω | 0.05 (reed 0.15) | > 0, below roff | Default, inspector, part file | |
| Open resistance | roff | Ω | 1 GΩ | > 0 | File or All parameters | |
| Coil inductance, open | lcoil | H | 50 mH (reed 5 mH) | ≥ 0 | File or All parameters | |
| Coil inductance, closed | lcoil_closed | H | 1.5 x lcoil | ≥ 0 | File or All parameters | |
| Contact bounce | bounce | s | 0 | ≥ 0 | Default, inspector, part file | Each closing bounces open three times inside this window. |
| Rated contact current | imax | A | 10 (reed 0.5) | > 0 | Default, inspector, part file | Warns when a contact carries more. |
| Max switching voltage | vmax | V | 250 | > 0 | Default, inspector, part file | Warns when an open contact sees more. |
| Coil diode | diode | 0 / 1 | 0 | Default, inspector, part file | A suppression diode across the coil. It also makes the coil polarised. | |
| Polarised coil | polar | 0 / 1 | 0 | File or All parameters | Only positive coil current operates it. | |
| Initial state | state | 0 / 1 | 0 | File or All parameters | 1 starts operated. |
Key: the name in the circuit file, in a parameter step (R1.r) and for AI agents. Range: a value outside it is refused with E_PARAM. Value comes from: where you can set it. The All parameters tab and agents can set every parameter.
Readouts: state, armature position and coil current. The logic analyzer shows coil and state.
- Place a 5 V source, a switch, the relay coil and ground in series. Probe the coil+ pin.
- Run, click the switch closed, then open.
You should seeOpening the switch makes a large negative spike on the coil, the stored energy of its inductance. Set the relay's diode to 1 and the spike is clamped to about -0.7 V, and the release gets slower.
34.2Latching relays
| Type | Pins | Variants | Class |
|---|---|---|---|
relay_latch (K) | single_coil: coil+, coil-, com, no, nc. single_coil_2p: 8 pins. dual_coil: set+, set-, reset+, reset-, com, no, nc. dual_coil_2p: 10 pins. | single_coil, single_coil_2p, dual_coil, dual_coil_2p | approximate |
A single-coil latch sets on a positive coil pulse and resets on a negative one. A dual-coil latch has separate set and reset coils. With no coil current it holds its state, and part way through a move the magnet pulls it to the nearer end. Clicking the part toggles it like the test lever. Placed (Shift+K): 5 V, 125 Ω, 3 ms, 10 ms minimum pulse.
| Parameter | Key | Unit | Default | Range | Value comes from | What it does |
|---|---|---|---|---|---|---|
| Nominal coil voltage | vcoil | V | 5 | > 0 | Default, inspector, part file | |
| Coil resistance | rcoil | Ω | 125 | > 0 | Default, inspector, part file | |
| Set / reset voltage | vpick | V | 0.75 x vcoil | > 0 | Default, inspector, part file | |
| Set time | t_op | s | 3 ms | ≥ 0 | Default, inspector, part file | Also the reset time. |
| Minimum pulse width | pulse_min | s | 10 ms | ≥ 0 | Default, inspector, part file | A switch on a shorter pulse warns W_LATCH_MARGIN. |
| Contact resistance | ron | Ω | 0.05 | > 0 | Default, inspector, part file | |
| Rated contact current | imax | A | 2 | > 0 | Default, inspector, part file | |
| State | state | 0 / 1 | 0 | Click it on the canvas | Set or reset. |
Key: the name in the circuit file, in a parameter step (R1.r) and for AI agents. Range: a value outside it is refused with E_PARAM. Value comes from: where you can set it. The All parameters tab and agents can set every parameter.
Energising both coils of a dual-coil latch at once doesn’t move it and warns W_LATCH_BOTH.
34.3Solid-state relays
| Type | Pins | Variants | Class |
|---|---|---|---|
ssr (K) | in+, in-, out1, out2 | dc (MOSFET output), ac (triac, zero cross), photomos (AC and DC) | approximate, LED exact |
An LED input that turns the output on above if_on and off below if_off, after t_on or t_off. The dc output is a MOSFET with a body diode from out2 to out1. The photomos output conducts both ways. The ac output is a triac: it fires only when the output voltage is below vzc and stays on until its current falls below ih, so a DC load never turns it off.
| Parameter | Key | Unit | Default | Range | Value comes from | What it does |
|---|---|---|---|---|---|---|
| Input operate current | if_on | A | 5 mA | > 0 | Default, inspector, part file | |
| Input release current | if_off | A | 0.4 x if_on | > 0, below if_on | File or All parameters | |
| LED forward voltage | vf | V | 1.2 | > 0 | Default, inspector, part file | At 10 mA. |
| Turn-on time | t_on | s | 100 µs | ≥ 0 | Default, inspector, part file | |
| Turn-off time | t_off | s | 100 µs | ≥ 0 | Default, inspector, part file | |
| On resistance | ron | Ω | 0.1 | > 0 | Default, inspector, part file | |
| Off resistance | roff | Ω | 10 MΩ (ac 1 MΩ) | > 0 | File or All parameters | |
| On-state voltage | vtm | V | 1.0 | ≥ 0 | Default, inspector, part file | ac only. |
| Holding current | ih | A | 50 mA | > 0 | Default, inspector, part file | ac only. |
| Zero-cross window | vzc | V | 15 | ≥ 0 | Default, inspector, part file | ac only. |
| Rated load current | imax | A | 2 | > 0 | Default, inspector, part file | Warns when exceeded. |
Key: the name in the circuit file, in a parameter step (R1.r) and for AI agents. Range: a value outside it is refused with E_PARAM. Value comes from: where you can set it. The All parameters tab and agents can set every parameter.
34.4Switches and buttons
| Type | Pins | Variants | Class |
|---|---|---|---|
sw (SW) | spst, push_no, push_nc, reed: com, a. spdt, toggle, slide: com, a, b. dpst: com1, a1, com2, a2. dpdt: com1, a1, b1, com2, a2, b2. tact4: a1, a2, b1, b2. micro: com, nc, no. dip1 … dip10: two pins per switch. rotary: com, p1 … p8. | spst, spdt, toggle, slide, dpst, dpdt, push_no, push_nc, tact4, micro, reed, dip1 … dip10, rotary | approximate |
Real switch contacts with resistance, bounce and break-before-make. Click a switch while the circuit runs: a toggle changes position, a push button is pressed while you hold the mouse button, a rotary switch steps to its next position. A tactile switch joins a1 to a2 and b1 to b2 permanently, and a1 to b1 while pressed. A reed switch closes when state is 1 or the applied field reaches b_close, and opens below 60 % of it. A DIP switch's state is a bit mask: bit k closes switch k + 1. Click a DIP switch on the canvas and the one under the pointer flips (the row from its com pin to its a pin that is nearest), so one click on switch 3 and then one on switch 1 gives a mask of 5. The Activity tab records it, for example SW1: switch 3 on. The core switch (key S, Devices: passives) is a simpler two-pin version.
| Parameter | Key | Unit | Default | Range | Value comes from | What it does |
|---|---|---|---|---|---|---|
| Position | state | 0 | 0 to 1023, a whole number below the number of positions | Click it on the canvas, part file | Lever position, pressed state, DIP bit mask or rotary position. | |
| Contact resistance | ron | Ω | 0.02 | > 0, below roff | Default, inspector, part file | Can change while running. |
| Open resistance | roff | Ω | 1 GΩ | > 0 | File or All parameters | |
| Bounce time | bounce | s | 0 | ≥ 0 | Default, inspector, part file | Three bounces on every closing. 2 ms is realistic for a tactile switch. |
| Break-before-make gap | t_break | s | 1 ms for changeover types, 0 otherwise | ≥ 0 | File or All parameters | |
| Rotary positions | positions | 8 | 2 to 8 | Default, inspector, part file | ||
| Reed closing field | b_close | T | 1 mT | > 0 | File or All parameters | |
| Applied field | b_field | T | 0 | ≥ 0 | Live slider | Reed only. |
| Rated current | imax | A | 50 mA for buttons and DIP, 3 A otherwise | > 0 | Default, inspector, part file | Warns when exceeded. |
Key: the name in the circuit file, in a parameter step (R1.r) and for AI agents. Range: a value outside it is refused with E_PARAM. Value comes from: where you can set it. The All parameters tab and agents can set every parameter.
- Place a 5 V source, a 10 kΩ pull-up, a push button (sw, push_no) to ground, and probe the node.
- Set the button's bounce to
2mand the timebase to 10 ms per second. - Click and hold the button.
You should seeThe node falls to 0 V with three short bounces back up inside the first 2 ms. A logic input on that node would count several presses.
34.5DC motors
| Type | Pins | Variants | Class |
|---|---|---|---|
dcmotor (M) | +, - | brushed, fan, vibration, gear | approximate, verified ±0 % at no load |
An armature resistance and inductance with a back-EMF ke · ω, and a rotor with inertia, viscous friction and a load torque: J dω/dt = kt · i - b ω - T_load, with kt = ke. All of it comes from datasheet numbers: R = v_rated / i_stall, ke from the no-load speed and current, J from the mechanical time constant. A fan adds an aerodynamic load that rises with speed squared. Reversing the voltage reverses it, and driving it from outside makes it a generator. Readouts: rpm (of the output shaft), torque, mechanical power and efficiency.
The gear variant places a yellow TT gear motor: 6 V, a motor of 10 000 rpm at no load, a 1:48 gear (so about 208 rpm at the output), 1.5 A stall and 0.15 A no load. The two shafts differ: No-load speed belongs to the motor shaft, while the rpm readout and the Load torque belong to the output shaft after the gear.
| Parameter | Key | Unit | Default | Range | Value comes from | What it does |
|---|---|---|---|---|---|---|
| Rated voltage | v_rated | V | 12 | > 0 | Default, inspector, part file | |
| No-load speed | rpm_noload | rpm | 3000 | > 0 | Default, inspector, part file | At v_rated, of the motor shaft, before any gear. The rpm live value is the output shaft: this number divided by the gear ratio. |
| Stall current | i_stall | A | 1 | > 0 | Default, inspector, part file | Sets R = v_rated / i_stall. |
| No-load current | i_noload | A | 0.05 | ≥ 0, below i_stall | Default, inspector, part file | |
| Armature inductance | l | H | 1 mH | ≥ 0 | Default, inspector, part file | |
| Mechanical time constant | tau_mech | s | 50 ms | > 0 | Default, inspector, part file | Start-up to 63 %. |
| Load torque | t_load | N·m | 0 | ≥ 0 | Live slider | |
| Gear ratio | gear | 1 | > 0 | Default, inspector, part file | Gear variant: output speed = motor speed / gear. The load torque acts on the output shaft. | |
| Commutation ripple | ripple, segments | 0, 3 | 0 to 0.3, 1 to 64 | Default, inspector, part file | Adds current ripple at segments x 2 per revolution. | |
| Max current | i_max | A | 2 x i_stall | > 0 | Default, inspector, part file | Warns when exceeded, and when stalled above 80 % of i_stall for 2 s. |
Key: the name in the circuit file, in a parameter step (R1.r) and for AI agents. Range: a value outside it is refused with E_PARAM. Value comes from: where you can set it. The All parameters tab and agents can set every parameter.
- Place a 12 V source and a DC motor. Probe the motor current.
- Run, then drag the motor's load torque slider up.
You should seeThe current starts high, falls to the no-load 50 mA as the motor reaches 3000 rpm, then rises as you add load while the rpm readout falls.
34.6Stepper motors
| Type | Pins | Variants | Class |
|---|---|---|---|
stepper (M) | bipolar: a+, a-, b+, b-. unipolar6: a1, acom, a2, b1, bcom, b2. unipolar5 (28BYJ-48): com, a1, b1, a2, b2. | bipolar, unipolar6, unipolar5 | approximate, windings exact |
Two phases with resistance, inductance and a back-EMF that depends on the rotor angle, a detent torque, inertia and damping. Full, half and micro stepping, resonance, missed steps and the fall of current at speed all come out of the equations. Readouts: shaft angle, rpm and step.
| Parameter | Key | Unit | Default | Range | Value comes from | What it does |
|---|---|---|---|---|---|---|
| Steps per revolution | steps | 200 | > 0 | Default, inspector, part file | ||
| Phase resistance | r_phase | Ω | 2.8 | > 0 | Default, inspector, part file | Per half winding for unipolar. |
| Rated phase current | i_rated | A | 1 | > 0 | Default, inspector, part file | |
| Holding torque | t_hold | N·m | 0.4 | > 0 | Default, inspector, part file | Two phases at i_rated. |
| Phase inductance | l_phase | H | 3 mH | ≥ 0 | Default, inspector, part file | |
| Rotor inertia | j | kg·m² | 5.4 x 10-6 | > 0 | Default, inspector, part file | |
| Detent torque | t_detent | N·m | 0.02 | ≥ 0 | Default, inspector, part file | |
| Viscous damping | b | N·m·s | 10-4 | ≥ 0 | Default, inspector, part file | |
| Load torque | t_load | N·m | 0 | ≥ 0 | Live slider | |
| Gear ratio | gear | 1 | > 0 | Default, inspector, part file |
Key: the name in the circuit file, in a parameter step (R1.r) and for AI agents. Range: a value outside it is refused with E_PARAM. Value comes from: where you can set it. The All parameters tab and agents can set every parameter.
34.7BLDC motors
| Type | Pins | Variants | Class |
|---|---|---|---|
bldc (M) | sensorless: u, v, w. hall: u, v, w, ha, hb, hc, hvcc, hgnd | sensorless, hall | approximate |
Three star-connected phases with a trapezoidal (or sine) back-EMF. The Hall variant has three open-drain sensor outputs that need pull-ups.
| Parameter | Key | Unit | Default | Range | Value comes from | What it does |
|---|---|---|---|---|---|---|
| Velocity constant | kv | rpm/V | 1000 | > 0 | Default, inspector, part file | |
| Phase resistance | r_phase | Ω | 0.1 | > 0 | Default, inspector, part file | |
| Magnet poles | poles | 14 | 2 to 100 | Default, inspector, part file | ||
| Phase inductance | l_phase | H | 20 µH | ≥ 0 | Default, inspector, part file | |
| Rotor inertia | j | kg·m² | 2 x 10-6 | > 0 | Default, inspector, part file | |
| Load torque | t_load | N·m | 0 | ≥ 0 | Live slider | |
| Back-EMF shape | emf | trap | trap, sine | Default, inspector, part file |
Key: the name in the circuit file, in a parameter step (R1.r) and for AI agents. Range: a value outside it is refused with E_PARAM. Value comes from: where you can set it. The All parameters tab and agents can set every parameter.
34.8Solenoids, servos and encoders
| Type | Pins | Variants | Class |
|---|---|---|---|
solenoid (L) | +, - | pull, push, valve, lock (same physics) | approximate, coil exact |
A coil whose inductance grows as the plunger moves in, with the plunger's mass, a return spring and end stops, so the current dips at pull-in as on a real solenoid.
| Parameter | Key | Unit | Default | Range | Value comes from | What it does |
|---|---|---|---|---|---|---|
| Rated voltage | v_rated | V | 12 | > 0 | Default, inspector, part file | |
| Coil resistance | r | Ω | 24 | > 0 | Default, inspector, part file | |
| Travel | stroke | m | 5 mm | > 0 | Default, inspector, part file | |
| Inductance out / in | l_out, l_in | H | 20 mH, 60 mH | > 0, l_out < l_in | Default, inspector, part file | |
| Pull-in time | t_move | s | 10 ms | > 0 | Default, inspector, part file | |
| Pull-in current | i_pull | A | 0.7 x v_rated / r | > 0 | Default, inspector, part file | |
| Drop-out current | i_release | A | 0.3 x v_rated / r | ≥ 0, below i_pull | Default, inspector, part file |
Key: the name in the circuit file, in a parameter step (R1.r) and for AI agents. Range: a value outside it is refused with E_PARAM. Value comes from: where you can set it. The All parameters tab and agents can set every parameter.
| Type | Pins | Variants | Class |
|---|---|---|---|
servo (M) | sig, vcc, gnd | analog, digital, continuous | approximate |
Measures each pulse on sig and moves the horn towards the matching angle at its slew rate, which scales with the supply. Analog and continuous servos stop holding 25 ms after the last pulse, digital servos keep holding. A continuous servo turns at a speed set by the pulse width.
| Parameter | Key | Unit | Default | Range | Value comes from | What it does |
|---|---|---|---|---|---|---|
| Travel | range | ° | 180 | > 0 | Default, inspector, part file | |
| Slew rate | speed | °/s | 600 | > 0 | Default, inspector, part file | At 5 V. |
| Pulse at 0° / full range | pw_min, pw_max | s | 1 ms, 2 ms | > 0, pw_min < pw_max | Default, inspector, part file | |
| Minimum supply | v_min | V | 4 | ≥ 0 | Default, inspector, part file | |
| Idle / stall current | i_idle, i_stall | A | 6 mA, 0.8 A | ≥ 0 | Default, inspector, part file | |
| Initial angle | angle | ° | 90 | any | Default, inspector, part file | |
| Signal threshold | vth | V | 1.5 | > 0 | Default, inspector, part file | |
| Deadband | deadband | s | 4 µs | ≥ 0 | Default, inspector, part file |
Key: the name in the circuit file, in a parameter step (R1.r) and for AI agents. Range: a value outside it is refused with E_PARAM. Value comes from: where you can set it. The All parameters tab and agents can set every parameter.
| Type | Pins | Variants | Class |
|---|---|---|---|
encoder (SW) | 3pin: A, C, B. 5pin: plus S1, S2 (push switch) | 3pin, 5pin | approximate |
A mechanical quadrature encoder: contacts A and B close in quadrature as the shaft turns, A leading B for increasing position, both open at a detent. Change pos to turn it one detent per 20 ms, or set rpm to turn it continuously.
| Parameter | Key | Unit | Default | Range | Value comes from | What it does |
|---|---|---|---|---|---|---|
| Pulses per revolution | ppr | 20 | 1 to 1000 | Default, inspector, part file | ||
| Detents per revolution | detents | 20 | 1 to 1000 | Default, inspector, part file | ||
| Shaft position | pos | detents | 0 | any | Live slider | |
| Continuous speed | rpm | rpm | 0 | ±100 000 | Live slider | |
| Contact resistance | ron | Ω | 2 | > 0 | Default, inspector, part file | |
| Bounce | bounce | s | 0 | ≥ 0 | Live slider | |
| Push switch | push | 0 / 1 | 0 | Live slider | 5pin. |
Key: the name in the circuit file, in a parameter step (R1.r) and for AI agents. Range: a value outside it is refused with E_PARAM. Value comes from: where you can set it. The All parameters tab and agents can set every parameter.
34.9Buzzers and speakers
| Type | Pins | Variants | Class |
|---|---|---|---|
buzzer (BZ) | +, - | magnetic, piezo (passive), active, active_piezo (self-oscillating) | approximate |
A passive magnetic buzzer is its coil plus a tuned motional network. A passive piezo is a capacitance with a motional branch. An active buzzer draws v_rated / i_rated above v_min with a small ripple at its tone. The spl readout is the relative sound level, 0 to 1.
| Parameter | Key | Unit | Default | Range | Value comes from | What it does |
|---|---|---|---|---|---|---|
| Frequency | f0 | Hz | 2700 (piezo 4000) | > 0 | Default, inspector, part file | |
| Rated voltage | v_rated | V | 5 | > 0 | Default, inspector, part file | |
| Rated current | i_rated | A | 30 mA | > 0 | Default, inspector, part file | |
| Coil resistance | r | Ω | 16 | > 0 | Default, inspector, part file | Magnetic. |
| Coil inductance | l | H | 1.5 mH | > 0 | Default, inspector, part file | Magnetic. |
| Capacitance | c | F | 20 nF | > 0 | Default, inspector, part file | Piezo. |
| Mechanical Q | q | 8 | > 0 | Default, inspector, part file | ||
| Minimum voltage | v_min | V | 3 | ≥ 0 | Default, inspector, part file | Active. |
Key: the name in the circuit file, in a parameter step (R1.r) and for AI agents. Range: a value outside it is refused with E_PARAM. Value comes from: where you can set it. The All parameters tab and agents can set every parameter.
| Type | Pins | Variants | Class |
|---|---|---|---|
speaker (LS) | +, - | none | approximate |
The Thiele-Small electrical equivalent: voice-coil resistance and inductance, then the motional resonance at fs set by qms and qes. Warns above its rated power.
| Parameter | Key | Unit | Default | Range | Value comes from | What it does |
|---|---|---|---|---|---|---|
| Nominal impedance | z | Ω | 8 | > 0 | Default, inspector, part file | Sets re. |
| Voice-coil resistance | re | Ω | 0.8 x z | > 0 | Default, inspector, part file | |
| Voice-coil inductance | le | H | 0.1 mH | ≥ 0 | Default, inspector, part file | |
| Resonance frequency | fs | Hz | 150 | > 0 | Default, inspector, part file | |
| Mechanical / electrical Q | qms, qes | 3, 0.8 | > 0 | Default, inspector, part file | ||
| Rated power | p_rated | W | 1 | > 0 | Default, inspector, part file |
Key: the name in the circuit file, in a parameter step (R1.r) and for AI agents. Range: a value outside it is refused with E_PARAM. Value comes from: where you can set it. The All parameters tab and agents can set every parameter.