Modbus2MQTT arduino module
The module and code is different from other projects because with this module we have the possibility to control 32 Outputs, and read in 32 Inputs. Because light switches can be triggered in matters of milliseconds, reading the inputs has to be done fast.
Features:
- Control 32 outputs (control relays, heat pump valves,…)
- Read in 32 inputs (light switches,…)
- Automatic discovery of Home Assistant (plug in device and it shows up in HA)
- Automatic creation of inputs, outputs and health status in Home Assistant
- Small form factor to control 32 lights and have 32 inputs (light switches ex.)
Hardware:
Software:
Screenshot of Arduino module
Screenshot of Home Assistant:
Screenshot of Health Status:
Screenshot of add-on which is for now manually added in Home Assistant:

This add-on answers on the udp broadcast of the module so it can easely find the MQTT server. Of course the first time you set it up, you have to use default username and password, but after discovery they can be changed.
For this project I made a circuit board and used the following hardware:
- Arduino mega pro
- 24dc to 5dc converter (soldered on the circuit board)
- RS485 to Modbus board (soldered on the circuit board)
- Ethernet board
All this fits in the DIN case.
Wanna have a cheap basic Home control system, I think this can be it!





