Weather Aware Smart Irrigation System

Smart Agricultural and Lawn Irrigation IoT System

The adoption of IoT technologies in irrigation management is transforming both agricultural landscapes and residential lawn care. Systems equipped with EQSP32 IoT controllers exemplify this technological advancement, offering robust, flexible, and efficient irrigation solutions. These systems are effective in settings ranging from vast farming operations to private lawns.

System Configuration and Operation

In a typical installation, one or multiple EQSP32 controllers may be employed to manage distinct zones of a farm or a large lawn area. The system depicted in the next figure represents an actual setup. Incorporating a Master EQSP32 Controller for the main zone and a Slave Remote Controller for a distant zone it is effectively bridging a distance of 150 meters or more.

Using EQSP32 - Industrial IoT ESP32 PLC to develop a smart irrigation system. The irrigation system overview demonstrates multiple stations being controlled by multiple EQSP32 devices as a single system. The stations are located far apart from each other. The system utilizes a personal weather station for local weather feedback and automatic watering schedule adjustments. The master controller is responsible to keep the water tank full by pumping water from a well. For energy optimization, this process is done during low energy cost (at night).
Irrigation System Configuration

The necessity for multiple controllers arises in systems where water travels through extensive and lengthy piping networks to reach various substations. Each substation is equipped with multiple valves that direct water to different irrigation points across expansive areas. This configuration facilitates localized control at each substation, thereby eliminating the need for lengthy wiring back to a central controller. In this specific installation, the Master controller additionally manages the pumps needed to fill a large water reservoir from an underground well and to pressurize the water distributed to the irrigation heads.

These controllers are connected to the internet via Wi-Fi, allowing for real-time data transmission and remote system management. Each controller can independently manage watering times and durations for each connected electric valve, making the system highly adaptable to specific watering needs.

Smart Water Management

One of the key features of the EQSP32-controlled irrigation system is its ability to adjust watering schedules automatically in response to weather conditions, captured by an onsite personal weather station. This integration ensures that irrigation is increased during dry spells and reduced when rain is sufficient, thus maintaining optimal soil moisture levels and reducing water and energy use without manual intervention.

Furthermore, the system’s flow meter plays a critical role in operational oversight by monitoring water usage. Any deviation from the norm, such as higher than usual water consumption, can indicate a leak in the system, while lower consumption might suggest a malfunctioning valve. These alerts enable quick diagnostics and prompt repairs, ensuring efficient and effective water management.

Remote Monitoring and Management

A significant advantage of this IoT-enabled irrigation system is its accessibility for remote management through a smartphone app. This capability allows gardeners and farmers to monitor the system’s performance from anywhere and make adjustments to watering schedules as needed, without being physically present at the site. It simplifies the management process, especially for large-scale operations or homeowners who wish to maintain their lawns effortlessly.

This digital management tool not only saves time but also enhances the precision of water delivery to plants. By enabling meticulous control over irrigation practices, tailored to the exact needs of crops or lawns, farmers and homeowners can achieve better growth outcomes and more efficient use of resources.

Electrical Connection Details

Wiring the EQSP32 for this irrigation system is straightforward and detailed in the schematics below. Elegantly mounted on the DIN rail, the EQSP32 directly connects to all relays, valves, and switches. The controller is powered by a DIN-rail mounted 110/20V to 24VDC power supply, and it generates the necessary 5V DC power for the flow meter.

EQSP32 - Industrial IoT ESP32 PLC wiring as a master device for the smart irrigation system.
Electrical Wiring of Master Controller
EQSP32 - Industrial IoT ESP32 PLC wiring as a slave device for the smart irrigation system.
Electrical Wiring of Slave Controller
EQSP32 - Industrial IoT ESP32 PLC electrical panel of slave device for the smart irrigation system.
Electrical panel of slave device for smart irrigation system

Direct Control of Irrigation Valves

In the illustrated system, each of the EQSP32’s outputs can drive 1A of current, which is more than sufficient for operating standard irrigation valves. The EQSP32 natively employs Pulse Width Modulation (PWM) to control the voltage applied to the valve coils.

This method involves a two-step power application process: initially, the controller delivers a surge of power to activate the valve, which requires substantial energy for a brief duration to overcome the inertia of the valve mechanism. After activation, the power supply is significantly reduced. This lower level of power is sufficient to maintain the valve in its active state without the continuous application of high energy, allowing smaller and less expensive power supplies to be used or more valves to be activated simultaneously.

EQSP32 - Industrial IoT ESP32 PLC directly control the solenoid valves conserving energy by using the tailor made RELAY mode. In the RELAY mode, the system initially energizes the coil at full power and after the preset time the power drops to a sustain level.
Connecting and Powering Irrigation Valves

High Power Relay Integration for Pump Management

The system incorporates a high-capacity relay capable of switching three phases at 40A each, handling a maximum of 26kW. A smaller relay controls the common 24V for the valves, and another relay signals the well pump’s controller when the reservoir needs filling. All the relay coils are rated at 24V and are activated using the same high-efficiency, two-step PWM voltage steps described earlier for the valves.

Using Live Local Weather Data to Optimize Watering

The EQSP32 is an open architecture computer with a fully accessible Internet stack, allowing it to be easily programmed to make API calls to personal weather stations’ cloud servers. This capability to directly interact with weather data in real-time is unparalleled among micro PLCs in its size and price range, making the EQSP32 a standout choice for advanced irrigation management.

EQSP32 - Industrial IoT ESP32 PLC gets weather information from a personal weather station and adjusts the watering cycles accordingly.
Accessing Personal Weather System Data

In this application, the EQSP32 is programmed to monitor rainfall over the past 24 hours. If more than a predetermined amount of rain has fallen, the system will suspend watering to conserve water and prevent potential overwatering damage to plants. More complex watering strategies can be devised by incorporating additional weather parameters such as wind speed, air temperature, and humidity. For instance, on particularly windy days, the system might reduce watering to minimize water loss due to evaporation. Similarly, on hot, dry days, the system might increase watering to ensure plants receive adequate hydration.

Flow Meter Direct Interfacing

The flow meter uses a small propeller with magnets embedded at the tips of its blades, placed within the water flow path. As water flows and the propeller rotates, a Hall effect sensor detects the magnetic fields and generates pulses with each rotation. The frequency of these pulses correlates directly with the rate of flow; faster water flow results in a higher pulse frequency, ranging from a few Hz in low-flow scenarios to several hundred Hz during high-flow conditions.

The EQSP32 microcontroller, being an open and versatile platform, is uniquely suited for interfacing with such a flow meter. Fast repeating pulses can be measured very accurately with special code that takes advantage of its 240MHz processor.

End-to-End IoT Application Development

EQSP32 - Industrial IoT ESP32 PLC running the library background tasks and user application. EQConnect app allows device configuration for WiFi credentials and timezone settings. The custom mobile application monitors and controls the smart irrigation system.
Software Components

While the application may appear straightforward—essentially turning valves on and off at predetermined times—the backend integration needed to operate the system over the internet involves complex software elements that must work seamlessly together. Fortunately, the EQSP32 controller streamlines this process, making advanced technology accessible even to those with minimal technical expertise.

Central Role of EQSP32 in IoT Systems

The EQSP32 is a robust Micro PLC designed specifically for IoT applications. It simplifies the integration of necessary system components through pre-built software functions and modules that manage complex tasks behind the scenes. These include Wi-Fi connectivity, time synchronization, connection to a real-time cloud database, user management, and managing all the controller’s I/O and hardware resources. Erqos’ EQConnect smartphone app is provided for preparing the units for these steps. Freed from these tasks, users can focus solely on the code needed for the application.

Real-Time Database: The Epicenter of IoT Applications

In this and other IoT applications, the real-time database is a central element whose primary function is to synchronize data across all connected devices (in this case, the EQSP32s and the user’s smartphone) and the cloud instantaneously. This means that any change made in the system settings or operational commands from a user’s smartphone app (like setting the start time or adjusting the duration for each valve) is immediately reflected in the database, which the controller then almost instantly reads and executes.

The database also performs a storage function. All operational data, such as valve timings, duration, system status, water usage reports, and configurations, are stored securely in the database..

Master and Slaves

Multiple EQSP32 - Industrial IoT ESP32 PLC operating as a single system. One of the modules is setup in master mode and the additional modules appear as slaves. The slaves, instead of updating on their own root section of the database, they tap into the master's root and update their values there. This way the mobile application treats all devices as a single system.
Master-Slave Arrangement and Data Sharing

The diagram illustrates a system where multiple EQSP32 controllers are networked together, functioning collectively as a single cohesive unit. Each EQSP32 controller is assigned a specific role during the installation process—one as the Master and the others as Slaves. Despite running the same base code, these controllers execute different portions of it based on their assigned roles.

Data exchange among these controllers occurs through a centralized real-time database. The User App interfaces with this database, allowing users to monitor and control the system through a graphical interface. In the irrigation system, each EQSP32 controls its own set of relays and valves. All buttons are displayed in the same single app regardless of how they are distributed in the hardware..

AI-Assisted Coding

The EQSP32 is a computer in a PLC form factor. While it can be programmed using PLC languages like Ladder and SFC, a computer programming language such as C is preferred to harness its full power and capabilities. Fortunately, it is not necessary to be an expert in C to create applications like the one described here.

Erqos has trained an AI assistant that can generate code, provide guidance on hardware configurations, and offer solutions for integrating IoT functionality. The system has been trained with EQSP32 user guides, manuals, library documentation, and practical code examples that demonstrate how to utilize the library for different scenarios.

The Irrigation Code

The code running on the EQSP32 is detailed in the flow chart below. Notice how no user code is necessary for WiFi and database management. These critical activities are managed by the EQSP library and are initiated by a simple call to a function. Similarly, the exchange of commands and status information with the user smartphone app is handled by simple reads and writes to the real-time database using library calls.

Smart irrigation system software architecture diagram. Using EQSP32 industrial IoT controller to run the control loop for the smart irrigation iot system.
Irrigation Program Flow Chart

The irrigation program source code was almost entirely written by the EQ-AI code generator through careful prompting and supervision. Request the full source code at info@erqos.com.

Fast Smartphone App Development with ERQOS Templates

For developers looking to build or customize their own IoT applications, ERQOS offers templates that simplify the creation of smartphone apps compatible with both iPhone and Android platforms. These templates handle all aspects of internet connectivity, user login, and real-time data synchronization with the cloud database, significantly reducing the development time and complexity involved in creating functional and user-friendly apps.

A complete user interface can be built by duplicating, moving, resizing, and reshaping template components as shown in the screenshots below. Each button and field is automatically associated with its corresponding database element, requiring little to no adaptation.

Erqos drag and drop, no code custom mobile application development template. Demonstration of building components used for custom mobile application development.
Custom User Interface App Building

Conclusion

The use of EQSP32 IoT controllers in irrigation systems represents a leap forward in agricultural technology and home lawn care. By automating and optimizing irrigation based on real-time environmental data and enabling remote management, these systems offer a high level of control and efficiency.

Whether it’s maintaining the health of large farming operations or ensuring the aesthetic appeal of residential lawns, EQSP32-based irrigation systems provide a sophisticated, user-friendly solution that promotes sustainability and ease of use.

As IoT technologies continue to evolve, their potential to further enhance agricultural and residential irrigation practices promises even greater advances in efficient water management and plant care.

Add a Comment

Your email address will not be published. Required fields are marked *