logo elektroda
logo elektroda
X
logo elektroda

[YT] ESP32-S3-Relay-6CH six relays controller - schematic, flashing, Home Assistant

p.kaczmarek2  9 2316 Cool? (+5)
📢 Listen (AI):

TL;DR

  • Waveshare ESP32-S3-Relay-6CH is an industrial-grade ESP32-S3 relay controller with six relays, RS485, USB-to-UART, a WS2812B status LED, and Raspberry Pi Pico Hat-compatible GPIO headers.
  • The board uses PC817 optocouplers for relay isolation and an XL1509-ADJE1 step-down converter that lets it run from up to 36V.
  • PlatformIO and OpenESP32 demos show direct flashing, relay toggling, and WS2812 control on GPIO38, with Home Assistant discovery supported.
  • A sample flashing command writes OpenESP32S3_1.18.156_4M.factory.bin over COM47 at 460800 baud, making the module easy to pair with Home Assistant.
Generated by the language model.
Waveshare ESP32-S3-Relay-6CH relay module with six green terminal channels
Waveshare ESP32-S3-Relay-6CH is an industrial-grade relay control module based on ESP32-S3 WiFi & BT module. It features RS485 connectivity, on-board USB to UART converter, six relays connected via PC817 optocouplers, a single WS2812B diode (for status display), onboard GPIO connector compatible with Raspberry Pi Pico Hats and can run on up to 36V thanks to the built-in XL1509-ADJE1 step down converter.

Unboxing
Let's see what's in the box. It seems that antenna and small screwdriver are included.
Waveshare ESP32-S3-Relay-6CH controller with ports and connectors in a box
The module is fully encased and all IO terminals are labeled. Relays are on the front side, each has three terminals (both normally open and closed):
Waveshare ESP32-S3-Relay-6CH relay module with six green terminal channels
On the rear side, you have antenna connector, boot and reset buttons, buzzer, USB connector, RGB diode, status LEDs, power terminal and RS485.
WaveShare ESP32-3S-Relay-6CH controller with visible connectors and function labels

Documentation
Most of the information can be found on Waveshare wiki:
https://www.waveshare.com/wiki/ESP32-S3-Relay-6CH
Here is the board schematic - it shows which GPIOs are used for features like relays, WS2812 or which extra GPIOs are available inside.
Electronic schematic of ESP32-S3 module with interfaces, relays, and power supply
ESP32-S3 relay board with 6 relays, isolation features and protection components shown
Wiring diagram for ESP32 relay module with AC 220V and DC 30V devices
ESP32-S3 board with RS485 interface and 40-pin Raspberry Pi Pico HAT header




Quick teardown
This is not needed for flashing and usage, but it's always interesting to check how things are made. You can unscrew the cover with the screwdriver that is included in the set.
ESP32-S3 module with 6 relays and green terminal blocks
The device is made mostly out of surface mount components. There are two extra 2.54mm pin headers inside, which can be used to route out GPIO. They are compatible with Raspberry Pi Pico Hats.
ESP32-S3 board with relay module and green terminal connectors
Some closeups:
ESP32-S3 board with six relays and screw connectors visible Close-up of ESP32-S3 relay board with relays, capacitors, and labeled pins Waveshare ESP32-S3-Relay-6CH board with labeled pins and electronic components Close-up of a circuit board with labeled IC and SMD components


PlatformIO demo
Device can be very easily programmed directly in PlatformIO. Here's a simple relay "hello world" that toggles a single relay in a loop:
Code: C / C++
Log in, to see the code




The WS2812 is on GPIO38. It can be controlled either with a WS2812 library like FastLED or, for example, directly with RMT:
https://www.elektroda.com/rtvforum/topic4115010.html
There is also a Neopixel function that can work well with WS2812 as well:
Code: C / C++
Log in, to see the code

Close-up of USB cable and blue LEDs on an electronic board with labeled connections
NOTE: This particular photo is taken from the similar Waveshare board, but the one in the topic was tested as well.


OpenESP32 demo
OpenESP32 is a port of our OBK open source firmware. It runs on many chips from ESP family, including ESP32 S3. Flashing procedure and pairing with Home Assistant is shown here:



I'm attaching flashing script:

esptool.exe --port COM47 --baud 460800 write_flash 0x0 OpenESP32S3_1.18.156_4M.factory.bin

Change COM port to suit your system.

Template:
Code: JSON
Log in, to see the code


The video does not cover it, but WS2812 can be also controlled in OpenESP. Just set pin role:
Configuration interface with dropdowns and value fields for IO35–IO44
and setup driver:

startDriver SM16703P
SM16703P_Init 1 GRB
SM16703P_SetPixel 0 255 0 0
SM16703P_Start
startdriver pixelanim

This way you can also get this to HA, but you must run HA discovery after running the script.
Light control interface with color wheel and 24% brightness level



Summary
Waveshare ESP32-S3-Relay-6CH is a very easy to use module - you can either program it from yourself in PlatformIO, or flash a premade software like Tasmota - in this case I've presented our OpenESP32. This way you can easily pair it with Home Assistant and control and script relays, WS2812 LED also works well with our WS2812 driver. Futhermore, you can later script it in Berry language:
Berry scripting for various IoT platforms - tutorial for OBK new script integration part 1
Do you think that ESP32-S3-Relay-6CH module is a good idea for home automation and DIY projects, or would you prefer another one? Let us know!

About Author
p.kaczmarek2
p.kaczmarek2 wrote 14404 posts with rating 12336 , helped 650 times. Been with us since 2014 year.

Comments

krzbor 12 Sep 2025 19:19

Perhaps someone knows - why do the Chinese, so renowned for their economy in electronics, use opto-isolation for relays? Even their cheap executive modules have opto-isolation. [Read more]

Anonymous 13 Sep 2025 15:23

. Many Chinese modules are designed for universal use and a wide audience. The use of opto-isolation is a kind of standard, which guarantees that the module will be safe and work properly with different... [Read more]

krzbor 14 Sep 2025 00:27

. That's what I thought too, but the "secondary side" of the optoisolation is fed from the same voltage as the "primary". [Read more]

Anonymous 14 Sep 2025 22:45

. So what is the "Power Isolation" section on the schematic of this module used for? [Read more]

p.kaczmarek2 15 Sep 2025 00:36

@krzbor see the Power section and how the schematic is partitioned. There is a B0505S-3WR2 there and it powers a separate Relay-5V line while maintaining galvanic isolation. https://obrazki.elektroda.pl/6240768300_1757889279_bigthumb.jpg... [Read more]

krzbor 15 Sep 2025 19:35

. You're right - I hadn't noticed that. That is, to drive the relay from the I/O output of the processor we have: an isolated DC/DC converter, an amplifying transistor for the optocoupler diode, an optocoupler,... [Read more]

Anonymous 15 Sep 2025 19:46

. Redundancy is a form of safety. If one layer of isolation (e.g. the optocoupler) fails, the other (the inverter) can still provide isolation, with the final barrier being the relay itself. Such redundancy... [Read more]

krzbor 15 Sep 2025 20:19

I agree, but this is a uniquely non-Chinese approach. I was beginning to wonder if Chinese relays could be trusted. Note that the processor is not powered by 5V. There is an additional 3.3V stabiliser... [Read more]

Anonymous 15 Sep 2025 20:27

. I would agree with this and it strongly depends on the quality of the components used. Maybe the designer of this module was thinking about scenarios that are statistically unlikely, but the consequences... [Read more]

FAQ

TL;DR: Waveshare ESP32‑S3‑Relay‑6CH packs 6 relays, RS485, and up to 36 V input; “WS2812 is on GPIO38.” [Elektroda, p.kaczmarek2, post #21687660]

Why it matters:** This FAQ shows how to flash, wire, and integrate the 6‑relay ESP32‑S3 board with Home Assistant, fast—ideal for makers, installers, and HA tinkerers fixing “how do I flash it and map pins?” problems.

Quick Facts

What is the Waveshare ESP32‑S3‑Relay‑6CH and what can it do?

It’s an industrial‑style ESP32‑S3 controller with six relays, RS485, USB‑UART, buzzer, and a WS2812 status LED. The enclosure is labeled, and I/O headers expose extra GPIO compatible with Raspberry Pi Pico hats. It suits automation scenes, pump or light control, and HA integrations. [Elektroda, p.kaczmarek2, post #21687660]

How do I flash OpenESP32 firmware onto this board?

Use esptool with the factory image offset 0x0 and a high baud rate. Example: esptool.exe --port COMx --baud 460800 writeflash 0x0 OpenESP32S3...factory.bin. Change COM to match your system. After flashing, pair with Home Assistant as shown in the linked demo. [Elektroda, p.kaczmarek2, post #21687660]

Which GPIOs control the relays on this model?

The provided template maps relays to GPIOs 1, 2, 41, 42, 45, and 46. Import that template in OpenESP32 to get consistent control and discovery. This mapping matches the board’s schematic and verified tests. [Elektroda, p.kaczmarek2, post #21687660]

How do I toggle a relay in PlatformIO (Arduino)?

Set the relay’s GPIO as OUTPUT and write HIGH/LOW in a timed loop. The thread’s "hello world" uses GPIO1, toggling every second while printing a counter over Serial at 115200 baud. Keep outputs LOW at boot to avoid unintended switching. [Elektroda, p.kaczmarek2, post #21687660]

How can I drive the onboard WS2812 LED?

The WS2812 sits on GPIO38. You can control it using FastLED, RMT, or Arduino’s neopixelWrite. A simple loop can show red, green, blue, then off with short delays. Quote: “WS2812 is on GPIO38.” [Elektroda, p.kaczmarek2, post #21687660]

Does this board provide real galvanic isolation for the relay side?

Yes. The power section uses a B0505S‑3WR2 isolated DC/DC to feed a separate Relay‑5V rail. That establishes galvanic isolation between logic and relay power, complementing the PC817 optocouplers in the signal path. [Elektroda, p.kaczmarek2, post #21690279]

Why include optocouplers if the relays already isolate the load?

Optocouplers add a safety layer, help block EMI, and separate grounds, reducing ground‑loop risk. As one expert notes, “Redundancy is a form of safety.” This multilayer approach improves robustness when driving external, noisy loads. [Elektroda, khoam, post #21691001]

Could added isolation and parts increase failure risk?

Yes, more components mean more potential failure points. A user cautions that redundancy can raise failure rates, especially with complex DC/DC modules. Design trade‑offs balance safety, EMI immunity, and reliability. This is your key edge‑case consideration. [Elektroda, krzbor, post #21691035]

What is RS485 on this board used for?

RS485 is a balanced serial interface for long runs and noisy environments. This board exposes RS485 on the rear panel, enabling integration with existing field buses or converters in industrial or building automation. [Elektroda, p.kaczmarek2, post #21687660]

How do I integrate the board with Home Assistant using OpenESP32?

Flash OpenESP32, apply the provided template, and enable HA discovery. For the WS2812, set a pixel role and start the SM16703P driver, then rerun HA discovery. The video link shows pairing steps. [Elektroda, p.kaczmarek2, post #21687660]

Is there a quick 3‑step flashing and pairing guide?

  1. Connect USB, enter boot mode if needed, and run esptool with the factory image at 0x0.
  2. Reboot; join Wi‑Fi; open the device page; load the relay template.
  3. Enable HA discovery; verify six entities appear; test toggling each relay. [Elektroda, p.kaczmarek2, post #21687660]

What input power range and regulators does it use?

The module accepts up to Approx. 36 V input using an XL1509 step‑down. Logic runs at 3.3 V via an onboard regulator with filtering. This supports stable operation even with higher input supplies found in panels. [Elektroda, p.kaczmarek2, post #21687660]

How is the internal layout and what headers are available?

The mostly SMD design includes two internal 2.54 mm headers exposing extra GPIO. They align with Raspberry Pi Pico hat pinouts, enabling rapid prototyping or sensor breakouts without extra boards. [Elektroda, p.kaczmarek2, post #21687660]

Can I script automation logic on‑device?

Yes. OpenESP32 supports scripting in Berry, letting you run local automations and relay sequences without a constant external broker. This reduces latency and improves resilience during network outages. [Elektroda, p.kaczmarek2, post #21687660]

Any tips for WS2812 color order and HA visibility?

Set the pixel driver to GRB order in OpenESP32 (SM16703P_Init 1 GRB), then start pixelanim. Re‑run HA discovery to expose the light entity. This ensures colors map correctly and the LED appears in HA. [Elektroda, p.kaczmarek2, post #21687660]

What’s a practical current/voltage statistic to remember here?

Remember the two big numbers: 6 relays for control breadth and up to Approx. 36 V input flexibility. Those define capacity and power planning when deploying in cabinets or retrofits. [Elektroda, p.kaczmarek2, post #21687660]
Generated by the language model.
%}