DPDT relay
The bare relay: a coil for a transistor to drive and two poles on one arm.
- 8 pins
- 6 settings
- In 3 projects
The DPDT relay in brief
What it is, and every setting the properties panel gives it.
A bare DPDT relay is the small sealed 5 V relay with no module around it: a coil (COIL1 and COIL2, either way around) and two changeover poles on one arm, COM1, NO1 and NC1 and COM2, NO2 and NC2. Its 125 ohm coil takes 40 mA at 5 V, more than a pin should source, so the pin drives a 2N2222 through 1 k, the coil sits between 5 V and the collector, and a 1N4007 goes across it, band to 5 V. On an ESP32 a 3.3 V GPIO drives the same transistor, but the coil still needs 5 V: Mokxi pulls the arm in at 75 percent of the rating, 3.75 V, so a 5 V coil on 3.3 V never closes. It lets go only under 10 percent, takes 5 ms to pull in and 4 ms to release. Two poles on one arm let one coil reverse a motor: the motor across the COMs and the supply crossed over between the NOs and NCs. The classic mistake is wiring the coil straight to a pin. Coil inductance, the kick the diode is there for, contact bounce and contact ratings are not modeled.
- Family
- Outputs
- Pins
- 8
- coil_volts
- 5
- the rated coil voltage, 5 V.
- coil_ohms
- 125
- its resistance, 125 ohms,
which is 40 mA at 5 V.
must_operateand - must_operate
- 0.75
- must_release
- 0.1
- the fractions of the
rated voltage at which it pulls in and lets go, 0.75 and 0.1.
pull_msand - pull_ms
- 5
- release_ms
- 4
- 5 and 4 ms.
8 pins
Named as the editor names them, so a wire lands where you expect it.
How to use a bare DPDT relay with an Arduino
A bare relay has nothing in front of its coil, and the coil takes 40 mA at 5 V, so it hangs between 5 V and a 2N2222’s collector. Pin 7 drives the base through 1 k, and a 1N4007 goes across the coil with its band to 5 V. digitalWrite(7, HIGH) pulls the arm in.
The two poles move together but switch separate circuits. In this project pole 1 runs a DC motor (COM1 to the motor, NO1 on 5 V, NC1 on ground, so the motor brakes when released), and pole 2 lights a green LED on NO2 or a red one on NC2. Wire a motor between COM1 and COM2 with the supply crossed over between the NOs and NCs instead, and one coil reverses it.
On an ESP32 the 3.3 V pin drives the same transistor, but keep the coil on 5 V: it needs 75 percent of its rating, 3.75 V, to pull in, so a 5 V coil on 3.3 V never closes.
What is true about the DPDT relay, here
In its help article’s own words: what the simulation gets right, and where it stops.
Modeled
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.
Not modeled
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.
From DPDT relay, in full.
See the DPDT relay in a project
3 built-in projects use it. Each opens in the editor, already wired.
The boards it is shown on
This board has a built-in project with the DPDT relay in it.
The rest of the bench
Every one of these is drawn and simulated the same way.
Wire up the DPDT relay
Open the editor and push it into the breadboard. It is free, and it runs on your own machine.