A Prototype of an Automatic Irrigation System for Peruvian Crop Fields

—Water is an important factor to sustain life and for such a reason it is necessary to take care of it since this is a limited resource. In Peruvian agriculture; however, there is a high percentage of water wasted, as this activity consumes 92% of fresh water; thus, making Peru the 37 th country worldwide in misusing water. Due to the aforementioned and considering that the agricultural sector is an important factor for the Peruvian economy, the current study aims to implement a system for automatic irrigation of crop ﬁelds in Peru, with the goal of optimizing the use of water and not to waste it as it usually happens. After the implementation of the ﬁrst prototype of the irrigation system using an Arduino microcontroller and low-cost electronic components, it could be observed that during the tests, 75 and 76.5% of the water that is normally used for irrigation was saved for a dry rainless and dry rainy patch of crop ﬁeld, respectively. The monitoring of the humidity of the soil was possible due to bluetooth communication. The presented results show the viability of the system and in a follow-up study, large- scale tests are expected.


I. INTRODUCTION
In Peru, the agricultural sector is quite important since great part of the Peruvian population works on this activity. According the Ministry of Agriculture and Irrigation (MI-NAGRI), there is more than 3 million people who work in family farming from a universe of 3.8 million Peruvian farmers [1]. Therefore, it is necessary to support agriculture since the country has several beneficial factors that allow it to develop. In addition, it is important to highlight that this activity depends on water, which is an essential factor to sustain life and the agricultural production. Unfortunately, in Peru it is not being given the proper use in the agricultural sector and that is not only a national concern but also a global one. It has been indicated that Peru is ranked in the 37 th place worldwide for mismanagement of water [2].
The traditional form of irrigation that is widely spread in Peru consist of basically flooding the earth with excessive water till this is visible to the farmers' eyes; bringing with it many negative consequences. According to a Peruvian exminister of agriculture, it has been indicated that the excess of water in Peruvian agriculture has caused the loss of crop fields in the last 20 years and fighting this has resulted very expensive [3]. Hence, poor water management in Peruvian agriculture is causing a lot of wasted water and a slow-paced damage to the national economy; and all this is extremely worrying as it reflects a lack of knowledge of an adequate irrigation process. The head of the National Water Authority in Peru has indicated that agriculture consumes the largest amount of water (80%) that is distributed in the country, unlike consumption in homes (10%), which still is very large when compared with international standards [4].
Automatic irrigation systems allow to use water more efficiently, unlike a non-technical system. For instance, a system developed by [5], consists of sensors that measure the water level and a sensor that gauge environmental quantities. Additionally, the system has a transceiver module that establishes a wireless communication to receive the data measured and together with a SIM card, the data are sent to a cloud server, and from there it is monitored by an Android application. The system was tested in the cultivation of strawberries and an optimally use of water was observed. In another study [6], which consists of an internet of things (IoT) system based on Raspberry Pi, it was possible to control the temperature sensors and soil moisture in a crop field. The data was stored in the cloud, and this was monitored by mobile or/and PC. The system allowed to observe constantly weather conditions of the crop field, thus optimizing the use of water. Another work [7] has used an Arduino microcontroller and different sensors to deal with different environmental factors. The authors in the study also implemented a website to display in real time values such as water flow, temperature and soil moisture. Further, the system had irrigation pumps and sprinkles which could be controlled by the implemented website. Overall, this system was very efficient for the water management and also of a very low cost.
In view of Peru's problematic with the misuse of water in the agricultural sector, this project shows the implementation of a prototype of an automatic irrigation system for crop fields. In Section II, the methodology will show the low-cost electronic components, the design of the irrigation system, a flowchart of this, the Android application and the prototype. In Section III, the results and discussion regarding the automatic irrigation system will be presented. Finally, in Section IV the conclusions are indicated.

A. Electronic Components
Because a low-cost automatic irrigation system is desired, the following most commercial electronic components for the design and implementation were selected: • Arduino Uno: This is a microcontroller to receive www.ijacsa.thesai.org the data the sensors are reading and to control the actuators that will be used.
• YL-69: This is a humidity sensor that will capture the value of moisture of the crop field. Its operation is that while the humidity increases, so does the current.
• Rain sensor: It is a sensor that when detecting rain, a motor is activated to close the roof of the crop field and to avoid excess of water.
• HC-05: This bluetooth module will allow the wireless communication between the Arduino microcontroller and the mobile phone to display the values of the sensors by using an Android application. The bluetooth module allows to connect to a mobile phone without worrying about cables or the nearby position of the devices. It has been indicated that the penetration of smartphones has been increasing in the Peruvian society in the past years [8]. Hence, these could help a lot in the new irrigation systems used in this nation.
• Mini water pump: This is an actuator that, by pumping water, will serve to keep the humidity at a precise and necessary level in the crop field.
• H Bridge: This is necessary to control the roof of the crop field since it allows us to control the DC electric motor direction. The motor turns on if rain is detected by the rain sensor, otherwise it will be off keeping the roof open.

B. Design
The automatic irrigation system is an alternative presented in this project to optimize the use of water and thus displace the traditional irrigation system that is used in almost all of the fields of cultivation across Peru. All this will be possible through a reliable and economical design, as shown in Fig. 1.
When the input signal or set point enters the Arduino microcontroller, this is compared to the reference value. This reference value depends on the type of crop, in this case for example, if the system needs to be tested in a crop field for strong avocado, according to the MINAGRI, it would have a reference value of 65-70% of humidity [9]. If the values are different, the microcontroller sends that signal to the actuator so that both values ares equal through means of irrigation. Being a closed loop system, the humidity sensor feeds back the system and according to the current humidity that is presented, it is compared again by the microcontroller. When the values are equal the microcontroller deactivates the actuator and the irrigation system stops working.
In Algorithm 1, the pseudocode of the main part of the program that operates the automatic irrigation system is shown. In this case, for the present project an ideal humidity range was considered, taking into account that the soil from the coast region in Peru is humid. Peru has three main natural regions, the coast, the highlands and the jungle [10].  The application in the smartphone is shown in Fig. 2. This app, which was developed using App Inventor, displays the humidity sensor values. App Inventor (https://appinventor.mit.edu/) is a platform that allows you to develop applications using internal block diagrams. The developed app allows visualizing the values that the sensors present. The connection between the app and the Arduino is possible by using bluetooh, which establishes a connection between the system and the smartphone.

III. RESULTS AND DISCUSSION
For the implementation of the prototype of the automatic irrigation system, main materials such as wood were used to build the sliding roof of the small-scale crop field (29 x 16 cm); the dimensions of the sliding roof are of a 15 x 14 cm. The whole circuit plus the crop field with the hovering roof can be seen in Fig. 3.
For the present project, a control test strategy was carried out in which four references (ref) were considered for the levels of humidity detected by the humidity sensor. Ref1 (between 0% and 1%) will indicate when the sensor is disconnected or does not detect soil moisture (between 0% and 1%). Ref2 (between 2% and 28%) indicates that it is necessary to carry out the irrigation by sending a signal to the actuator (the pump). Ref3 (between 29% and 50%) will indicate that the ground is in the humidity range optimum for the crop, so it will deactivate the actuator (the pump). Ref4 (between 51% and 100%) indicates if it exists an excess of water in the crop; in case it rains on the crop field, the sliding roof will be activated as shown in Fig. 4.
To obtain results that show the efficiency of the automatic irrigation system, four tests were carried out with the prototype. The amount of water used in all the tests was 2 Liters (L) considering a range of soil moisture between 29% and 50%, because this is the ideal humidity so that crops can grow in an optimal environment. Each test was performed every 4 hours. In addition, it must be taken into account that the soil of the coast is humid, so this humidity range was also accounted for. The first test was carried out with the automatic irrigation  system having dry and rainless land, the amount of water that was used was of 500 mL and the amount of water left (i.e., not used by the system) was 1.5 L, which represents 75% water saving. This whole irrigation process lasted an approximate time of 3 min and 5 sec. The second test used the automatic irrigation system with dry and rainy land, the water used by the system was 470 mL and the amount of water left was 1.53 L, which represents a 76.5% water saving taking this second test an approximate time of 3 min and 1 sec. The third test considered traditional irrigation with dry and rainless land, the amount of water used was 900 mL and the amount of water left was 1.1 L, which represents 55% of water saving, all this in an approximate duration time of 1 min and 9 sec. Finally, the fourth test was carried out considering a traditional irrigation system with dry land and with rain, the water used was 845 mL and the amount of remaining water was 1.16 L, which represents 57.8% of water saving in an approximate duration time of 1 min and 3 sec. The time needed for each test versus the amount of water used in each of these are shown Fig. 5. The automatic irrigation system is effective and reliable, since it allows the irrigation of a crop field to work without the need of a person to intervene. This is a key point because as it happens with traditional irrigation in Peru, the water is mismanaged, not only causing unnecessary losses of this resource but also damaging the soil where the crop will grow. What would have been something additional to this project is the placement of a temperature sensor like the DHT11, to know what temperature has the crop field and in this way to obtain both values such as temperature and humidity of the environment. Our results also go in agreement with other works of automatic irrigation systems [5], [6], [7], [11], [12], [13].

IV. CONCLUSIONS
The results of prototype of the automatic irrigation system were better than expected, since before starting the project an effectiveness in water saving of approximately 50% was sought. With the system, an effectiveness of water saving of 75 and 76.5% could be observed. It was seen that the humidity sensor had a good performance and also the wireless communication via bluetooth was possible between that sensors and the application in the smartphone. Hence, the proposed system is quite suitable for crop fields and in addition, also, of a very low cost.
As a future work, it is being considered the implementation of system with the transmission of the data through the internet, i.e. an IoT system, with the purpose that the user can know the humidity of the crop field, even when the farmer is far away, since the bluetooh module is short range which limits the range of movement of the farmer for monitoring. Moreover, the system is scalable and additional sensors to measure the environmental factors analyzed in this study can be added to the system in order that this system can be used in much larger crop fields