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

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.

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):

On the rear side, you have antenna connector, boot and reset buttons, buzzer, USB connector, RGB diode, status LEDs, power terminal and RS485.

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.




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.

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.

Some closeups:




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++
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++

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
The video does not cover it, but WS2812 can be also controlled in OpenESP. Just set pin role:

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.

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!
Comments
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]