Part

DPDT relay

The bare relay: a coil for a transistor to drive and two poles on one arm.

See every part
  • 8 pins
  • 6 settings
  • In 3 projects
Drawn live by the editor's own code, at the size you see it.
At a glance

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_operate and
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_ms and
pull_ms
5
release_ms
4
5 and 4 ms.
Pins

8 pins

Named as the editor names them, so a wire lands where you expect it.

Pin
What it does
COIL1
The coil, either way around.
COIL2
The coil, either way around.
COM1
Pole 1: the arm, normally open, normally closed.
NO1
Pole 1: the arm, normally open, normally closed.
NC1
Pole 1: the arm, normally open, normally closed.
COM2
Pole 2.
NO2
Pole 2.
NC2
Pole 2.
How to use 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.

Part pin
Board pin
COIL1
5 V
COIL2
Transistor collector
COM1
Motor
NO1
5 V
NC1
GND
COM2
5 V
NO2
Green LED, through 220 ohm
NC2
Red LED, through 220 ohm

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.

Arduino Uno: relay switches a motorlive0.000 s 0.00x
Click to open it in the editor
This is the simulator itself, running here. Click anything to open it in the editor.
How it is modeled

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.

Projects

See the DPDT relay in a project

3 built-in projects use it. Each opens in the editor, already wired.

Boards

The boards it is shown on

This board has a built-in project with the DPDT relay in it.

Wire up the DPDT relay

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.