Android based Solar Powered Automatic Irrigation System

Background/Objectives: India is an agriculture based country. Agriculture is the main source of food for any country and thus it is important to have a proper irrigation system. Due to global warming and many climate changes nowadays there is no fixed time of rain and the amount of rain so there is a great chance of the crops getting destroyed. Less rain leads to under irrigation and excessive rain leads to over irrigation and both these would result in yield reduction. In this paper we introduce a system which can control the irrigation according to the need. Methods/Statistical Analysis: In this paper we introduce a system which can control the irrigation according to the need. This system consists of temperature, moisture and PH sensors which will tell the user about the conditions of the field and according to it the user can control the system. This system is also automatic i.e. we can preset some certain values for the moisture and when the moisture goes below the threshold level the system will automatically switch on the pumps until the moisture level goes to the required. Findings: The system is powered by a renewable source of energy i.e. solar energy. This system is connected to the user by IOT (Internet Of Things) and user can check the status and control the system from the android mobile phone. There is also a LCD which displays the moisture, temperature and the pH of the soil. Application/Improvements: This system can be implemented in farms, parks, horticulture land and wherever there is a need for efficient irrigation system. This system supports aggressive water management for the agriculture land. The design is low power, low cost, small size, robust and highly versatile.


Introduction
Irrigation is a scientific process in which water is supplied to the land or soil for cultivation. Traditionally the dry area which has very low water content, people had to be supply water to the fields either through canals or hand pumps, tube wells. Conventional irrigation methods had faced problems such as problem of hard labor and which lead to problems of over-irrigation or under-irrigation.
A GSM based Automatic irrigation control system for efficient use of resources and crop planning by using an Android mobile is presented in 1 by Pavithra D. S. In this system the communication is based on SMS. The user communicates with the centralized unit and the centralized unit communicates with the system. SMS is received by GSM module and the information is sent to ARM7 which also receives some data from sensors and the result is displayed on the LCD. In 2 Hemant Ingale and N. N. Kasat presented an Automated solar based agriculture pumping. In this system solar energy is used to power the system. The AT89S51 microcontroller receives the information from temperature and humidity sensor and accordingly the pump is switched ON or OFF. In 3 C. Arun and K. Lakshmi Sudha presented an Agricultural Management using Wireless Sensor Networks-A Survey. The aim of the paper is to present different methods of agriculture management from remote areas. First method is about using different systems used in Green House Management using Wireless sensor networks. The second category is about the Irrigation Management using Wireless sensor networks. Finally they have also discussed about the Storage Management using Wireless Sensor Networks. Plant irrigation system was discussed in 4 . In 5 Hemant M. Sonawane and Dr. A. J. Patil have presented an Overview of automatic farming and Android system. They proposed a system in which a centralized microcontroller was used, which is programmed to receive the input signal of multiple sensors of the field. Once the controller receives this signal, it generates an output that drives a relay for operating the water pump and other circuitry which provides automatic control action on field. If the user sees the moisture level of ever cannel has sufficient amount then user can switch off the motor easily using GUI. In 6 Y. P. Patil and N. D. Pergad presented a GSM based Management of Irrigation System with the help of ARM7.
In 7 Zhang F., Yang M., Ying H. presented a paper on The application of GSM communication in agricultural automation. The concept of Android and microcontroller based system was discussed in 8 also it discussed the use of RFID which we are going to implement in our future work. Soil monitoring through Cloud IOT has also been presented in 9 . There are many systems developed for temperature and soil moisture for monitoring of soil. These are based on a feedback control mechanism regulating the water flow in real time.
In this paper for the first time we introduce the concept of pH monitoring of the soil and the concept of IOT (Internet Of Things). The system makes use of soil moisture sensor, temperature sensor and pH sensor the monitor the field and sends information to the ATmega8 microcontroller. The user and the system are connected through IOT and the information from the sensors is also uploaded on the server and the user can also control sys-tem through it. It reduces the cost of messages sent. The system is powered by solar energy. The user can control the system by IOT using an android mobile.

Methodology
The complete flowchart of the system is shown in Figure 1 which is shown in the end of the paper.
The system is powered by solar energy. Solar panels are used which covert sunlight into electric energy and it is stored in a rechargeable battery that powers the circuit. The rechargeable battery is of 12V 3A. The schematic circuit of irrigation system designed is shown in Figure 2. We use a microcontroller that works on 5v but the input power is much greater than this thus there is a need to reduce this power to a suitable level according to the microcontroller. To do this we use 7805 voltage regulator IC which can take input ranging from 7v to 25v but it gives the output as fixed 5v. we use a 100 micro farad capacitor with the IC which is also known as the compensating capacitor and a 470 micro farad capacitor is also connected to the output of the IC which prevents the microcontroller form the sudden hikes in the current level. This comprises of the powering circuit of the system and an input voltage of 5v is provided to the microcontroller. We use ATmega8 as microcontroller to control all the operations of the system.
ATmega8 comes in 28 pin package. Pin 1 is used as the reset pin and it is used to reset the system every time it is switched ON. It is important to reset the system because if it is not done then code will be executed from the place where it was left last time when the system was opera- tional and this may lead to improper functioning of the system. Reset circuit comprises of a switch and a 10 micro farad capacitor and a 10 kilo ohm resistance connected to Vcc. By default ATmega8 works with 1 MHz frequency. We can increase the operating frequency up-to 16 MHz in this system we increase the operating frequency to 8Mhz. we do this by using a crystal of this frequency. Now we know that whenever a frequency is produced its harmonics follows. So frequencies greater than 8 MHz are produced as harmonics which can confuse the system and also lead to its malfunctioning. Therefore to cancel out those harmonics we create a high pass filter by connection two 22 pF capacitors in parallel to each other which passes the high frequencies to the ground and thus only 8 MHz is supplied to the system. Pin 9 and pin 10 are used to connect the crystal. Pin 7 and pin 8 are Vcc and ground respectively. We use a 16*2 alphanumeric LCD to display the values of temperature, soil moisture, pH level of the soil. There is a potentiometer connected to the LCD which is used to adjust the brightness of the display. Pins 1 and 2 are ground and Vcc respectively. Pin 3 is the contrast pin which is connected to the 10 kilo ohm potentiometer. The R/W pin is connected to ground as we only need to write to the LCD. The enable pin is connected to PC5 (pin 28) of the microcontroller. Pins D0 to D7 are the data pins of the LCD. Since there only 28 pins in the microcontroller we need to make efficient use of t pins therefore pins D0 to D3 are connected to ground and pins D4 to D7 are connected to pins PD4 to PD7 of the chip. The 8 bit data is transferred to LCD in the following way, first the first 4 bits of the data are transferred then it is shifted serially and the next 4 bits of the data are transferred. The last 2 pins of LCD are connected to Vcc and ground.
The system and the user are connected through IOT (Internet Of Things) and by the use of IOT only we are controlling and monitoring the system remotely. To connect the system to the internet we have used a GPRS module. In this we have inserted a SIM with internet enabled and it connects the system to the IOT server. The information about the soil moisture, temperature and the pH level is uploaded on the server each time the system starts. The user can access the server from any location and can see the field conditions and also can control the system by giving commands through that server. The GPRS module is connected to the microcontroller pins 2 and 3.
Pin 23 of the microcontroller is connected to the soil moisture sensor and it receives the data from it. Pin 14 is connected to the motor pump which is triggered once when the soil moisture level goes below the threshold level and it irrigates the field.

IOT (Internet Of Things)
In this system with the use of IOT the central unit communicates with the user, tells the current information about the field and also takes commands from the user and accordingly performs the desired actions. Here we have used IOT for handling of data from a server, in which we can directly fetch the data in real time from the sensors used for the monitoring purpose.

Results
It is observed that whenever the value of soil moisture goes below the threshold level, the irrigation system starts working. Also the values of soil moisture and pH along with the message informing the user about the current status of the system i.e. whether it is ON or OFF is uploaded on the server and user can fetch the same from server. And with the help of this real time data we can predict the need of water or other necessary requirement for the irrigation purpose. Also the user can control the system by giving commands on the server as the system gives the server commands a greater priority than the automated commands. Figure 3 shows the welcome message displayed on LCD and in Figure 4 we can see that the current status of the value for different sensor and the data fetched by the microcontroller from the sensors.   In Figure 5 we can see the server and from this the user can control the system and monitor the status of the system. The hardware Prototype of our designed irrigation system is shown in Figure 6.

Conclusion
Irrigation is a very important part of any countries economy, especially for an agriculture based country. Water management and reduction in wastage of water is also of great importance as the water tables are getting depleted day by day. As the generation been evolved, man developed many ideas of irrigation for supplying water to the land. By continuously monitoring the field conditions by using sensors we can control the flow of water which helps us in saving water and providing proper amount to the crop. By making the system automatic we have reduced the manual intervention on the field and the labor to be done by the user. As system can be controlled by the user also therefore the system is also flexible according to the different situations. The system has incorporated IOT for remote monitoring and controlling the system which in turn also solves the problem of range and also reduces the cost of messages. By using the pH sensor we can monitor what type of water is entering the field and whether it is suitable for the crops or not and if not the system can be switched OFF remotely. This system also reduces the use of electricity as it is powered by solar energy.
This system can be implemented in farms, parks, horticulture land and wherever there is a need for efficient irrigation system. This system supports aggressive water management for the agriculture land. It is cheaper and efficient when compared to other type of automation system. The design is low power, low cost, small size, robust and highly versatile.