Automatic Irrigation System with Water Pumps and Sensor in the Junin Region Peru

. This project presented the design and implementation of an automatic irrigation system with water pumps and sensors, powered by a photovoltaic system, in a simulation programme (Proteus). This project is designed for a harvesting site located in the district of Huancan-Junin. The project showed that it is feasible to improve the irrigation system for people who focus on agriculture. In addition, a control system was implemented based on programming, simulations, and mathematical models. Where we can perform the respective tests for the development of the project. The results of this project will be used to improve an autonomous irrigation system with pumps and sensors. Also, it will be powered by a photovoltaic system in order to reduce the physical effort of farmers and give them a better quality of life.


Introduction
Nowadays for the whole world the agricultural activity is a good source of income for the country as well as for the farmers, therefore to elaborate the harvest of these natural foods, both the basic resource that is water and electric energy are used.Agriculture is essential for human survival.There are sectors that consume water, the largest of which is the agricultural sector, where about 70% of the population lives.[1].
Human life is impossible to sustain without agriculture.Agriculture is not only a source of food but also a supply [2].The project fully automates the irrigation system, and the use of inexpensive sensors and simple circuitry makes the project a low-cost product that even low-income farmers can afford [3].There are irrigation systems that are powered by electricity and have manual on/off programming.[4].
A good irrigation and drainage system is important to improve water use efficiency, produce high-quality water, and increase agricultural yields [8].Farmers aim to "produce more This solution can solve a big problem for farmers on the one hand and save time, water, and human resources on the other.To achieve this possibility, the solution will use different sensors (temperature, soil moisture, and air humidity) [5][6].However, less than 1% of the world's fresh water is available for human consumption, and about 70% is used for irrigation.[7].
* Corresponding author : 75077106@continental.edu.pe† Corresponding author : 72146052@continental.edu.pe‡ Corresponding author : 71908627@continental.edu.pe§ Corresponding author : mberaun@continental.edu.pe** Corresponding author : ccoaquira@continental.edu.pe† † Corresponding author : 732259176@continental.edu.peA good irrigation and drainage system is important to improve water use efficiency, produce high-quality water, and increase agricultural yields [8].Farmers aim to "produce more crops per drop of water", so they need to find irrigation methods that use less fresh water [9].Therefore, the problem can be solved by developing an effective irrigation system for various fields.[10].canbe solved by developing an effective irrigation system for various fields.[10].
This article details the electronic design and implementation of an irrigation system with an Arduino UNO microcontroller and PIC 16F84A for agriculture and moisture sensors with solar energy in order to better use water in a rational amount with optimal levels for development of various crops.

Materials and Methods
For the design of the irrigation system, the VDI 2221 uses the methodology, which was developed by "The Association of German Engineers" (Verein Deutscher Ingenieure, VDI) [13], which begins with the search for a solution to a problem or need.Among the most important steps is the development of a function diagram [14], where all the functions that must fulfil the desire and for each function of all the mechanisms are found, the use of electronic components, and electronic design [15], as shown in Fig. 1.The research was carried out in Huancan Fig. 2 and Fig. 3.The design parameters and evaluation of irrigation in food crops and the conditions under which it was carried out were determined.The experimental design used was for the Arduino Uno and PIC 16F84A.

Elektronik components
For the design of an electronic circuit, it is important to select the electronic components effectively and efficiently [16].Therefore, an exhaustive search for the implementation components on the Arduino UNO, which will be used for the detection of ambient temperature and soil moisture, was carried out.

Design electronic
The simulation of the electronic circuit is performed in PROTEUS software [17].Therefore, the simulation software provides the previously chosen components, resulting in the efficient implementation of the circuit together with the Arduino UNO microcontroller as shown in Fig. 5.

Fig 5. Circuit design in arduino UNO for temperature
The circuit shows a maximum temperature with the Arduino Uno design of 14 °C and a maximum humidity of 40%.In the first design with Arduino Uno, when our temperature-humidity 1 sensors are (41 and 14 °C), temperature-humidity 2 sensors are (41 and 14 °C), and temperature-humidity 3 sensors are (41 and 14 °C), our temperature sensors 1, 2, and 3 allow water to flow through the electric pumps, allowing to irrigate the crop.Finally, when our temperature-humidity 1 sensors are (39 and 12 °C), our temperature-humidity 2 sensors are (38 and 12 °C), and our temperature-humidity 3 sensors are (39 and 12 °C), our humidity 1, 2, and 3 sensors will allow water to flow through the electric pumps, allowing the crop to be irrigated.
Also, we have the circuit design with the implementation of a PIC 16F84A to control the operation of automated irrigation to reduce water losses caused by the inefficiency of control that the farmer has when irrigating his crops.Therefore, the need to implement the circuit as shown in Fig. 6.

Fig 6. Circuit design with control PIC 16F84A
The circuit shows the control of the irrigation system.Maximum temperatures in the design with PIC are 20 C, and the maximum humidity is 50%.In the second design of the controller with PIC 46F48A, our circuit requires the humidity sensor to be above 20 °C; our engines 3 and 4 start with its operation, while our temperature sensor has a potentiometer that must be greater than 50%; our engines 1 and 2 start with their operation.
Finally, we have the button that will help us turn off the system when there is a problem.

Results
This section presents the results obtained from the automated irrigation system implemented with an Arduino UNO with temperature and humidity sensors, as shown in As we can see in the results, our automatic system is working correctly as programmed.We define it by colours; a very clear example would be when our humidity sensors are 41% RH and our temperature is 14 °C (Yellow), our temperatures 1, 2, and 3 will be in operation and the humidity sensors 1, 2, and 3 will not be in operation.This is because we programmed it with restrictions, the water pumps of the temperature sensors will be kept in operation if it exceeds 13 °C, and if the humidity is below 40%, i.e. if the humidity is losing its humidity, the humidity sensors 1, 2, and 3 will come into action even though the temperature is at least 13 °C.
Likewise, the simulation results of the automatic irrigation system with PIC 16F48A are shown in

It is not in operation
As we can see in the results, our automatic system is working correctly as programmed.We define it by colours; a very clear example would be when our humidity sensors are at 50% RH and the temperature is 19 °C (Yellow), our humidity sensors 1, 2 will be in operation and the temperature sensors 1, 2 will not be in operation, this is because we programmed it with restrictions, the water pumps of the temperature sensors will be kept in operation if it exceeds 20 °C and the humidity sensors will only work when it is at 50% RH.
By performing the respective calculations of irrigation per area in the planting with our project, we can clearly see that we can accelerate the planting time using our automatic irrigation system to generate profits for farmers.Therefore, we present the data for the sowing.

Planting method with manual watering
Planting method with the automatic irrigation system As we can see in  The comparison that exists for both motors and relays, and we have as results that the average of both motors is different: the motor with Arduino yields an average of 8.76, and on the other hand, we have the motor with PIC, whose average gives us 11.8.We can also observe that for the relays, their averages vary, where for the Relay with Arduino, the average is 4.63, and on the other hand, for the Relay with PIC, the average is 2.87, as shown in As can be seen in the bar graph in Fig. 7, the red coloured bar represents the gain offered by the "Irrigation System with Arduino".On the other hand, the yellow bar represents the gain offered by the "Irrigation system with PIC".Thus, it is worth noting that the "Irrigation System with Arduino" is the best option for obtaining gains and automatic irrigation to reduce physical effort.

Discussion
In recent years, new ways have emerged to improve or automate an irrigation system for people who are engaged in agriculture, be efficient for the production of products correctly, and also be more feasible and economical to obtain.These technologies, for this reason, 2 circuits were made to help farmers to facilitate their work performance, a programming code was made in Arduino, not very complex but precise and easy to handle, it also has pump motors that drive water out with force according to the programming, this can work with solar panels because the voltage is 12v and 20v minimum, it has transformers, LDR that will work as a warning to turn off the circuit, it is an automatic irrigation system that detects temperatures high, for the circuit to work alone, the temperature is 13 °C, the operation will be activated, we also have humidity sensors, they work when the humidity is too high, and it will have to send a signal so that the circuit stops function.

Conclusion
The analysis and evaluation of the results obtained from the automatic irrigation system proposals, both with Arduino and with the photovoltaic system, have demonstrated their viability and notable advantages.The comparison of voltage generation between the relays reveals similarities, while in the case of motors, the Arduino Uno presents better energy performance, which translates into more efficient consumption and reduced operating costs.The choice to implement the automatic irrigation system with Arduino and a photovoltaic system emerges as the most solid option in terms of economy and long-term sustainability.The resulting economic benefits allow farmers to recoup their initial investment and maintain constant irrigation without physical concerns, contributing to increased agricultural productivity.On the financial side, the significant economy of the project stands out, especially due to the absence of amplifiers and potentiometers.This characteristic makes it possible to cover more than 20% of the total investment, which further underlines the economic viability of the system.
The projected useful life of the project, estimated at around 20 years and potentially extended with adequate monitoring and maintenance, highlights the durability and profitability of the investment.Different system components, from solar panels to relays and sensors, have different life cycles, which means periodic but manageable replacement.The inclusion of a backup switch for emergency situations, such as short circuits, guarantees safety in the operation of the project.Longterm profitability becomes evident by projecting around 17-18 years of free use for farmers, positioning the project as a highly beneficial option.In addition, the integration of the photovoltaic system not only offers financial advantages but also contributes to the reduction of CO2 pollution and care for the environment, thus highlighting its positive impact on global sustainability.
Ultimately, the automatic irrigation system project with Arduino and photovoltaic system has successfully passed the criteria of profitability, efficiency, and sustainability, which supports its approval and its potential to transform the way agricultural irrigation is approached, promoting both economic prosperity and environmental responsibility.

Fig 4 .
Fig 4. Maximum temperature data in the junin region

Fig 7 .
Fig 7. Percentages reduced by both systemsAs shown in TABLE XI, about the costs reduced by both systems, it can be seen that the "Irrigation System with Arduino" has more cost reduction than the "Irrigation System with PIC".Therefore, the "Irrigation System with Arduino" is more feasible and recommended.

Table 3 .
TABLE III and TABLE IV.Humidity measurement (HR%)

TABLE V and
TABLE VI.

Table 8
Comparative table of voltage of motors and relays in arduino and PIC 16F48A

Table 9 .
TABLE IX and TABLE X. Comparative table of motors by both methods source : self made

Table 10 .
Comparative chart of the relays by both methods TABLE XI, about the costs reduced by both systems, it can be seen that the "Irrigation System with Arduino" has more cost reduction than the "Irrigation System with PIC".Therefore, the "Irrigation System with Arduino" is more feasible and recommended.