Overview
The WLD‑521‑R1 is a configurable smart I/O module designed for leak detection, pulse water metering, ΔT heat monitoring, and local irrigation control. It exposes 5 opto‑isolated digital inputs, 2 SPDT relays, 4 user buttons, and 4 status LEDs, and is serviced over USB‑C via WebConfig.
It integrates with a MiniPLC/MicroPLC (or other PLC/SCADA/HA controllers) via Modbus RTU over RS‑485. Configuration is done in a browser using the WebConfig tool (Web Serial over USB‑C): set Modbus params, choose per‑input modes (sensor/counter), link 1‑Wire temperature sensors, and enable autonomous irrigation/flow‑safety logic.
Getting Started
Quick Setup Process
Mount & Wire – Install on 35mm DIN rail, connect 24V DC power, sensors, and relay loads.
Configure – Plug in USB-C, open the WebConfig tool in Chrome/Edge, set Modbus address and I/O mapping.
Integrate – Connect to your controller via RS-485 and start automation.
What You Need
WLD‑521‑R1 module
24V DC SELV power supply
RS‑485 cable (twisted pair, shielded)
USB‑C cable for configuration
Chromium-based browser (Chrome/Edge)
Web Configuration Steps
Connect USB-C to module and PC
Click "Connect" and select serial port
Set Modbus address (default: 3) and baud rate (default: 19200 8N1)
Configure input actions, relay mapping, LED modes, and button functions
Settings save automatically to flash
Tech Specs
| Specification | Details |
|---|---|
| Microcontroller | RP2350A, Dual‑core ARM Cortex‑M0+ |
| Operating Voltage | 3.3V, 5V (logic), 24V DC input |
| Digital Inputs | 5 (opto‑isolated) |
| Relay Outputs | 2 (SPDT, 3A @ 250V AC) |
| User Buttons | 4 (configurable) |
| User LEDs | 4 (configurable) |
| 1‑Wire Bus | 1 (for DS18B20) |
| Sensor Power Rails | Isolated +5V / +12V |
| Communication | RS‑485 (Modbus RTU) |
| Config Interface | USB‑C (Web Serial) |
| Operating Temp | 0‑40℃ |
| Dimensions (W×H×D) | 70 × 90.6 × 67.3 mm |
Documentation
The WLD‑521‑R1 is open‑source hardware! You can build your own board using the following files:
Hardware Design Files
Field Board Schematic: WLD‑521‑R1‑FieldBoard.pdf
MCU Board Schematic: WLD‑521‑R1‑MCUBoard.pdf
System Block Diagram: WLD_SystemBlockDiagram.png
Field Board Diagram: FieldBoard_Diagram.png
MCU Board Diagram: MCUBoard_Diagram.png
Firmware & Software
Firmware Source Code: WLD‑521‑R1/Firmware/
WebConfig Tool: ConfigToolPage.html
ESPHome Integration Package: default_wld_521_r1_plc.yaml
Mechanical Files
Dimensional Drawing: WLD_Dimensions.png
All design files and documentation are available in the HomeMaster GitHub repository.
Input and Output
Digital Inputs (5 channels)
Configurable actions: None, Toggle, or Pulse
Target mapping to individual relays or all relays
PTC + TVS protection on each channel
Relay Outputs (2 channels)
SPDT contacts (NO/NC/COM)
3A @ 250V AC rating
Individual enable/invert settings
Controlled via Modbus coils or local input mapping
RC/TVS snubbers recommended for inductive loads
User Interface
4 Buttons: Configurable for relay override (toggle function)
4 LEDs: Configurable steady or blink modes, linked to relay status
Status LEDs: PWR (power), TX/RX (Modbus activity)
Communication Interfaces
Protocol: Modbus RTU
Role: Slave device
Default Settings: Address 3, 19200 baud, 8 data bits, No parity, 1 stop bit
Function Codes
FC02 - Read Input Status (Discrete Inputs)
FC03 - Read Holding Registers
FC05 - Write Single Coil
FC01 - Read Coils
Input Status (FC02) - Read Only
| Address Range | Name | Type | Description |
|---|---|---|---|
| 1-5 | DI1-DI5 | Boolean | Digital Input states (0=OFF, 1=ON) |
| 60-61 | RLY1-RLY2 | Boolean | Relay output states (0=OFF, 1=ON) |
| 90-93 | LED1-LED4 | Boolean | User LED states (0=OFF, 1=ON) |
| 100-103 | BTN1-BTN4 | Boolean | Button pressed states (0=Released, 1=Pressed) |
Coils (FC01/FC05) - Read/Write
Maintained Coils (Switched - ESPHome can set ON/OFF directly)
| Address Range | Name | Type | Description |
|---|---|---|---|
| 200-201 | Relay 1-2 State | Boolean | Relay ON/OFF states (maintained) |
| 220-224 | DI1-DI5 Enable | Boolean | Digital Input enable states (maintained) |
Pulse Coils (Cleared after use)
| Address Range | Name | Type | Description |
|---|---|---|---|
| 340-344 | DI1-DI5 Counter Reset | Boolean | Reset counters for DIs (pulse, auto-cleared) |
Holding Registers (FC03) - Read Only
Status Registers (UINT16: 0 or 1)
| Address Range | Name | Type | Description |
|---|---|---|---|
| 1-5 | DI1-DI5 State | UINT16 | Digital Input states (mirror of ISTS) |
| 60-61 | RLY1-RLY2 State | UINT16 | Relay output states (mirror of ISTS) |
| 90-93 | LED1-LED4 State | UINT16 | User LED states (mirror of ISTS) |
| 100-103 | BTN1-BTN4 State | UINT16 | Button pressed states (mirror of ISTS) |
Flow Meter Data (UINT32 - 2 registers each, Little Endian)
| Address Range | Name | Type | Unit | Description |
|---|---|---|---|---|
| 104-113 | DI1-DI5 Flow Rate | UINT32 | L/min × 1000 | Flow rate for each DI (2 registers each) |
| 114-123 | DI1-DI5 Flow Accumulated | UINT32 | L × 1000 | Total flow for each DI (2 registers each) |
Heat Energy Data (S32/U32 - 2 registers each, Little Endian)
| Address Range | Name | Type | Unit | Description |
|---|---|---|---|---|
| 124-133 | DI1-DI5 Heat Power | SINT32 | W | Heat power for each DI (2 registers each) |
| 134-143 | DI1-DI5 Heat Energy | UINT32 | Wh × 1000 | Total heat energy for each DI (2 registers each) |
| 144-153 | DI1-DI5 Heat ΔT | SINT32 | °C × 1000 | Temperature difference for each DI (2 registers each) |
1-Wire Temperature Data (SINT32 - 2 registers each, Little Endian)
| Address Range | Name | Type | Unit | Description |
|---|---|---|---|---|
| 154-173 | OW Sensor 1-10 Temp | SINT32 | °C × 1000 | 1-Wire sensor temperatures (2 registers each) |
Notes
Maintained Coils (200-224): These coils maintain their state. ESPHome can read/write them directly as switches.
Pulse Coils (340-344): These coils are automatically cleared after being read. Write 1 to reset the corresponding counter.
Holding Registers: All 32-bit values (UINT32/SINT32) are stored as two consecutive 16-bit registers in Little Endian format (low word first).
Scaling:
Flow Rate: Multiply by 0.001 to get L/min
Flow Accumulated: Multiply by 0.001 to get L
Heat Energy: Multiply by 0.001 to get Wh
Temperatures: Multiply by 0.001 to get °C
Total Register Range: 1-173 (continuous address space for FC03)
Example Usage
Read Digital Input 1 State: FC03, Address: 1 → Returns: 0 (OFF) or 1 (ON)
Control Relay 1 ON: FC05, Address: 200, Value: 1 (ON) or 0 (OFF)
Read Flow Rate for DI1: FC03, Addresses: 104-105 → Read as UINT32, divide by 1000 → Result in L/min
Reset Counter for DI1: FC05, Address: 340, Value: 1 (will be auto-cleared by firmware)
Home Assistant & ESPHome Integration Guide
Overview
The WLD‑521‑R1 integrates seamlessly with Home Assistant via ESPHome using the Modbus RTU protocol. This guide covers both quick integration using our pre‑built package and manual configuration for advanced users.
Prerequisites
Before starting, ensure you have:
ESPHome device (HomeMaster MiniPLC/MicroPLC or any ESP32/ESP8266 with RS‑485)
RS‑485 connection between ESP device and WLD‑521‑R1
24V power to WLD‑521‑R1 module
Home Assistant with ESPHome add‑on installed
RS‑485 Configuration
uart:
id: uart_modbus
tx_pin: GPIO17
rx_pin: GPIO16
baud_rate: 19200
parity: NONE
stop_bits: 1
modbus:
id: modbus_bus
uart_id: uart_modbus
Import WLD‑521‑R1 Package
packages:
wld_521_r1:
url: https://github.com/isystemsautomation/HOMEMASTER
ref: main
files:
- path: WLD-521-R1/Firmware/default_wld_521_r1_plc/default_wld_521_r1_plc.yaml
vars:
wld_prefix: "WaterModule"
wld_id: water_module
wld_address: 3
refresh: 1d
Customize Variables
wld_prefix: Appears in entity names (e.g., "Staircase Relay 1")
wld_id: Must be unique if adding multiple DIO modules
wld_address: Set to match your DIO-430-R1 Modbus address (default: 3)
Multiple WLD Modules
For additional modules, duplicate the package block with unique IDs:
Example: Multiple WLD Modules
packages:
wld_kitchen:
url: https://github.com/isystemsautomation/HOMEMASTER
ref: main
files:
- path: WLD-521-R1/Firmware/default_wld_521_r1_plc/default_wld_521_r1_plc.yaml
vars:
wld_prefix: "Kitchen"
wld_id: kitchen_module
wld_address: 4
refresh: 1d
wld_garden:
url: https://github.com/isystemsautomation/HOMEMASTER
ref: main
files:
- path: WLD-521-R1/Firmware/default_wld_521_r1_plc/default_wld_521_r1_plc.yaml
vars:
wld_prefix: "Garden"
wld_id: garden_module
wld_address: 5
refresh: 1d
Programming
Supported Development Environments
Arduino IDE with RP2350 support
PlatformIO with RP2350 toolchain
MicroPython (community builds available)
Firmware Flashing
Connect USB-C to PC
Hold Buttons 2 + 3 to enter BOOT mode
Upload via:
UF2 drag-and-drop to mounted drive, OR
PlatformIO/Arduino IDE upload
Press Buttons 1 + 3 for hardware reset if needed
Pin Mapping (Default Firmware)
| Pin Name | GPIO | Function |
|---|---|---|
| IN1 | GPIO6 | Digital Input 1 |
| IN2 | GPIO11 | Digital Input 2 |
| IN3 | GPIO12 | Digital Input 3 |
| IN4 | GPIO7 | Digital Input 4 |
| IN5 | GPIO26 | Digital Input 5 |
| RLY1 | GPIO10 | Relay 1 Driver |
| RLY2 | GPIO9 | Relay 2 Driver |
| BTN1 | GPIO1 | Button 1 |
| BTN2 | GPIO2 | Button 2 |
| BTN3 | GPIO3 | Button 3 |
| BTN4 | GPIO0 | Button 4 |
| LED1 | GPIO20 | User LED 1 |
| LED2 | GPIO19 | User LED 2 |
| LED3 | GPIO18 | User LED 3 |
| LED4 | GPIO21 | User LED 4 |
| RS485_TX | GPIO4 | RS‑485 Transmit |
| RS485_RX | GPIO5 | RS‑485 Receive |
Related products
These other products might interest you