DPDT relay
A bare 5 V double-pole double-throw signal relay, the small sealed kind: two changeover contacts on one arm, and a coil with nothing in front of it.
This is the relay itself rather than a module, so there is no transistor, no diode and no LED on it, and driving it is the lesson. Two poles on one arm are what lets one coil reverse a motor.
Pins
| Pin | What it does |
|---|---|
COIL1, COIL2 |
The coil, either way around. |
COM1, NO1, NC1 |
Pole 1: the arm, normally open, normally closed. |
COM2, NO2, NC2 |
Pole 2. |
Properties
coil_volts: the rated coil voltage, 5 V. coil_ohms: its resistance, 125 ohms,
which is 40 mA at 5 V. must_operate and must_release: the fractions of the
rated voltage at which it pulls in and lets go, 0.75 and 0.1. pull_ms and
release_ms: 5 and 4 ms.
Driving it
40 mA is more than a board pin should give, so the coil goes between 5 V and the collector of a transistor, with a diode across the coil (band to 5 V). Pin high through 1 k to the base and the coil pulls in.
Reversing a motor
Wire the motor between COM1 and COM2. Put the supply on NC1 and NO2, and
ground on NO1 and NC2. Released, COM1 is on the supply and COM2 on ground;
pulled in, it is the other way around.
What the model gets right
The coil is a real 125 ohm load, so a resistor in series or a weak supply leaves it with less than it needs. It pulls in at 75 percent of its rating and does not let go until it falls under 10 percent, so once in it holds on at a voltage that would never have pulled it in. Both poles move together, and neither contact is made while the arm travels.
What it does not model
The coil's inductance, which is what the diode is for: here the current stops instantly and nothing breaks without the diode, so the circuit is right to have one and the simulator cannot show why. Contact bounce, contact ratings, and the change of coil resistance with temperature.
See it in action
Relays reverse a motor uses one to reverse a motor from a single pin. Open it at /templates.