W5500 PoE Drainage Gauge for Smart Irrigation
W5500 PoE node reports drainage volume over MQTT and UECS-CCM.
W5500 PoE Sensor Node for Drainage Data
agri-drain-poe is a compact smart-agriculture sensor node that measures irrigation drainage volume and publishes it over wired Ethernet. It uses an M5Stack ATOM Lite with an M5Stack ATOM PoE Base, where the Ethernet interface is provided by a WIZnet W5500. A DFRobot SEN0575 tipping-bucket rainfall sensor is repurposed as the drainage gauge: each bucket tip is multiplied by a configurable mL per tip calibration value, producing cumulative drainage volume in milliliters.
The project is interesting because it is not a generic cloud demo. It is a small piece of a greenhouse irrigation control system. The node only measures drainage; a central RPI / agriha side is expected to compare drainage volume with irrigation flow volume and adjust valve duty elsewhere. That boundary keeps the firmware focused: sensor polling, wired Ethernet, local configuration, and data publishing.
Tipping-Bucket Drainage Measurement
The sensing path is based on the SEN0575 rainfall sensor in UART mode. The README lists the sensor wiring as M5 GPIO26 TX to the SEN0575 RX side, M5 GPIO32 RX from the SEN0575 TX side, with 5 V power. The source confirms this UART path in src/sensors.h, where HardwareSerial(1) is started at 9600 8N1 and Modbus RTU frames are built manually.
The firmware reads several input registers from the SEN0575. It checks PID and VID during detection, then polls cumulative raw rain data, raw tip count, and work time. For the drainage application, the important value is not the sensor's original rainfall depth. The project uses the raw tip count and computes:
drainage_ml = raw_tips x ml_per_tipml_per_tip is stored in ESP32 NVS and can be edited through the node's web configuration page. The default is 3.6 mL per tip, but the README notes that the value depends on the collection funnel area and should be calibrated with a known liquid volume.
W5500 Ethernet Through agri-node-poe-core
The W5500-specific network setup lives in the related agri-node-poe-core library. platformio.ini depends on that library and uses the pioarduino platform-espressif32 fork because the project needs Arduino ESP32 3.x support for ETH.begin(ETH_PHY_W5500, ...).
In the shared AgriNetwork.h, the W5500 is started through ESP32's ETH driver with SPI pins for the ATOM PoE Base. The library then exposes link and DHCP status to the application, starts mDNS, and enables ArduinoOTA. This means the per-node sketch can stay focused on the sensor and publishing logic while the common library handles the wired network behavior.
For WIZnet, this is a useful real-world pattern. The W5500 is used as the Ethernet interface for a small PoE sensor node deployed in an agriculture context. The project values wired connectivity not as a benchmark claim, but as part of a practical field-node design with DHCP, local HTTP configuration, MQTT output, UECS-CCM output, and OTA update support.
MQTT and UECS-CCM Output Path
The application publishes two output formats. The MQTT payload is JSON and includes drainage_ml, raw_tips, ml_per_tip, work_min, node_id, and uptime_s. The publish function retains the payload on the configured MQTT topic prefix, so a dashboard or controller can read the latest drainage state.
The second output path is UECS-CCM. The code publishes a Drainage.cMC value containing cumulative drainage in milliliters. The source comments note that Drainage is not a standard UECS vocabulary name; it is a project-specific channel name intended for the author's central receiver. That is an important limitation, but it also shows how the node is built for a known system rather than for a generic sensor demo.
Repository Structure and Practical Limits
The repository is small. The project-specific files are main.cpp, sensors.h, config.h, mqtt_pub.h, and ccm_pub.h, plus a PlatformIO configuration. The larger reusable network and UI infrastructure is intentionally kept in agri-node-poe-core. That dependency also links this node to a wider family of M5Stack ATOM PoE agriculture nodes, including rainfall, flow, environment, and solar radiation nodes.
There are also clear limits. The repository does not include a schematic, BOM, enclosure photo, sensor mounting photo, field log, or calibration result. It also does not include the central control software that turns drainage measurements into valve duty changes. Finally, the main agri-drain-poe repository has no license file at the time checked, while the shared agri-node-poe-core library states 0BSD. Anyone reusing the exact application code should confirm permission with the author.
Why This Project Is Worth Featuring
agri-drain-poe is a good example of W5500 Ethernet in a focused sensing role. It does not try to be a full greenhouse controller. Instead, it provides one reliable measurement input for a larger irrigation workflow. That makes it useful for makers and engineers who want to build wired sensor nodes around MQTT or agricultural control protocols while keeping the firmware small and serviceable.
The project is also a signal that W5500-based PoE nodes can fit a modular smart-agriculture architecture. One node can measure drainage, another flow, another environment, and a central controller can combine those values. This is the kind of applied system where a stable wired Ethernet path can be more valuable than a flashy feature list.
FAQ
What does this project measure?
It measures cumulative irrigation drainage volume. A DFRobot SEN0575 tipping-bucket sensor is repurposed so that each tip is counted and multiplied by a configurable milliliters-per-tip value.
What does the project use the W5500 for?
The W5500 is the wired Ethernet interface on the M5Stack ATOM PoE Base. The shared agri-node-poe-core library starts it through Arduino ESP32's ETH_PHY_W5500 path and provides DHCP, mDNS, OTA, HTTP UI, MQTT, and UECS-CCM networking support.
Does this node control irrigation valves directly?
No. The README describes this node as the drainage-side input for a central drainage-rate duty loop. The central RPI / agriha side is expected to compare drainage volume with irrigation volume and control valves separately.
What must be calibrated before field use?
The mL per tip value must be calibrated for the actual funnel and plumbing. The firmware provides a web configuration field for this value, but the repository does not include a field calibration report.
Can this pattern be reused for other agricultural sensors?
Yes, with care. The related agri-node-poe-core library is already used by the author's other M5Stack ATOM PoE agriculture nodes, so a similar pattern can be reused for sensors that need W5500 Ethernet, MQTT, UECS-CCM, local configuration, and OTA.


