Agricultural irrigation system controlled by EQSP32 IoT controllers

System Overview

This application covers the control of a multi-zone agricultural irrigation installation on a large site, where water travels through extensive piping networks from a central well pump and reservoir to multiple remote substations, each managing several electric valves. The control challenge is typical of large-site irrigation: too many I/O points, spread over too large an area, to wire back to a single central panel.

The solution is a distributed architecture. A master unit manages the local zone, the well pump, the reservoir fill pump, and the pressurization pump. One or more slave units, each located at a remote substation, manage their own valve sets independently without any control wiring back to the master panel. All controllers communicate over MQTT.

This application note describes a two-controller installation (one master, one slave) as a concrete reference. The architecture is inherently scalable: adding a substation means deploying another EQSP32 slave, subscribing it to the relevant MQTT topics, and assigning it a set of zones in the master scheduling logic. A dozen slaves on the same site presents no architectural change.

System overview showing master EQSP32 controller, remote slave controller, pumps, reservoir with pressure sensor, and irrigation zones
System overview. The master controller manages the well pump, reservoir fill pump, pressurization pump, and local irrigation zones. Reservoir level is measured continuously by a bottom-mounted pressure sensor; a float switch at the top of the tank provides an independent overflow safety cutoff. The slave controller at the remote substation manages its own valve set independently. Both units connect to the MQTT broker over Wi-Fi.

I/O Inventory

All I/O was mapped before any logic was written. The master and slave units have distinct I/O assignments:

SignalUnitTypeNotes
Irrigation zone valves (local)MasterRelay outPWM-derated, 24 V coil
Well pump enableMasterRelay outSignals VFD or contactor
Reservoir fill pumpMasterRelay out3-phase, 40 A relay, up to 26 kW
Pressurization pumpMasterRelay out24 V common relay
Flow meter (well)MasterDigital inHall-effect pulse, frequency-to-flow
Reservoir level (continuous)MasterAnalog in4–20 mA pressure sensor, bottom-mounted
Reservoir full switchMasterDigital inFloat switch, independent overflow safety cutoff
Weather station dataMasterVirtual (API)HTTPS call to weather station cloud
Irrigation zone valves (remote)SlaveRelay outPWM-derated, 24 V coil
Zone commands from masterSlaveVirtual (MQTT)Boolean per zone, subscribed topic

Distributed Architecture and MQTT Communication

The master controller is the scheduling authority. It evaluates watering schedules, weather data, tank levels, and flow readings, then decides which zones across both units should be active at any given time. For its own local valves, it actuates the relays directly. For the remote slave unit, it publishes one Boolean MQTT topic per remote zone. The slave subscribes to these topics and actuates its valves accordingly. The slave makes no scheduling decisions of its own.

Master-slave MQTT architecture showing topic publishing and subscription between the two EQSP32 controllers
MQTT communication architecture. The master publishes one topic per remote zone. The slave subscribes and actuates. Telemetry (state, uptime, Wi-Fi signal) flows back to the broker from both units.

MQTT was chosen as the communication layer because it is a mature, well-supported protocol designed for exactly this class of application: low data rate, many topics, reliable delivery over unreliable networks. The data volume in this installation is very low — a few dozen small messages per minute — which keeps broker costs negligible even on metered cloud tiers.

Broker options: the system works with any standards-compliant MQTT broker. For installations with internet connectivity, managed cloud brokers (HiveMQ Cloud, EMQX Cloud, AWS IoT Core) provide reliable uptime and TLS security with no infrastructure to maintain. For sites where connectivity is intermittent or data must remain on-premises, a local broker (Mosquitto on a small Linux server or NUC) is equally viable. The EQSP32 connects to either with the same firmware configuration.

Connectivity at Each Substation

Each EQSP32 unit requires an independent internet or network connection to reach the MQTT broker. This is the main site infrastructure consideration for distributed installations and should be planned before panel layout.

For most agricultural sites, Wi-Fi coverage is the first option to evaluate. Industrial-grade outdoor Wi-Fi access points can cover 200 m or more in open terrain. The EQSP32 supports an external antenna via a standard connector, which significantly extends effective range compared to internal antenna designs and allows the antenna to be mounted on the outside of a metal enclosure or on an elevated point for better line-of-sight.

For substations beyond practical Wi-Fi reach, two options are available:

Connectivity recommendation: start with Wi-Fi and external antennas — this covers the majority of agricultural sites with no additional hardware or firmware changes. Plan cellular or LoRa only for substations where a Wi-Fi survey confirms insufficient coverage.

Wiring: Master and Slave Panels

Both controllers are mounted on DIN rail inside their respective panels. The EQSP32 is powered from a DIN-rail 110/240 V to 24 V DC supply in each panel. The 24 V rail powers the controller and all valve coils directly. A 5 V output from the EQSP32 powers the flow meter sensor.

Master EQSP32 wiring diagram showing pump relays, motor protection block, valve outputs, flow meter pulse input, and 4-20 mA pressure sensor
Master panel wiring. The EQSP32 drives valve relays, the pressurization pump relay, and the well pump relay directly. The 3-phase irrigation pump relay feeds through a motor protection block before reaching the motor terminals. Reservoir level is read as a 4–20 mA signal from a bottom-mounted pressure sensor. The flow meter connects as a pulse output to a digital input, powered from the EQSP32 5 V rail.
Slave EQSP32 wiring diagram showing remote zone valve outputs and flow meter input
Slave panel wiring at the remote substation. Zone valve outputs connect directly to the EQSP32. No control wiring runs back to the master panel.
Installed slave EQSP32 panel at remote irrigation substation
Installed slave panel at the remote substation. The EQSP32 on DIN rail, power supply, and valve terminals fit in a compact weatherproof enclosure.

Valve Control: PWM Derating

Standard 24 V solenoid irrigation valves require significant pull-in current to overcome the mechanical inertia of the plunger, but a much lower current to hold the valve open. Driving all valves at full coil voltage continuously puts unnecessary thermal load on the power supply and the valve coils themselves.

The EQSP32 handles this automatically on every output configured in relay mode:

The result is that a modest 24 V supply can drive more simultaneous valves than a continuous-drive design would allow, and valve coil temperatures stay lower over long watering cycles. Built-in flyback diodes on each output suppress inductive transients at the terminals.

All irrigation valves in this installation are normally-closed solenoids. On loss of power or control signal, every valve returns to its closed position without any software intervention. Water flow stops safely across the entire system on any supply failure.

PWM derating waveform showing high pull-in duty cycle followed by reduced hold duty cycle for irrigation valve control
PWM output profile for valve control. Full duty cycle during pull-in, reduced hold duty cycle thereafter. The EQSP32 applies this automatically on all outputs in relay mode.

High-Power Pump Relay

The reservoir fill pump in this installation is a three-phase motor drawing up to 26 kW. A dedicated high-capacity relay rated at 40 A per phase is used to switch it. Between the relay and the motor terminals, a motor protection block provides thermal overload and phase-loss protection, ensuring the motor is not damaged by sustained overcurrent or a missing phase. The relay coil is 24 V and is driven by an EQSP32 output using the same PWM derating profile as the valve outputs.

A separate smaller relay switches the 24 V common for the valve bus, and a third relay signals the well pump controller when the reservoir needs filling. All relay coils in the system are 24 V, simplifying the control wiring: the EQSP32 24 V rail drives everything without additional signal converters or intermediate relays.

Flow Monitoring and Leak Detection

Both the master and slave panels include a Hall-effect flow meter in the water supply line. The meter uses a propeller with magnets embedded in the blades. As the propeller rotates with water flow, a Hall-effect sensor generates one pulse per revolution. The EQSP32 measures the pulse frequency and converts it to a flow rate using the meter's calibration constant.

Reservoir level is measured continuously by a bottom-mounted pressure sensor with a 4–20 mA output. The hydrostatic pressure at the sensor is proportional to the water column height, giving a smooth, accurate level reading across the full tank range. This allows the fill pump to be staged on adjustable level thresholds rather than a fixed high/low setpoint. The EQSP32 analog input reads the 4–20 mA signal directly, powered from the panel 24 V rail through a current loop. A float switch mounted at the maximum safe fill level provides an independent hardware safety cutoff: if the pressure sensor reading is ignored or the fill logic fails, the float switch stops the fill pump regardless of control software state.

Hall-effect water flow sensor installed in irrigation supply pipe
Hall-effect flow meter in the supply line. Pulse frequency ranges from a few Hz at low flow to several hundred Hz at full flow. The EQSP32 captures this accurately using a dedicated hardware pulse counter peripheral, with no risk of missed pulses regardless of what the rest of the firmware is doing.

The flow data serves two functions:

Weather-Adjusted Scheduling

The master EQSP32 makes periodic HTTPS API calls to an on-site weather station connected to a cloud service. The controller reads the rainfall total for the preceding 24 hours and compares it against a configurable threshold. If sufficient rain has fallen, the scheduled irrigation cycle is suspended. More complex strategies can incorporate additional weather parameters: wind speed (to reduce drift losses), air temperature, and evapotranspiration estimates for crop-specific water demand modelling.

Weather station data being accessed by the EQSP32 for irrigation schedule adjustment
The EQSP32 polls the weather station API directly. Rainfall, temperature, wind speed, and humidity are available as inputs to the scheduling logic. No intermediate gateway or cloud service is required between the controller and the weather data.

The ability to make direct HTTPS API calls from the controller — without an intermediate gateway — is uncommon at this price and form factor. Most micro-PLCs in this class require a separate edge computer or cloud function to fetch external data and relay it to the controller.

Software Architecture

The master firmware handles several concurrent concerns within a fixed-period main loop:

The slave firmware is deliberately simple: subscribe to zone command topics, actuate the corresponding relay outputs, measure local flow, and publish telemetry back. All intelligence is in the master.

Software architecture diagram showing master logic blocks, MQTT topics, and slave subscription
Software architecture. The master owns scheduling, weather, and pump logic. MQTT topics carry zone commands downstream and telemetry upstream. The slave firmware is a thin actuator layer.
Firmware execution flow chart for the master EQSP32 irrigation controller
Master firmware execution flow. Weather polling, schedule evaluation, flow measurement, pump sequencing, and MQTT publish all run within the same periodic loop with appropriate time-division.

Field Operations Interface

The control system exposes two operator interfaces built on top of the same MQTT data stream: a full SCADA-style desktop dashboard for the control room, and a smartphone app for field staff working on-site.

Desktop SCADA dashboard showing irrigation zone grid, pump status, reservoir level, flow meters, weather-adjusted schedule, and controller connectivity
Desktop dashboard (PC browser). A supervisory view covering all zones across three controllers, live flow data, reservoir level, pump state, schedule status, weather adjustment summary, and per-controller Wi-Fi signal strength. Intended for the agronomist or site manager at a desk.

Field staff need to monitor system state, trigger manual overrides, and diagnose faults without returning to a PC. A smartphone-optimised view of the same MQTT data stream provides exactly this, accessible from any phone on the site network or remotely through the broker.

Smartphone portrait UI showing zone status cards, active flow, tank level, pump controls, schedule, and alert badges on a dark-theme mobile dashboard
Smartphone field app (portrait mode). Zone status, active flow, tank level, pump toggles, schedule, and alerts are accessible through a bottom-navigation layout sized for one-handed use. Badge count on the Alerts tab flags issues that need attention without opening the view.

EQ-AI: Coding Productivity for Control Engineers

The irrigation firmware was developed with EQ-AI, the Erqos AI coding assistant trained specifically on the EQSP32 library, hardware documentation, and a library of application examples. For an experienced control programmer, EQ-AI functions as a high-productivity tool: it generates correct library calls, suggests idiomatic patterns for scheduling and state machine logic, and resolves IoT connectivity questions (MQTT topic structure, TLS configuration, broker authentication, JSON payload formatting) without requiring the developer to search documentation.

The assistant is particularly useful at the IoT integration layer, where the number of configuration options and protocol details can slow development even for engineers with deep PLC experience. EQ-AI reduces that overhead significantly, allowing the developer to focus on the control logic rather than the connectivity plumbing.

EQ-AI is a productivity tool, not a replacement for engineering judgment. Control logic, fail-safe design, and system architecture decisions remain the responsibility of the programmer. EQ-AI accelerates the implementation of decisions already made.

Why EQSP32 for This Application

Direct HTTPS API calls

The controller fetches weather data directly from external APIs without an intermediate gateway, edge server, or cloud function.

Native MQTT client

Built-in MQTT stack with TLS support connects to any standards-compliant broker, cloud or local, without external libraries.

PWM valve derating

Automatic pull-in and hold current management on every output reduces supply sizing and keeps valve coil temperatures low during long cycles.

Hardware pulse counter

A dedicated pulse counter peripheral captures flow meter signals from a few Hz to several hundred Hz accurately, independent of firmware execution timing and without external counter hardware.

5 V sensor supply output

The EQSP32 generates 5 V directly for the flow meter sensor, eliminating the need for a separate sensor supply in the panel.

No control wiring between panels

The master-slave architecture eliminates all inter-panel control wiring over long distances. Only power and network infrastructure are needed at the remote substation.

Ready to design your irrigation control system?

EQSP32 datasheet, I/O reference, MQTT guide, and application source code available.

View the EQSP32