Electronic control of water resources using smart field irrigation systems

Received Sep 4, 2020 Revised Jan 12, 2021 Accepted Mar 12, 2021 Most of the research showed that the reason behind the agricultural lesions is the over usage of water in irrigation the matter which cause the appearance of fungicide on plants and salinity of the soil. From this point emerged the need for adapt some systems to work in farms in order to reduces the expenses of the product, improve its quality and lessen the consumption of water. Internet webs have been a preceding means in such a scope; and they also showed flexibility in designing such systems. In this paper; a smart irrigation system that depend on the values of moisture content and the agricultural constants (Feld Capacity, Wilt Point of the plant, Bulk Density, Depth of the root of the plant, the consumption of each water dripper and the passing area) in making the decision of irrigation and running the water pump, depending on the quantity of water to be added and the duration of irrigation time, and it is better. Field humidity levels at 0.32. This system was built by using the microcontroller ESP-32S&ESP8266 and moister sensor. The data was uploaded to Adafruit server for the sake of remote monitoring by MQTT protocol.


INTRODUCTION
Modern technology has significantly entered the agricultural sector through designing irrigation systems and green cities [1]. Hence, several problems arose, to which modern technology developed scientific solutions through monitoring and control. Among the most important of these problems are increasing the amount of irrigation, depleting lands, salinizing soil and the emergence of agricultural pests [2], [3]. The Internet of Things can be viewed through its elements that start from the physical layer in the TCP/IP model [4], [5], which includes the sensors, computer chips, microcontrollers, wired and wireless networks [6], [7], operating systems, and reaching at uploading and storing huge data on servers in the transport and application layers [8], [9].
This system was designed in accordance with the resolutions of the United Nations General Assembly for 2003, through linking between the sustainable goals and information and communication technology [10], [11]. It is widely known that data processing within cloud systems, data engines, and processors [12], which work on controlling and decision-making, depend on the data values obtained from physical sensors [13], [14]. The smart irrigation system downloads the moisture data collected from the sensors actually planted in the field through the customer unit that is directly linked with the physical sensors [15], [16], and then the data is collected and modeled in one of the best monitoring servers to make Int J Inf & Commun Technol ISSN: 2252-8776  Electronic control of water resources using smart field irrigation systems (Amera I. Badran) 117 the correct irrigation decision [17], and then the data was collected and modeled in one of the best servers for monitoring for making the right watering decision, by installing some agricultural constants as inputs for this system [18], [19]. In [20] a study was made about increasing productivity of the agricultural processes to improve crops yield and reduce expenses by using the technology of internet of things. The study aims at analyzing the applications of internet of things, when a general review of the data of sensors on the one hand and water and harvest management on the other, was provided. The researchers took the data of sensors from 60 research paper, which were published between 2016 and 2018, in order to take the most accurate decisions for doing the appropriate measurements. It is noticed that the researcher neglected the most effective impacts on the plant, which are the field capacity and wilt point, and measure the threshold value which has a relationship with irrigation process. While the current study depended on those factors in designing the proposed system. In [21] a smart frame for the monitoring platform and the environmental structure of the agricultural installations was made on the basis of internet of things. It was a motivation to transfer from classic agriculture to modern effective agriculture, and that is by monitoring the moisture content and temperature in controlling the water pump through internet. In comparison with this proposed system; agricultural constants were adopted as the basis of the work of this system through entering some important additional factors that sustain and improve the growth of the plant embodied in the depth of the root in the plant and the bulk density of the soil and finally the consumption of one emitter.
The main goal of the research is some scientific experiments to reach the best methods used in smart irrigation systems that rely on modern electronic systems to control irrigation processes. Smart systems were actually designed and tested, to track the results that are obtained from measuring the effects of modern technologies on controlling irrigation processes, and the increase of field productivity in terms of reducing effort and cost in production, as well as maintaining soil condition from salinization, that results from frequent irrigation, effectively. In addition to using smart control systems for irrigation and monitoring one of the most important biological effects of the plant, as well as measuring the quantities of water that must be added to the plants for the sake of keeping the sustainability of plant germination, along with preserving the water resources from drought due to water decrease consumption.

PROPSAL AND SOLUTION
This study was done by using the IoT to design the smart irrigation system. The highest levels of moderate moisture were achieved through the use of agricultural constants in design. One of the most common problems in electronic circuits that are used with large areas is the difficulty of supplying electrical energy to all parts of the field to feed the electronic circuits with the necessary energy. Each field contains a number of nodes that collect data. One of the most important problems in smart systems, is how to manage the great sum of data in real time, and control it in decision-making, as well as modelling it for monitoring purposes.

Design of smart irrigation system using nodeMCU
The client unit is considered the first brick in designing this system. Each field has a number of nodes that collect information from the field, and the field is also equipped with an electrical source separated from the system, so that each field becomes a complete unit that can work alone in measuring and collecting data and transferring it to the central controlling entity without depending on the systems of the dominant center. Each node is supplied by a Solar Cell power generation system, and a battery to store this energy and use it when needed or at night. The solar cell is connected with the unit through Battery Charger to take the needed energy for running during the day and on the battery during the night without the need for conventional electrical energy. As shown in Figure 1. The client unit also communicates with the central access point, then data is transferred from the access point to the gateway unit via the serial port. Finally, this data is modeled on cloud computing by using the Adafruit server via the Message Queuing Telemetry Transport (MQTT) protocol, as shown in Figure 2. The client unit provides good data management in modeling, displaying and storing the latest values obtained from the moisture sensor in a temporary store called the scattered values record, where it is used to know the last state of soil moisture, and we can also predict the state of moisture of the soil in the event when the connection with the Adafruit server is interrupted. The microcontroller ESP8266 NodeMCU predicts the value of the moisture state and this value is placed in a temporary record called the expected soil moisture record. At the start of operation, after each stop of the electronic circuit; the microcontroller ESP8266 NodeMCU depends on the last state present in the scattered value record, in predicting the value of the moisture state in terms of value with the time of recording this state. Then this value is compared with the current time, and by predicting the state of soil moisture the decision to operate the pump is taken if it is turn off or the contrary, if it is working to avoid soil drought or wasting water when restarting the irrigation system each time.
When the data reaches the access point unit it is placed in memory depending on the Node ID number. Then the access point unit starts to rearrange the data (framing & Boarder) in the form of a single frame that contains all data coming from each node, meaning that the data of each node will be within one frame. This frame is then sent to the gateway unit in one package in the form of a package, and from there it is uploaded to the Adafruit server and stored for monitoring and making the correct decision regarding irrigation processes. The design of the gateway unit is the heart of the irrigation system and the basic foundation on which the rest of the system rests. It is the main decision center and controls all nodes in the field. In addition, it is the engine that transfers data among the system's departments when working. It is the link between the Internet on the one hand and irrigation systems consisting of microcontrollers and sensors on the other. The gateway unit is designed by using the microcontroller ESP-32S NodeMCU, to connect the internet to the connected access points directly, with the nodes in the field to measure and transmit the soil moisture content. Initially, the gateway unit configures a special path by the internet to connect to the Adafruit server via the MQTT protocol. It also works to maintain this communication, to update the data temporarily taking into consideration that the design of this system works in real time. The data obtained from the nodes deployed at the ends and center of the field are scheduled via access points, then passed to the gateway unit, and placed in a specially prepared table in the gateway unit's EEPROM memory prepared for this purpose to benefit from it in making decisions or anticipating new values, as well as displaying them successively in a form 1.44 TFT colure screen. This unit prepares the work of the water pump, and operates it if requested, or depends on taking the appropriate decision. The gateway unit depends on an electrical connection, in the matter of power supply, independent from the node.

Quantities of rated drip irrigation based on soil constants
The modern farming method and modern irrigation technologies have contributed to a significant increase in crop production, and have enhanced the strength of many plants [22], [23]. The best example on this is smart irrigation systems and sustainable green cities, all of this is generally achieved by the virtue of modern technology which are applied in agricultural sector [24], [25]. This research was based on the topic of smart irrigation depending on agricultural constants [26], and calculating the quantities of water that are consumed by the plant accurately along with maintaining the percentage of moisture in the soil permanently throughout all seasons of the year [27]. The value of the quantity of the consumed water is calculated by (1) [28], [29].
A.W: Available water for drip irrigation. Mf.c.: Moisture field content (%). W.P: wilting point of a plant. The value of the available water obtained from the previous equation, can be relied on to calculate the threshold value after draining 50% of the prepared water (A.W * 0.5) [30]. The threshold value was calculated by (2) [31], [32].
Threshold value = M f.c − (A. W × 0.5) The value of the moisture content must not be less than the threshold value [33], and in case it is less than the threshold value [34], the depth of the water to be added to the IR field must be calculated, as (3) [35], [36].
IR: Irrigation needs or water depth to be added (cm). Mi: Moisture content of the soil at irrigation (%). PB: Bulk density of the soil (g /cm 3 ). D: Depth of soil (root zone to be irrigated) (cm). The volume of water to be added to the field was calculated from (4) [37], [38].
V: Volume of water to be added to the soil m 3 . A: Irrigated area m 2 Knowing that the total field area is denoted by the symbol A. To calculate the amount of water discharged from one emitter [39], [40], which is denoted by the symbol a by calculating the area of one emitter through the following relationship a = l x w, generally it is a constant value for most of the water sprinkler and is 1m2 [41], [42]. We will need to measure the number of water emitter in each dunum dividing the total square on the square of one emitter (A ÷ a). We work to calculate the emitter in one acre by dividing the total field area by the area total amount of water discharge in one dunum (L/h) through (5) [43], [44]. By dividing the total water discharge output in one dunum Q by 1000, we would have volume in cubic meters (m 3 /h) [45]. Finally, we work to calculate the time required for irrigation t measured per hour through (6) [46], [47].
Finally, after knowing the time required to irrigate the field (t), the pump is operated according to the time obtained, and in this way we ensure appropriate moisture content along the length of time for plant growth. After obtaining the value of the time required for irrigation t, the pump is watered in the field for a period of time equal to the value of t, and the values obtained on the Adafruit server are printed and scheduled for reference when needed, and to alert the supervisor in case of any malfunction in the smart irrigation system. The value of the spent water volume V is also calculated in the process of turning on and off the water pump in the field.
When the pump is running, the remaining time is stored by calculating the irrigation time in the EEPROM memory every 10 minutes, in order to avoid any emergency on the system such as a power shutdown. In case of any malfunction in the system during irrigation time, this system will restart, recalculate the remaining calculated time and stored in the memory to complete the irrigation process with an increase rate of up to 10 minutes only.

Physical connection for irrigation system using nodeMCU
The gateway unit has a two-way physical connection, because it works to connect the access point unit through the serial port on one hand, and the Internet on the other wirelessly. The data format is transmitted and transformed in the two directions; the gateway unit is designed by microcontroller ESP-32S NodeMCU, as is the case for the access point unit to increase the speed of the response of the connected nodes, in addition to increasing the number of General-purpose input/output (GPIO) type ports and having storage capacity. The gateway unit has an independent electrical connection from the nodes as shown in Figure 3. Some electronic parts are connected with the gateway unit assisting the work of the smart irrigation system, such as the 1.44 TFT color screen, which works according to the Inter-Integrated circuit (I 2 C) protocol to reduce the number of the used outlets, in addition to the water pump connected with it in case the irrigation decision is taken. The gateway unit also communicates with the access point unit through the serial port.

IRRIGATION DECISION BASED ON AGRICULTURAL CONSTANTS
This type of decision-making is considered the best and the most accurate one, due to its consideration of the type of field soil, and the depth of the roots of the plant D=6.0 in the soil that changes with the cultivated plant, in addition to the Field Capacity F.C=0.32 per field, the Wilting Point of the plant W.P=0.16, the bulk density PB=1.3, and the amount of discharge single emitter q=1.5, single station A, and finally soil moisture S-V. From what is mentioned above, the information is entered into the system, particularly in the gateway unit, so that the exact calculation of the moisture content of the soil is done, and accordingly the irrigation decision is made, as in Figure 4. This window contains the agricultural constants mentioned above. The gateway unit calculates the appropriate moisture content of the plant through the moisture content measured by the nodes, to produce IR depth of water to be added, and then calculates the time required for irrigation t by equations, and depending on the t value in making the appropriate irrigation decision. After the decision to irrigate is made using agricultural constants, the implementation role remains within the responsibility of the gateway unit. It turns the pump on or off and sends a signal to the Adafruit server. It also instructs the access point units to prepare to work and start monitoring again through the serial port with the presentation of data obtained at the last decision-making process. Figure 5 refers to the start of evaluating the work and receiving data of clients' nodes and all other nodes are working according to the indicator (W.N=5). It is observed here that the value of the flag: 1, which means that the water pump is working, and that is because the indicator of the value of moisture content is (soil: 23) less than the value of threshold value which is indicated as (ON T. Thr.: 24%). As for (Now Watering) indicator; which means that the station in the state of irrigation due to the reduction of the rate of moisture content. Finally; (M. ON for 3.17 H) means that the duration of operating time lasts 3.17 hour, and the system will keep on working until it reaches the field capacity value.

PERFORMANCE EVALUATION
The system was applied to a clay soil field, with a field capacity of 0.32, a wilt point of 0.16 and threshold value 24%. When the system was working, we got the soil moisture values gradually increasing with additional increase of irrigation water and within the limits of field capacity and wilt point. It is also noticed that the soil moisture has not decreased below the threshold value of this soil, due to continuous monitoring by the irrigation system, as shown in Figure 6. Most of the earlier smart systems in agriculture depend on putting forth a stable value within the systems, without taking into account the values of the soil elements in a single field such as field capacity, wilt point, plant root depth and Bulk Density. As for our proposed system, these constants were taken into consideration and relied mainly on determining the extent of the field's need for irrigation by applying these constants and calculating the threshold value and then calculating the required irrigation time for a single field to determine the ranges of moisture in the soil, without wasting water or reducing the product resulting from Increased irrigation.

CONCLUSION
Through what has been studied in this research for smart irrigation systems based on monitoring and decision making. This study made it possible to familiarize yourself with the existing systems in this field, study them and identify their strengths as well as their faults. This system is designed to operate automatically without human intervention. It also reduces the effort expended in the field, in addition to legalizing the quantities of water spent in the irrigation process, by raising the moisture content within the limits of field capacity 0.32 and the wilting point of plant 0.16, in addition to not dropping the moisture content values below the threshold value of 0.24. which reduces the depletion of the basic resources of the soil due to the large amounts of irrigation. The owner can also monitor the field, evaluate the condition of the field and then take the correct decision by the system from a distance. Finally, the owner can assess the performance of the work of the system, based on the field results of the plant and the extent to which the plant accepts the work of the irrigation system.