Source: https://mokxi.com/parts/relay2
Updated: 2026-11-10

Part

# Relay board, two channels

Two relays with optocouplers, active low: LOW on IN is on.

See every part

- 10 pins
- 4 settings
- In 8 projects

Drawn live by the editor's own code, at the size you see it.

At a glance

## The Relay board, two channels in brief

What it is, and every setting the properties panel gives it.

The two-channel relay board carries two SRD-05VDC relays, each behind an optocoupler, with a GND, IN1, IN2 and VCC header and a three-screw terminal per channel for NO, COM and NC. Besides switching two loads, it is the cheap way to reverse a DC motor: wire the two changeover contacts as an H-bridge and the polarity flips with which relay is pulled in. The input side is what confuses people. Each IN pin sinks the opto’s LED to ground, so the board is active low by default: digitalWrite(pin, LOW) turns a channel on, while HIGH or an unwired pin turns it off. A sketch that sets pinMode to OUTPUT before writing HIGH clicks both relays on, so write HIGH first. Mokxi gives each channel the SRD coil’s 10 millisecond pull-in and 5 millisecond release, a red LED while energized, and a trigger property for the rarer active-high boards. Power VCC from 5 volts, since under 4 volts no coil pulls in, and the coil property covers 12 and 24 volt versions. The JD-VCC jumper, coil current and contact bounce are not modeled.

Family

Outputs

Pins

10

trigger

low (or high)

low (the default, as on nearly every board sold) or high.

coil

5V (or 12V, 24V)

5V (the default), 12V or 24V, the SRD relay the board carries.
pull_ms and

pull_ms

10

release_ms

5

10 and 5 ms, the SRD-05VDC's times.

Pins

## 10 pins

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

Pin

Role

What it does

GND

Input or output

Ground.

IN1

Input

IN2

Input

VCC

Input or output

The coils' supply, 5 V unless coil says 12 or 24 V.

NO1

Input or output

Each channel's changeover contact.

COM1

Input or output

Each channel's changeover contact.

NC1

Input or output

NO2

Input or output

COM2

Input or output

NC2

Input or output

How to use it

## How to use a 2 channel relay module with an Arduino

In the relays reverse a motor example, IN1 and IN2 go to pins 6 and 7, VCC to 5 volts and GND to ground. Each NO contact is on 5 volts, each NC on ground, and the motor sits between COM1 and COM2. With neither channel on, both motor leads are grounded and it brakes; pull one channel in and that lead goes to 5 volts.

The board is active low, so the sketch hides it behind a relayOn() helper and writes each pin HIGH before pinMode(pin, OUTPUT). To reverse, release one channel before pulling in the other, as the sketch does with a 600 millisecond pause; both in at once just puts 5 volts on both leads, which is a brake again rather than a short.

Part pin

Board pin

IN1

Pin 6

IN2

Pin 7

VCC

5 V

GND

GND

COM1, COM2

The motor’s two leads

NO1, NO2

5 V

NC1, NC2

GND

On an ESP32 the inputs can come straight from 3.3 volt pins, but VCC still needs 5 volts, or no coil pulls in.

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

Active low, without the click at power-up

How it is modeled

## What is true about the Relay board, two channels, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Modeled

Everything the single module gets right, per channel: the 10 ms pull-in and 5 ms
release, the arm touching neither contact while it travels, and no coil pulling in
under 4 V of VCC on a 5 V board. Each channel's red LED lights while its coil is energized.

### Not modeled

The optocoupler as a circuit: the input is a logic level against half of VCC,
where a real one is an LED that a 3.3 V high on a 5 V board may still half light.
The JD-VCC jumper that lets the coils run from their own supply is not brought
out: VCC powers everything. Coil current (about 70 mA a channel, 280 mA for four and
560 mA for eight, more than a USB-powered board likes), contact bounce, and the 10 A contact rating.

From Relay boards: two, four and eight channels, in full.

Projects

## See the Relay board, two channels in a project

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

Boards

## The boards it is shown on

Each of these 2 boards has a built-in project with the Relay board, two channels in it.

- Arduino Uno R3
- ESP32-C3-DevKitM-1

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the Relay board, two channels

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

Start building free Open the editor
