The product, as being described by Waveshare, supports Modbus communication over TCP for controlling 8 relays. You can see more details at:
Modbus PoE Ethernet relay module
In general it should be mounted on a DIN-rail, so it is presumably adequate for industrial applications as well as being used in a home circuit breaker box.
Sadly, when using for automating tasks, sometimes it's not feasible to have a nearby Ethernet connection at all, so going wireless is an actual necessity.
I want to connect this product somewhat wirelessly which means no physical Ethernet connection is required for controlling the relays.
The product still needs power, whether it comes from as PoE (which is weird because we assume there's no nearby Ethernet switch) or a dedicated power supply.
You might be able to find an ESP32 relay board on Aliexpress, but I need this product since it supports being mounted on a DIN rail, which is a requirement where I put this board.
I don't really need fancy stuff, so I will not integrate an HTTP server or Over-The-Air firmware update capabilities. I wrote with the help of ChatGPT an Arduino sketch that uses MQTT over Wi-Fi to do what I need.
If you do any of this and would like to share, I'll be happy to merge it as another sketch :)
I assume you have a Wi-Fi access point. Any Wi-Fi AP will probably be sufficient as long as it supports 2.4GHz radio.
- A soldering gun and some solder wire
- Jumper wires - At least 10!
- Hot air gun station
- You probably need a metal director for QFP48 7mm x 7mm package too
- Arduino ESP32 NANO board - although you might be able to accomplish this with any other ESP32 board, I chose that board since it's really tiny and can fit nicely in the enclosure.
- A USB cable for programming the Arduino board (my board needs USB-C)
- A 12V regulated power supply - for testing the final product
A note about some of products - I bought my hot air gun and soldering gun (combo) station from Aliexpress. It came with everything I needed to continue.
- Arduino IDEv2 (with esp32 support being installed)
- An MQTT broker being installed. I use Mosquitto on a Linux PC.
You need to open the case by using a phillips screwdriver. I used a basic one from Aliexpress that came with some product I bought some time ago. The screwdriver metal part needs to be long enough to be able to take out the screws.
You need to take 4 screws out to open the case, and then you see the actual board:
This board has 8 PC817 opto-couplers on it. Each opto-coupler is used for a relay, which matches the fact that you have 8 relays.
The opto-coupler is being used to isolate the MCU (STM32F030C8T6) from the switching part of each relay. This is backed by the PC817 datasheet as well.
Since there are 8 opto-couplers, the MCU is connected to each opto coupler with a GPIO line, being set to an output mode.
After some tests with a continuity tester on my multimeter, I came up with this schematic for each opto-coupler:
After powering up the board carefully, I examined the voltage and it was set to 3.3V on each opto-coupler input leg, which means it's an active LOW input and only when we want to switch a relay ON, we set the output leg to LOW.
Since we know the basic design, there are multiple ways to do this project.
You might suggest putting a Wi-Fi-to-Ethernet adapter so you could make this product Wi-Fi enabled without altering the actual product.
Since I want no external device to do the Wi-Fi connection for me, this idea doesn't resonate with my requirements although it could be sufficient for other people.
The main MCU has a firmware to handle Ethernet packets from a presumably Ethernet PHY chip nearby, but I didn't try to understand what is the actual design.
Since I don't really care about the MCU, I decided to take it out with hot air gun. You need to heat that chip directly (with some metal piece to re-direct air flow on the chip specifically) with 350C degrees for about half a minute.
After the chip is removed, gently clean any remaining bits of solder which might remain on the exposed pads to avoid short-circuits.
We know where we need to connect a wire on each opto-coupler. Gently apply some solder wire to the input leg of each opto-coupler and connect a wire to that leg.
Since we're in 2026, there's no need to write a sketch by yourself. I asked ChatGPT to generate an Arduino sketch. After a couple of requests to fine-tune many parts of the sketch, I had something I was reasonably satisfied with!
ESP32 Wi-Fi MQTT Arduino sketch
The sketch supports re-connecting over Wi-Fi to my MQTT broker. It publishes relay state changes through MQTT specific topics and the user can change each relay separately. If Wi-Fi is gone, all relays are set open as a fail-safe measure.
I programmed that sketch, making sure to change the Wi-Fi credentials and MQTT broker options as well.
Then I tested that and saw on the serial monitor that it works perfectly up to this point!
While I tried to figure out the design of the opto-couplers with the rest of the board components, I measured some voltages and found 2 main ones - 3.3V and 5V.
You can connect a 7-36V supply (or PoE) to the product and power it, but the main MCU needs 3.3V, so there are 2 main stages:
The first stage is a DC-DC (buck?) converter that turns the wide range voltage input into a 5.49V output. Then it passes through a diode into an LDO IC (presumably?) that converts this into 3.3V for the STM32 IC.
Since Ground connection is easily visible, I just needed to pick a 5V source for Vin input on my ESP32 board and I carefully soldered a wire to the output leg of the mentioned diode.
I decided to utilize GPIO D2, D3, D4, D5, D6, D7, D8 and D9 as my output legs. I soldered them with a bit of solder wire, making sure to not accidentally short-circuit them together.
I powered the product via the DC-jack, with a 12V supply. I picked a random relay and started testing it.
After a couple of tests where it seems to work OK, I'm now convinced that I can deploy this :)
I tried to pick the best material and I came up with some fiber-glass material that should be OK. That material is safe for electronics as it's a good insulator, ESD-safe and safe for the expected temperatures within the enclosure.
I cut a roughly matched-size plate to put my ESP32 board on it.
I placed the small plate and glued it with some hot-glue:
Then I placed the board on it and carefully glued it as well:
I will want to connect this into my NodeRED setup. But technically it can be integrated into almost any system with some effort.

















