4-Channel ESP32 Relay Board: Wire It Right (Active-LOW, JD-VCC and COM/NO/NC) - Compoden

4-Channel ESP32 Relay Board: Wire It Right (Active-LOW, JD-VCC and COM/NO/NC)

The Compoden 4-channel relay board for the ESP32 30-pin form factor looks simple: drop it on, pick four GPIOs, switch four loads. Most first-time failures come from three things people skip: the active-LOW inputs, the JD-VCC jumper, and which screw terminal is which.

No firmware in this guide. It's the hardware side only, so whatever sketch you already have (or whatever Soldr writes later) has a board that will actually click.

How the board is put together

Each channel is a 5V relay with an optocoupler on the input. The ESP32 only lights the LED inside the optocoupler, so the coil and the switched load stay off the GPIO.

The inputs are active LOW: GPIO LOW turns the relay on, HIGH turns it off. The coils want 5V. Don't run them from the ESP32's 3V3 pin.

What you need

Wiring diagram: ESP32 to 4-channel relay board VCC GND IN1-IN4, JD-VCC jumper, and a 12V DC load on COM and NO

Step 1: Power the coils the right way

The board has VCC for the logic/optocoupler side and JD-VCC for the coils. Many boards ship with a jumper linking the two so one 5V supply feeds both.

For a quiet desk test, leave the jumper on and feed 5V into VCC from a separate adapter, or from the ESP32's 5V/VIN if USB can spare it. Each coil draws about 70–80mA, so four relays at once is roughly 300mA of coil current alone.

If the ESP32 resets when a relay clicks, remove the jumper and power JD-VCC from its own 5V supply. Keep GND common with the ESP32 so the coil kick stays off the 3.3V rail.

Step 2: Wire the control side

ESP32 GND to relay GND. VCC to 5V, never 3V3. IN1–IN4 to spare GPIOs — GPIO 16, 17, 18 and 19 are good picks on a 30-pin DevKit. Avoid boot pins 0, 2, 12, 15 and the flash pins 6–11.

If you're stacking the board on the headers, check the silk against your DevKit. Pinouts vary; jumper wires are safer when you're not sure.

Step 3: COM, NO and NC

Each channel has three screw terminals. COM is common. NO (normally open) connects to COM only when the relay is on. NC (normally closed) connects to COM when the relay is off.

For a load that should stay off until your sketch turns it on, put the supply through COM and NO. Leave NC empty.

Step 4: Wire a DC load and smoke-test

Start with a 5–12V DC fan, LED strip or small pump. Do not start with mains AC.

Example for a 12V fan: supply positive to the fan positive, fan negative to NO, COM to supply negative. The relay breaks one side of the circuit.

Power up with every IN pin HIGH. No relay should click. Briefly short one IN to GND — that channel's LED lights and you hear the click. Only then connect the load and toggle from your sketch.

The full wiring

From To
ESP32 GND Relay board GND
5V adapter + (or ESP32 5V/VIN) Relay board VCC
JD-VCC jumper On for shared 5V; off + separate 5V on JD-VCC if the ESP32 resets
ESP32 GPIO 16 / 17 / 18 / 19 IN1 / IN2 / IN3 / IN4
12V supply + Load +
Load - Relay NO
Relay COM 12V supply -
Relay NC Leave open for a normally-off load

A few notes so it works the first time:

  • Active LOW. GPIO LOW = relay on. If your sketch writes HIGH for on, flip it.
  • 5V for coils, 3.3V for IN. VCC/JD-VCC are 5V. The IN pins are happy with ESP32 3.3V through the optocoupler.
  • COM–NO for normally off. That's the usual pattern. NC is for fail-safe 'on until commanded off'.
  • DC first. Mains AC needs a proper enclosure, fuse and strain relief. Not a breadboard experiment.

If something's off

  • Never clicks: try grounding IN by hand, confirm VCC is 5V, confirm GND is shared.
  • Clicks, then the ESP32 resets: remove the JD-VCC jumper and give the coils their own 5V supply.
  • Clicks, load stays dead: you're on NC instead of NO, or the supply isn't going through COM.
  • LED on, no click: JD-VCC isn't powered, or try another channel.

Taking it further with Soldr

Want the firmware and a full parts plan, not just the wiring? Describe the build at soldr.ai, like "an ESP32 that switches four 12V pumps on a schedule with this 4-channel relay board". Soldr designs the hardware from the idea: it picks parts from the Compoden catalog, assigns the pins, and gives you the wiring and the firmware. Soldr is Compoden's AI, so every part in the plan is one you can order here.

Get the grounds right, respect active-LOW, start on COM–NO with a DC load, and the board will click the first time your sketch asks it to.

Back to blog

Open this project in the Soldr app → What is Soldr.ai → parts, wiring and code for what this guide builds