Skip to Content

WLD-521-R1 Water Meter & Leak

(0 review)
The WLD‑521‑R1 is a configurable smart I/O module designed for leak detectionwater flow meteringheat energy monitoring, and local irrigation control. It includes 5 opto-isolated digital inputs, 2 SPDT relays, optional 4 buttons and 4 LEDs, and connects via RS-485 (Modbus RTU). Ideal for water management, hydronic heating, garden irrigation, and safety automation systems.
0.00 0.00

Overview

The WLD‑521‑R1 is a configurable smart I/O module designed for leak detectionpulse 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
  1. Mount & Wire – Install on 35mm DIN rail, connect 24V DC power, sensors, and relay loads.

  2. Configure – Plug in USB-C, open the WebConfig tool in Chrome/Edge, set Modbus address and I/O mapping.

  3. 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
  1. Connect USB-C to module and PC

  2. Open https://www.home-master.eu/configtool-wld-521-r1

  3. Click "Connect" and select serial port

  4. Set Modbus address (default: 3) and baud rate (default: 19200 8N1)

  5. Configure input actions, relay mapping, LED modes, and button functions

  6. Settings save automatically to flash

Tech Specs

SpecificationDetails
MicrocontrollerRP2350A, Dual‑core ARM Cortex‑M0+
Operating Voltage3.3V, 5V (logic), 24V DC input
Digital Inputs5 (opto‑isolated)
Relay Outputs2 (SPDT, 3A @ 250V AC)
User Buttons4 (configurable)
User LEDs4 (configurable)
1‑Wire Bus1 (for DS18B20)
Sensor Power RailsIsolated +5V / +12V
CommunicationRS‑485 (Modbus RTU)
Config InterfaceUSB‑C (Web Serial)
Operating Temp0‑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
Firmware & Software
Mechanical Files

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 RangeNameTypeDescription
1-5DI1-DI5BooleanDigital Input states (0=OFF, 1=ON)
60-61RLY1-RLY2BooleanRelay output states (0=OFF, 1=ON)
90-93LED1-LED4BooleanUser LED states (0=OFF, 1=ON)
100-103BTN1-BTN4BooleanButton pressed states (0=Released, 1=Pressed)
Coils (FC01/FC05) - Read/Write
Maintained Coils (Switched - ESPHome can set ON/OFF directly)
Address RangeNameTypeDescription
200-201Relay 1-2 StateBooleanRelay ON/OFF states (maintained)
220-224DI1-DI5 EnableBooleanDigital Input enable states (maintained)
Pulse Coils (Cleared after use)
Address RangeNameTypeDescription
340-344DI1-DI5 Counter ResetBooleanReset counters for DIs (pulse, auto-cleared)
Holding Registers (FC03) - Read Only
Status Registers (UINT16: 0 or 1)
Address RangeNameTypeDescription
1-5DI1-DI5 StateUINT16Digital Input states (mirror of ISTS)
60-61RLY1-RLY2 StateUINT16Relay output states (mirror of ISTS)
90-93LED1-LED4 StateUINT16User LED states (mirror of ISTS)
100-103BTN1-BTN4 StateUINT16Button pressed states (mirror of ISTS)
Flow Meter Data (UINT32 - 2 registers each, Little Endian)
Address RangeNameTypeUnitDescription
104-113DI1-DI5 Flow RateUINT32L/min × 1000Flow rate for each DI (2 registers each)
114-123DI1-DI5 Flow AccumulatedUINT32L × 1000Total flow for each DI (2 registers each)
Heat Energy Data (S32/U32 - 2 registers each, Little Endian)
Address RangeNameTypeUnitDescription
124-133DI1-DI5 Heat PowerSINT32WHeat power for each DI (2 registers each)
134-143DI1-DI5 Heat EnergyUINT32Wh × 1000Total heat energy for each DI (2 registers each)
144-153DI1-DI5 Heat ΔTSINT32°C × 1000Temperature difference for each DI (2 registers each)

1-Wire Temperature Data (SINT32 - 2 registers each, Little Endian)

Address RangeNameTypeUnitDescription
154-173OW Sensor 1-10 TempSINT32°C × 10001-Wire sensor temperatures (2 registers each)
Notes
  1. Maintained Coils (200-224): These coils maintain their state. ESPHome can read/write them directly as switches.

  2. Pulse Coils (340-344): These coils are automatically cleared after being read. Write 1 to reset the corresponding counter.

  3. Holding Registers: All 32-bit values (UINT32/SINT32) are stored as two consecutive 16-bit registers in Little Endian format (low word first).

  4. 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

  5. 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:

  1. ESPHome device (HomeMaster MiniPLC/MicroPLC or any ESP32/ESP8266 with RS‑485)

  2. RS‑485 connection between ESP device and WLD‑521‑R1

  3. 24V power to WLD‑521‑R1 module

  4. Home Assistant with ESPHome add‑on installed

RS‑485 Configuration
yaml
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
yaml
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

yaml
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

  1. Connect USB-C to PC

  2. Hold Buttons 2 + 3 to enter BOOT mode

  3. Upload via:

    • UF2 drag-and-drop to mounted drive, OR

    • PlatformIO/Arduino IDE upload

  4. Press Buttons 1 + 3 for hardware reset if needed

Pin Mapping (Default Firmware)

Pin NameGPIOFunction
IN1GPIO6Digital Input 1
IN2GPIO11Digital Input 2
IN3GPIO12Digital Input 3
IN4GPIO7Digital Input 4
IN5GPIO26Digital Input 5
RLY1GPIO10Relay 1 Driver
RLY2GPIO9Relay 2 Driver
BTN1GPIO1Button 1
BTN2GPIO2Button 2
BTN3GPIO3Button 3
BTN4GPIO0Button 4
LED1GPIO20User LED 1
LED2GPIO19User LED 2
LED3GPIO18User LED 3
LED4GPIO21User LED 4
RS485_TXGPIO4RS‑485 Transmit
RS485_RXGPIO5RS‑485 Receive