Part

Relay board, four channels

Four relays in a row, active low, each on its own terminal.

See every part
  • 18 pins
  • 4 settings
  • In 2 projects
  • In 1 lesson
Drawn live by the editor's own code, at the size you see it.
At a glance

The Relay board, four channels in brief

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

The four-channel relay board puts four SRD relays in a row, with a GND, IN1 to IN4 and VCC header at one end and NO, COM and NC terminals for every channel. On an Uno, four digital pins drive the inputs and VCC goes to the 5 volt pin; on an ESP32 the 3.3 volt outputs still read as high against half of VCC, but VCC itself must be 5 volts, because under 4 volts Mokxi’s coils will not pull in. It is active low, so LOW switches a channel on and HIGH switches it off. Each channel has its own 10 millisecond pull-in and 5 millisecond release, with its red LED lit while energized. The 12 and 24 volt versions are a coil property: they need 9 and 18 volts to pull in, and an active-low 12 volt board driven straight from a 5 volt pin never turns off, so each input wants a transistor. Four coils draw about 280 milliamps, more than a USB-powered Uno likes, but coil current is not modeled, nor is the separate JD-VCC jumper or contact bounce.

Family
Outputs
Pins
18
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

18 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
IN3
Input
IN4
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
NO3
Input or output
COM3
Input or output
NC3
Input or output
NO4
Input or output
COM4
Input or output
NC4
Input or output
How to use it

How to use a 4 channel relay module with an Arduino

The relay board example drives IN1 to IN4 from pins 2 to 5, with the board’s VCC on 5 volts and its GND on the Uno’s ground. Each lamp is fed from its channel’s NO contact with every COM on the 5 volt rail, so a lamp lights only while its relay is pulled in, and the red LEDs on the board show which coils are energized.

Swap the digitalWrite(pin, HIGH) and pinMode(pin, OUTPUT) lines in the example’s setup() and press Run: all four relays click on together at startup, which is what a real board does in the instant a pin sits low as an output. Written HIGH first, every channel stays off until the sketch asks for it.

Part pin
Board pin
IN1
Pin 2
IN2
Pin 3
IN3
Pin 4
IN4
Pin 5
VCC
5 V
GND
GND
COM1 to COM4
5 V rail
NO1 to NO4
Each lamp’s resistor

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

Arduino Uno: relay boardlive0.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 Relay board, four 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, four channels in a project

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

Lessons

Where it turns up in a lesson

One lesson places it in its own circuit.

Boards

The boards it is shown on

This board has a built-in project with the Relay board, four channels in it.

Wire up the Relay board, four channels

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