IoT-based smart irrigation management system using real-time data

An adequate water supply is essential for the growth and development of crops. When rainfall is insufficient, irrigation is necessary to meet crop water needs. It is a crucial and strategic aspect of economic and social development. To combat climate change, there is a need to adopt irrigation management techniques that increase and stabilize agricultural production while saving water, using intelligent agricultural water technologies. Internet of things (IoT) based technologies can achieve optimal use of water resources. This article introduces a smart real-time irrigation management system based on the internet of things. It provides optimal management of irrigation decisions using real-time weather and soil moisture data, as well as data from precipitation forecasts. The proposed algo-rithm is developed in real-time based on the IoT, enabling us to guide irrigation and control the amount of water in agricultural applications. The system uses real-time data analysis of climate, soil, and crop data to provide flexible planning of the irrigation system’s use. A case study from the Fez-Meknes region in Morocco is presented to demonstrate the proposed system’s effectiveness. This is an open access article under the CC BY-SA license.


1.
INTRODUCTION One of the biggest challenges facing humans today is climate change.This change is caused by an increase in the earth's temperature at an unprecedented rate.It has had significant negative impacts on many countries around the world, particularly in developing countries that lack sufficient resources.It leads to an environmental shortage of water and exacerbates desertification [1].Whereas, in the agricultural sector, 85% of freshwater resources are consumed worldwide, and this percentage is expected to increase further due to population growth and increased food demand [2].As a result, there is a need to design more efficient technologies to ensure the optimal use of water resources for irrigation and adaptive management to changing environmental conditions.
In the absence of smart and cost-effective irrigation systems, developing countries consume more water than developed countries to achieve the same yield [3]. Smart water management for irrigation is essential to increase crop yields, reduce costs, and promote environmental sustainability [4] through effective monitoring and optimal control.This irrigation management focuses on the efficient use of water for each plant, precisely when and where it is required, and in appropriate quantities to offset water loss due to evapotranspiration, erosion, or deep percolation [5].

Int J Elec & Comp Eng ISSN: 2088-8708
❒ 7079 In the agricultural sector, internet of things (IoT) solutions take the form of sensors connected to the internet to collect measurement data.Their deployment allows informed decisions to be made.Using new IoT tools, these systems can continuously monitor soil and crop water needs in real-time from anywhere via a network of wireless sensor nodes while processing the collected data and storing it in cloud-based applications [4].These systems also allow farmers to choose between manual and automated options to take the necessary actions based on the collected data.
Several authors have analyzed the advantages of these intelligent irrigation management systems in the agricultural sector, such as [6], who reviewed the use of wireless sensor networks for irrigation purposes.This application aims to manage and control irrigation systems to promote the effective and sensible utilization of water resources.Nam et al. [7] discussed wireless sensor networks that use information and communication technologies (ICT) for the management of irrigation facilities based on radio frequency.Goap et al. [3] used the detection of soil parameters and meteorological data for the prediction of irrigation needs.Based on a database, Munir et al. [8] proposed a smart approach for plant irrigation based on daily water needs.To estimate the depth of water absorption, Liao et al. [9] designed an irrigation system based on real-time soil moisture data.By utilizing long-range wide-area networks (LoRaWAN) to connect devices, it is now possible to create IoT and cloud computing systems that are specifically tailored for use in agriculture.In this sense, Sanchez-Sutil and Cano-Ortega [10] has developed a control and monitoring system for irrigation systems that utilize LoRaWAN technology.
The optimal operation of an irrigation system requires the efficient development of control algorithms that allow flexible planning of the system's use according to the water needs.In this sense, knowledge of several pieces of information is necessary.Some information is acquired in real-time from a network of sensors (humidity, temperature, flow rate, and water level), while other information is fixed in advance (nature of the soil, culture, and network of conducts).We propose an intelligent system with an architecture based on wireless communication at all levels of the system using LoRa and Wi-Fi protocols.We have developed an IoT-based architecture to deploy smart irrigation management applications based on the analysis of real-time data such as climate data, soil data, and crop data, as well as the precipitation forecast for the day.It requires great flexibility to accommodate a range of deployment configurations that include a diverse mix of technologies.
The paper is structured as follows: section 1 provides an introduction.Section 2 discusses the proposed system and the methodology for irrigation management.A case study is described and explained in section 3. Finally, the conclusion is given in section 4.

MATERIALS AND METHODS 2.1. System design
The proposed system for irrigation management is illustrated in Figure 1, and it consists of four parts: IoT nodes, gateway, the things network server (TTN), and application server.The IoT nodes are wireless nodes that integrate weather stations, soil moisture sensors, and a pump.Their primary role is to collect data from the sensor layer elements and exchanging information with the gateway.This information is concentrated on the TTN server to exchange data with various IoT nodes.Message queuing telemetry transport (MQTT) is used to exchange messages between the cloud and the devices of the networks, which, in turn, communicate with the gateway [11], [12].The cloud server is mainly responsible for storing data and implementing the MQTT interface for the LoRa server and application.The application server is used to get the status of devices so that the irrigation system can be controlled and supervised.The IoT nodes used in the irrigation control system consist of: − Vantage Pro2 pro weather station [13], which is a station comprising an integrated suite of weather sensors and a data visualization console within a free space radio range of 300 m.It can measure wind (speed and direction), precipitation, temperature, humidity, atmospheric pressure, and solar radiation.The station is connected to a local server to publish and process local data using a Raspberry Pi. − Decagon ECH2O EC-5 soil moisture sensor that measures and monitors soil moisture to determine when to irrigate and how much water to apply.The EC-5 uses capacitance to measure the apparent dielectric constant of the surrounding medium [14] to determine volumetric water content.Its 70 MHz frequency minimizes salinity and textural effects, making this sensor accurate in almost any soil or above-ground environment.Sensor data is collected using a microcontroller board based on the ATmega2560, represented by an Arduino ADK.

❒ ISSN: 2088-8708
− Third node is the pump, which is controlled to water the field accordingly.This node is in serial communication with a microcontroller board to control the pump.
Figure 1.Proposed smart irrigation system architecture Each node is connected in series with a WisNode LoRa module, which is an Arduino Uno format development board.The end device (WisNode LoRa) and the main gateway, responsible for communication with the cloud, are two necessary components at the level of LoRa communication.The main gateway is a multi-channel LoRaWAN [15] module responsible for managing upstream and downstream messages sent in both directions between the IoT and TTN nodes.The TTN service is specifically designed to work with LoRaWAN TTN [10].It supports upstream and downstream messages to IoT nodes.From TTN, information is sent and received to the various IoT services via the available integrations.In this case, Node-Red was used, for which an algorithm for real-time irrigation management was developed.The information generated by the IoT nodes algorithm is stored in a DB browser for the SQLite database.

Methodology
Irrigation water management requires using the best estimate that current technology can provide to determine crop water use and field irrigation water requirements.This section provides a methodology to determine crop water needs,which includes the evaluation of crop water use, crop coefficients, climatic data, reference crop evapotranspiration, effective rainfall, irrigation efficiency, dose, and duration required to provide the necessary irrigation.
The crop irrigation needs refer to the amount of water and timing required to compensate for soil water deficits during the growing season for a particular crop.It mainly varies depending on climate factors (temperature, wind, humidity, solar radiation), soil factors (water table depth, soil moisture availability, texture, conductivity), crop factors (crop type, length of crop growing season, growth stage, rooting characteristics), and water factors (frequency of irrigation and quality of irrigation water).It can be expressed as (1) [16]: where IR n is the net irrigation requirements (mm day −1 ), ET c is the crop evapotranspiration (mm day −1 ), EP is the effective precipitation (mm day −1 ), GW is the groundwater contribution (mm day −1 ), and ∆SW is the soil water depleted during the season (mm day −1 ).Irrigation planning requires knowledge of the frequency and amount of rainfall.Effective precipitation is the fraction of precipitation that is available to the plant, and not all precipitation is effective, as some are lost by runoff, deep percolation, or evaporation.where EP is the effective precipitation (mm day −1 ), and P is the precipitation (mm day −1 ).The total amount of water lost through transpiration by the crop and evaporation from the soil surface is known as crop evapotranspiration (ET c ), which depends on the plant species, climate, and growth stage.It can be expressed as (3) [16]- [18]: where ET c is the crop evapotranspiration (mm day −1 ), K c is the crop coefficient, which is used to relate ET o to crop evapotranspiration ET c and depends on the crop characteristics, the time of planting or sowing, and the stages of crop development and ET o is the reference evapotranspiration(mm day −1 ).Evapotranspiration (ET o ) is a climate parameter that represents the amount of water transferred to the atmosphere by evaporation at ground level and by transpiration from plants.It can be calculated from meteorological data [16], but crop properties and soil factors do not influence transpiration because water is abundantly available at the reference evapotranspiration surface.ET o can be estimated using various methods, including empirical and scientifically derived methods.The appropriate method selection depends on the type, accuracy, and duration of available climatic data [19].Less precise reference evapotranspiration methods may provide adequate precision for long-term estimates.However, complex equations are needed for short-term estimates.The Penman-Monteith method is recommended as the only method for determining ET o .This method is more reliable for any longer period and works well for daily calculations and estimating monthly or seasonal water needs.It requires meteorological data on radiation, air temperature and humidity, and wind speed.Sometimes complete meteorological data is not available or not reliable for estimating transpiration using the Penman-Monteith method.In such cases, Food and Agriculture Organization of the United Nations (FAO) [20] recommends the Blaney-Criddle, Radiation, Modified Penman, and Pan Evaporation method as empirical methods for estimating ET o under different climatic conditions.In our proposed system, irrigation management requires real-time data.Thus, we computed the reference evapotranspiration in two cases: when meteorological data is available and when it is missing, using both Penman-Monteith and Blaney-Criddle methods.ET o can be expressed as follows using the FAO Penman-Monteith method [20]: where ET o(P M ) is the reference evapotranspiration with the Penman-Monteith method (mm day −1 ), R n is the net radiation at the crop surface (MJ m −2 day −1 ), G is the soil heat flux density (MJ m −2 day −1 ), δ is the slope vapor pressure curve (kPa • C −1 ), Γ is the psychrometric constant (kPa • C −1 ), T is the mean daily air temperature at 2 m height ( • C), u 2 is the wind speed at 2 m height (m s −1 ), v s is the saturation vapor pressure (kPa), v a is the actual vapor pressure (kPa), and (v s − v a ) is the saturation vapor pressure deficit (kPa).The Blaney-Criddle method to estimate ET o can be expressed as (5) [21], [22]: where ET o(BC) is the reference evapotranspiration with Blaney-Criddle method (mm day −1 ), p is the mean annual percentage of daytime hours, and T mean is the mean air temperature at 2 m height ( • C).To obtain the total water needs, irrigation losses are estimated.It is done by evaluating the total water requirement (IR) during the time stage, which is given by ( 6) [16]- [20]: where IR is the total water requirement (mm day −1 ), IR n is the net irrigation requirements (mm day −1 ), and I e is the irrigation efficiency.The irrigation efficiency depends on various factors, including the transpiration relationship, the sprinkler factor, the uniformity coefficient, and the salinity of the irrigation water.The next step is to determine the dose of watering, which is the amount of water brought to the crop during irrigation that fills the soil reservoir up to the field capacity.It is expressed as (7): IoT-based smart irrigation management system using real-time data (Asmae Hafian) where D w is the total irrigation dose (mm), H is the root depth (cm), C c is the field capacity (mm/cm), P m is the wilting point (mm/cm), f is the water availability in the soil, and I e is the irrigation efficiency.The irrigation duration (I D ) is the time required to provide the necessary irrigation dose.It depends on the flow rate (l/s), the amount of watering required (mm), and the area of the field to be irrigated (ha) and can be represented by ( 8): where I D is the irrigation duration (hrs), D w is the total irrigation dose (mm), S i is the area of the field to be irrigated (ha), and D is the flow rate (l/s).
Properly irrigating a crop requires making complex and frequent decisions that must be adjusted to the variability of water needs based on the climate and the plant's growth.This complexity can cause water stress due to a lack of water or air if too much water is added.Providing the plant with only the required amount of water at the appropriate time leads to increased plant vigor, optimal crop yields, better crop quality, plant resistance to disease, greater water utilization, and reduced irrigation costs.To enhance irrigation decision-making, Figure 2 illustrates a flowchart of the proposed real-time irrigation management and scheduling algorithm.The system executes this multi-step set of functions according to algorithm 1.When initiating the system, it requires three types of data: − Soil and crop characteristics extracted from a database; − Real-time weather and soil moisture data; − Daily rainfall forecast data.
After estimating the gross irrigation water requirements (IR), the system compares the received probability of rainfall with the minimum rainfall threshold that has been set.When there is a greater chance of rainfall, the system compares the humidity level to the specified minimum level (SM min ), which is controlled in the water comfort zone of the plant, between the field capacity and wilting point.This quantity varies depending on the type of soil.For loamy soils, they can absorb a greater amount of available water.The irrigation process should begin before the available water loss in the soil reaches (SM min ).If the rate is lower, the system updates the irrigation water requirements to minimize water expenditure.A crop's irrigation water needs depend on the rainfall and the soil's ability to absorb and return water.To proceed with the irrigation process, the system checks if the difference between crop evapotranspiration (ET c ) and effective precipitation (EP ) is greater than 0 (IR > 0).If not, it is not necessary to irrigate.
The proposed system operates in two modes: automatic and manual.In manual mode, the user decides based on information about soil moisture and predicted rainfall.In automatic mode, the user defines the initialization parameters (station, soil, and crop), and the system automatically programs when the plant needs to be irrigated.Additionally, the system can handle changes in predicted precipitation values.

RESULTS AND DISCUSSION
This section presents the tests carried out to validate the algorithm and the system proposed in this research.Figure 1 highlights a case study of the proposed IoT system in which a prototype was implemented for tomato cultivation in the Fez-Meknes region of Morocco, situated at latitude 33°53'36" North and longitude 5°32'50" West.Data was collected in real-time every 15 minutes from April until August.The crop coefficient K c for the tomato [23] used in the analysis is represented in Figure 3.According to [24], the soil texture in this region is loamy-clay.For soil moisture measurement, we installed Decagon's ECH2O EC-5 device in the prototype.Figure 5 represents the variation of the soil moisture sensor measured during the time phase.The pump was also installed in the area for irrigation management.We used node-RED [25] as the application for which we developed our real-time irrigation management algorithm as shown in Figure 6 calculate the actual daily evapotranspiration, we based ourselves on the two cases (presence and absence of the weather station).For this, we used the two FAO methods: Penman-Monteith and Blaney-Criddle.Figure 7 represents the variation of ET o during the time step with the Penman-Monteith method in Figure 7(a) and the Blaney-Criddle method in Figure 7(b).The collected data was analyzed and processed using the proposed algorithm in Figure 2. Table 2 shows the results, including reference evapotranspiration (ET o ), crop evapotranspiration (ET c ), net irrigation requirements (IR net ), total irrigation requirements (IR), and total irrigation dose (D w ).
Our system aims to achieve intelligent irrigation management, which aims to significantly reduce water consumption and maintain the appearance of green spaces compared to the projected green spaces based on real-time weather and soil data, as well as daily rainfall forecast data.The obtained results reveal that using an intelligent approach to make more accurate and smart decisions certainly helps to improve the results of an IoT-based system.The system automatically makes irrigation decisions based on a schedule that determines when the plant requires irrigation, the amount of water required, and the duration of irrigation.The program also manages climate change, including predicted rainfall.Before making the decision, it takes into account the rainfall forecasts and soil water availability, which ensures that irrigation is controlled within the water comfort zone for the plant, avoiding water stress.

CONCLUSION
This article presents an architecture for IoT-based intelligent irrigation management.This architecture is based on an algorithm that uses real-time weather and soil moisture data, also a rainfall forecast query that provides the ability to make the irrigation decision.The proposed system offers extensive opportunities to enhance system functionality and adaptation to the needs of each implementation.Also, its performance can be enhanced by incorporating new features through reprogramming.The proposed system is designed to meet the irrigation water needs of tomatoes grown near the site in the Fez-Meknes region.Our system offers the ability to monitor, analyze, and make irrigation decisions from anywhere while also reducing water consumption by accurately determining when and how much water the plant requires.

Figure 2 .
Figure 2. Flowchart diagram of the proposed architecture for smart irrigation management

Figure 5 .Figure 6 .Figure 7 .
Figure 5. Variation of the soil moisture during the time stage 13,No.6, December 2023: 7078-7088 Algorithm of irrigation management Data: RH, T , u2, Ra, bar, dailyR for the climatic data, daily weather forecast, Kc for the crop, soil humidity for the soil data, and dripper data; Result: irrigation requirement IR, irrigation dose Dw, and irrigation duration I D ;

Table 2 .
Algorithm results during the time stage