Skip to content
Home > Components > Actuators > DPDT Relay

DPDT Relay

A Double Pole Double Throw (DPDT) electromechanical switch for controlling high-power circuits using a low-power control signal.

Component Preview

DPDT RelayDPDT Relay

This is a standard 5V DPDT relay (like the KS2E-M-DC5). When the coil is energized, an electromagnet pulls two internal mechanical switches, allowing you to route two separate electrical signals simultaneously.

ActuatorsElectromechanicalSwitch

Overview

A relay is a switch operated by an electromagnet. Because the control circuit (the coil) is physically isolated from the switched circuit (the poles), it is perfectly safe to use a 5V Arduino to switch much higher voltages.

Pin Reference

PinTypeDescription
COIL1inputRelay Coil Terminal 1.
COIL2inputRelay Coil Terminal 2. Provide 5V across COIL1/2 to switch the relay.
P1passivePole 1 (Common 1).
NC1passiveNormally Closed 1. Connected to P1 when coil is OFF.
NO1passiveNormally Open 1. Connected to P1 when coil is ON.
P2passivePole 2 (Common 2).
NC2passiveNormally Closed 2. Connected to P2 when coil is OFF.
NO2passiveNormally Open 2. Connected to P2 when coil is ON.

Configurable Attributes

AttributeTypeDefaultDescription
energisedbooleanfalseThe initial state of the relay (whether the coil starts energized).

Working Principle

When a sufficient voltage difference (usually 5V) is applied across the COIL1 and COIL2 pins, the electromagnet engages.

  • The P1 switch moves from NC1 to NO1.
  • The P2 switch moves from NC2 to NO2.

Wiring Diagram (via Transistor)

WARNING

Do not power relay coils directly from Arduino digital pins. Relays draw more current than an Arduino pin can supply and cause flyback voltage spikes. Always use a transistor (like a 2N2222) and a flyback diode.

Wiring Diagram

Example Arduino Code

This code simply turns the relay on and off every second (assuming you wired a transistor to pin 8).

cpp
const int RELAY_CTRL_PIN = 8;

void setup() {
  pinMode(RELAY_CTRL_PIN, OUTPUT);
}

void loop() {
  // Energize the relay coil
  digitalWrite(RELAY_CTRL_PIN, HIGH);
  delay(1000);
  
  // De-energize the relay coil
  digitalWrite(RELAY_CTRL_PIN, LOW);
  delay(1000);
}

Simulation Notes

  • The simulator mimics the internal mechanical switching. If you wire an LED to the NO (Normally Open) pin, it will only light up when the relay is energized.
  • Unlike real life, the simulator won't literally destroy your virtual Arduino if you forget the flyback diode, but it's good practice to wire circuits correctly!

Released under the MIT License.