Relay module 4 channels (5 V, optocoupler) with ESP32

Supply 5 V Bus GPIO
GNDIN1IN2IN3IN4VCCJD-VCC

Pins and ESP32 wiring

PinRoleESP32 pinNotes
GNDGroundGND
IN1Input (the ESP32 drives it)D25LOW = relay on (typical)
IN2Input (the ESP32 drives it)D26
IN3Input (the ESP32 drives it)D27
IN4Input (the ESP32 drives it)D32
VCCPowerVINNeeds 5 V: use VIN
JD-VCCNot wired to the ESP32—Separate coil supply. Keep the jumper to VCC unless you use an isolated supply

Suggested wiring for the 30-pin ESP32 DevKit, avoiding flash, input-only and strapping pins. BoardPilot checks it for you as you wire.

This module is sold for 5 V. Its outputs may be 5 V: use a level shifter or a voltage divider on ESP32 inputs.

Sources

Try it in 3D in BoardPilot

BoardPilot Part data (JSON)

Related parts

Part data: CC BY 4.0, free to reuse with credit to BoardPilot.