PROPOSALS OF UNIVERSAL ALGORITHMS FOR THE AUTOMATION OF THE IRRIGATION PROCESS OF PLANT CROPS

The article presents the issues of water saving, declining freshwater re- sources in the world, and the problems of drought in the context of proper and effective irrigation of various types of crops. The use of mi- croprocessor irrigation management systems has a significant impact on the quality of the yield and the rational use of water. An example of the irrigation system construction scheme is presented. The system uses strain gauge soil moisture sensors, which can be used to determine the relative water demand of plants, depending on the growing substrate. Additional system security in the form of rainfall and wind speed sen- sors provide the necessary information for the correct operation of the irrigation system. Then, two universal algorithms were proposed to au- tomate the irrigation process of plant crops due to the way water is supplied to the plants. The first algorithm is designed for systems using drip lines - they are widely used in various types of crops where there is a need to precisely supply water to the plant, such systems are des- tined especially for crops grown undercover or for nursery crops. The second algorithm for sprinkler-based systems is mainly used in field crops and in mushroom farms. The presented algorithms can be used to design and implement intelligent irrigation systems, and after adding an additional module – for plant fertilization.


Introduction
For the effective cultivation of various types of plants, maintaining the correct soil moisture is essential. The use of an appropriate irrigation system is necessary to prevent overdrying of plants, and, in cases where intelligent irrigation systems are used, allows to adjust the amount of water supplied for the development phase of the cultivated plant, what leads to minimization of plants production costs through lower water consumption (Rzekanowski, 2009;Neugebauer et al., 2007).
New problems arise as the world's population grows and the availability of freshwater varies. An additional factor is the progressive degradation of water quality. It is estimated that society wastes about 25% of the world's freshwater resources (Jury and Vaux, 2007;Taft, 2015).
The agricultural sector is the largest contributor to freshwater consumption, accounting for around 85% of the global water use. As the population grows, so does the demand for food. It is estimated that due to the growing demand, food production in the next 50 years will have to face an increase in demand of up to 50%. The development of irrigation systems in a way that minimizes water consumption is one of the ways to meet the increasing demand for water and food (Jury and Vaux, 2007;Treder et al., 2011).
Another element influencing water scarcity is global warming. In agriculture, it has been especially felt over the last decade, mainly due to periodic droughts, which significantly influenced the number of harvested crops. Another factor is the progressive variability of climatic conditions, such as precipitation, the size and distribution of which over time, combined with the increasingly frequent occurrence of the so-called extreme weather phenomena, very often has a significant impact on the yield (Jury and Vaux, 2007;Stachowski et al., 2017) To improve the efficiency of plant cultivation, plantations should be equipped with intelligent soil moisture management systems. Currently for this purpose it is best to use programmable microprocessor systems. Such systems can be adapted in many ways -to a specific crop or existing devices as well as it can be supplemented with additional functionalities to minimize water consumption while obtaining the highest possible yield (Neugebauer et al., 2007;Taft, 2015;Stachowski et al., 2017).
In case of currently applied irrigation control systems, various types of deficiencies can be found, among which the following can be mentioned: -no use of substrate tensiometers, which is related with the lack of quick information on the parameters of the substrate, resulting in over-or under-irrigation; -in case of field crops, no use of wind speed sensors, which, for example, may result in drift of the water stream from sprinklers in heavy wind conditions; -no use of rainfall sensors, which may be associated with unjustified irrigation; -no implementation of a manual watering option that can be used in cases of system failures.
Thanks to the use of intelligent irrigation management systems, based on microprocessors, it is possible to adjust the water demand to a given crop and plant growth phase. As a result, water consumption can be significantly reduced and, at the same time, a prevention of delivering too much water to the plants is possible, thereby i.e., preventing the initiation of decay processes (Wachowicz, 2009;Prathyusha and Suman, 2012;Tarange et al., 2015;Al-Omary et al., 2018).
In the context of the above information, the aim of this study is formulated as the presentation of the design of a universal irrigation system, destined for the various types of crops, along with the proposal of algorithms designed for two basic types of irrigation systems, i.e., the systems based on drip lines and systems based on sprinklers.
These two methods can be used in field cultivation systems as well as in closed facilities such as greenhouses or mushroom farms (Wachowicz, 2009;Chwietczuk et al., 2020c).

Diagram of irrigation management system
The block diagram of the suggested universal, microprocessor-based irrigation system is shown in Fig. 1.

Figure 1. A block diagram of a microprocessor-based irrigation system
The main element of the system is a programmable microprocessor circuit. Depending on the size and complexity of the system, one can use one of the two popular systems that are available on the market, i.e., one of the Arduino or Raspberry Pi versions. The microprocessor system is responsible for the control of the entire watering process for a given crop; it also collects and analyses data from sensors so that irrigation is carried out in the most efficient way, i.e., with the lowest possible water consumption (Tarange et al., 2015;Al-Omary et al., 2018). The power supply system is used to properly power system components, i.e., depending on the needs of specific system elements. The actuator system is usually supplied with a voltage ranging from 5 to 9 VDC. The microprocessor system is used to supply elements such as exposure sensors, water pressure sensors, rainfall volume sensors and wind speed sensors. Systems for section watering and pump control system (in cases where own water intake is available), similarly to the water mains solenoid valve, are usually supplied with 24 VAC.
Additionally, the power supply system supplies power to the operator panel − 5 VDC (Prathyusha and Suman, 2012).
The own water pump control system is an additional option, it consists of a communication interface with an inverter or a contactor (depending on the power of the used pump), and a water pressure sensor (responsible for maintaining the optimal pressure of water supplying the irrigation system). In addition, this subsystem should be equipped with water level sensors in the well (to protect the pump against the so-called "dry running") and an interface transmitting information about the level of water in the well to the operator panel. The last element of this system is the solenoid valve responsible for supplying water to the irrigation system (Godwin Premi and Malakar, 2019).
The system watering a given section is responsible for the proper operation of the irrigation system, it should consist of at least two electronic soil tensiometers. During the operation of the system, the average soil moisture is calculated for a given section − the more sensors we use, the more accurate the information is obtained. The solenoid valve of a given watering section is responsible for starting the watering process. Additionally, the system is equipped with an emergency (manual) watering mode to be used in the event of a failure of the microprocessor system. The number of sections is determined according to the needs and technical documentation of the watering elements (Varble and Chávez, 2011;Nolz et al., 2013;Sharma et al., 2021).
The operator panel is responsible for the configuration of individual irrigation sections. During the operation of the irrigation system, it displays readings from sensors, information from irrigation systems, information about the current water consumption, as well as information about the water level in the well (additional option).
The water pressure sensor is connected to the microprocessor system − it is responsible for maintaining the recommended pressure in the system supplying a given section, in accordance with the technical documentation of the irrigation elements used. Information from the sensor is displayed on the operator panel.
The flow meter is responsible for monitoring the amount of used water, with an indication of the watering cycle. The microprocessor system counts the amount of water used on a given day, month, or year. This information is displayed on the operator panel.
The light sensor is responsible for the correct time of irrigation start. It can be activated only at night, to limit the evaporation of water from the irrigated area and to prevent the plants from experiencing temperature shocks when sprinklers are used.
The precipitation volume sensor has two functions. The first is to analyse whether there is rainfall at the moment, the second is to count the amount of rainfall on a given day (Chwietczuk et al., 2020a).
The wind speed sensor has a function that protects the system against activation of sprinklers if the wind conditions are unfavourable. This sensor prevents the system from being activated in cases when the wind reaches the threshold value, which would result in the drift of the water stream coming out of the sprinkler. In such a case, part of the plantation would not be watered, while the other part would be too watered, which could contribute to the start of the rotting process of a given part of the crop (Chwietczuk et al., 2020b). Additionally, the system can be used to distribute fertilizer by adding an additional dosing module (Mansou et al., 2019).

The principle of system operation
The irrigation system operation algorithms have been designed to consider the specificities of the final irrigation elements (executive elements). There are two categories of irrigation elements on the market, these are sprinklers and drip lines. Each of these elements has its own specific operating parameters. Based on the principles of operation of given irrigation elements, two irrigation algorithms have been created -one for each of them.

Figure 2. Irrigation system algorithm for drip lines
The first algorithm, presented in Fig. 2, should be used in irrigation systems using drip lines. Drip lines are applied for crops where water must be precisely supplied. They are used, among others, in tunnel crops, horticulture, nursery cultivation, as well as in many other crops, both professional and domestic (Prathyusha and Suman, 2012).
The algorithm for the drip lines in the first stage of work collects input data for the operation of a given section, in accordance with the operating characteristics of the irrigation elements and the optimal parameters of a given crop. In the presented algorithm, we set four input parameters: -duration of irrigation for the normal cycle − this parameter is set for a time ranging from 5 to 60 minutes − it depends on the operating characteristics of the drip line and the water demand of the crop (the normal cycle is a system operation mode during which there is no risk of the crop drying out); -watering duration for the overdrying cycle − this parameter is used to set the time in the range from 5 to 10 minutes. This parameter is used to quickly raise soil moisture over time when rainfall occurs, and soil moisture is below the alarm level (the overdrying cycle is a mode of operation when there is a risk of the crop dying off due to the lack of access to water); -threshold soil moisture − it is a percentage value of the minimum soil moisture recommended for optimal plant growth; the parameter is set in the range from 50 to 90% (value read from the tensiometer converted to percentage); -soil alarm moisture − it is the percentage of soil moisture below which the vegetation begins to die, this parameter is set in the range from 10 to 50% (value read from the tensiometer converted to percentage). The values of the set soil moisture should be reflected in the soil fp curve to provide the optimal amount of water for the plants and not to waste it (Varble and Chávez, 2011;Nolz et al., 2013).
After entering the input parameters, the system starts working. The first step is to check if it is night-time. If it is daytime, the system waits 30 minutes and checks again if it is night. If night is reported, the system waits 30 minutes for the watered substrate to cool down and, in consequence, to have less water evaporated from it. Afterwards, it reads the values from the sensors. If the soil moisture is not below the set threshold, the algorithm goes back to the beginning, otherwise it goes to the next stage. In the next step, the reading from the rain sensor is checked, if there is no rainfall, the algorithm starts the normal watering cycle and returns to the beginning when finished. If there is rainfall, the system checks if soil moisture is below the alarm level, if so, the watering process for the drying cycle begins and after its execution the algorithm returns to the parameter reading stage. However, if the alarm condition is not exceeded, the algorithm returns to the beginning of the irrigation system for the drip lines.
The second algorithm is presented in Fig. 3. It should be used in irrigation systems that use sprinklers. Sprinklers are most often employed in large-area crops, where we irrigate the entire surface of a given crop. Sprinklers can be used, among others, for irrigation of crops such as carrots or beets. They can also be used for production of grass in rolls and for watering home gardens (Rahman et al., 2014).

Figure 3. Irrigation system algorithm for sprinklers
In the first stage, this algorithm collects input data for operation of a given section, in accordance with the operating characteristics of the irrigation elements and the optimal parameters of a given crop. In the presented algorithm for a sprinkler irrigation system, the first four inputs are the same as for the drip lines. Only the operating time range for a given cycle has been changed. However, two additional parameters were added to this algorithm. They are the Wind Speed Threshold Value and the Maximum Wind Speed Threshold Value. For the first parameter, the reference value is from 1 to 10 m·s -1 , and for the second from 2 to 20 m·s -1 . The wind threshold is the maximum wind speed at which there is no change in maintaining the correct irrigation area. On the other hand, the maximum value is the speed at which irrigation with the sprinkler system becomes ineffective, i.e., there is a significant blow-off of the water stream, which is associated with large irrigation irregularity (i.e., there appear both highly irrigated areas and areas not watered at all).
After entering the input parameters, the system starts working. The first step, similarly to the algorithm for the drip line system, is to check if it is night-time and perform the same steps as before. Then the values from the sensors are read. If the soil moisture is not below the set threshold, the algorithm waits 90 minutes and returns to the beginning, otherwise it goes to the next stage. In the next step, readings from the rain sensor are being checked, if there is no rainfall, the algorithm checks if the wind speed is below the set threshold value and if so, it starts the normal watering cycle and returns to the beginning after its completion. If the threshold is exceeded, the system waits 30 minutes and goes back to the beginning. If there is precipitation, the system checks if the soil moisture is below the alarm level, if so, it checks if the maximum value of the wind speed has not been exceeded. If not, the watering process for the drying cycle is started and after its execution, the system returns to the stage of reading parameters from sensors. On the other hand, if the soil moisture content for the emergency state is not exceeded, the algorithm goes back to the beginning. In case the wind blows too much, the system returns to the beginning of the sprinkler irrigation system algorithm.

Summary
The article presents the microprocessor-based irrigation management system, designed for the purpose of various plant crops irrigation process automation. The use of such system allows to adjust the water demand to a given crop, as well as to the plant growth phase.
This design was supplemented with proposals of two control algorithms; the first one is intended for watering systems that use drip lines while the second one is for systems using sprinklers. The presented algorithms are universal and can be used in the design and implementation of intelligent irrigation systems, including the possibility of human operator influence on the process parameters.