Automated Irrigation System

One of the various problems faced by farmers in their day to day farming activities is the constant need to watch overirrigation. Many times, the farmer must travel several kilometres to reach their fields and irrigation pumps. Hence, a huge amount of time and effort is expended daily in a farmer’s life to irrigate the field when this time could be made use by the farmer at other farms such as animal husbandries which requires much more continuous observation and care. Through this paper, a project is proposed where a system is created to completely automate the process of irrigation such that none to minimal human intervention is required. The aim is to set up a wireless sensor network in the field which will collect data about the moisture in the soil and send information to start the water pump if the level goes below the threshold. Keywords— Wireless sensor network, Automated irrigation, Moisture sensor, Sensor node, Sink node.


I. INTRODUCTION
Irrigation is a very important element of farming practice all over the world and there is no doubt that the farmer is well accustomed to the amount of water that will be required for irrigating a particular crop in a particular soil type. But, many times, the farmer must travel great distances to reach his field daily through dangerous paths and in all weather conditions. All this the farmer must go through just to ON a pump sometimes.
These trips can become double or triple in case of adverse weather conditions such as extreme heat which will not only affect the field but also take a heavy toll on the farmer, mentally and physically. In such conditions, the improper watering to the crop may destroy the crop which could be irreversible. On the other hand, in monsoon or winter season, irrigation in consecutive days may not be necessary and on these days, the farmer might just have to travel to the field to just inspect the crop floor.
The farmer loses a lot of time to travel to the field for inspection of moisture of soil or to just turn on the pump. This time could be used by the farmer to learn new agricultural techniques or spend that time caring for livestock and poultry. Also, in much larger crops, the conditions of the field across the area is uneven. The improper inspection of the crop and the understanding of the amount of water necessary to each part may result in disadvantageous crop yield with unequal production from these different parts.
This paper aims to present a system which can relieve the farmer from continuous and constant inspection of the field, that is to say, reduce the human involvement in irrigation. It would not only help the farmer by easing his job of irrigating the field but will also ensure good quality yield. Due to the precise sensing of the sensors, wastage of water will be prevented, which is a growing concern all over the world especially in India. Through the proposed system, the farmer will not have to monitor the field as irrigation happens automatically as and when required. A wireless sensor network will be used to set up the network and do the job. The wireless network that has been spread over the field successfully establishes communication between various nodes in the field and the decisions are hence made upon the parameters that are to be determined by the soil and crop type.
Section II of this paper constitutes a methodology where the two parts of the proposed project will be defined. Section III includes basic block diagrams to visualize the system design. Section IV explains the process of implementation of the proposed project. Some basic connections between the various components will be a part of this section. Section V will include the various components that were used in the making of the system along with each of the component's short descriptions. Section VI will give the result of the project. Section VII will list some applications of the project. Finally, Section VIII will give a conclusion to this paper on our project followed by Acknowledgements and References that have been used in the paper.

II. METHODOLOGY
The proposed system is to set up a smart network over the entire field including the source of water and the pumping. The system will ensure two situations, one when the moisture content of the field is below a threshold it will command the motor pump to turn on the pump to water to that particular part of the field. Second, when the required moisture is reached, another command will be sent to turn off the pump and hence cutting the water source to the field. The system will also be able to do because of the following functionalities: • While the water is being supplied, the sensor node of that particular part of the field waits for a certain duration of time, then continues to check the moisture of the same part again as a cross-check before moving onto next. • When the desired level of moisture is achieved by the field, another message is sent to the sink node to stop the water supply. • Then, the control moves to the next part of the field. • In this manner, the entire field is swept once and the NodeMCU goes to Sleep Mode, hence by doing this, power saving is also achieved.
A. Sensor nodes These are the primary nodes. They are spread across the field strategically to retrieve the optimum readings to on and off the pump which irrigates that part of the field. Generally, they are to be placed at equal distances throughout the area of the field. The only job of a sensor node is to measure the moisture content/level of the soil. The token passing protocol will be implemented in the network where the token will be passed among the number of sensors spread across the field which will each take control to decide the operation of the pump. No two nodes will be measuring the moisture at the same time. This also helps in conserving power.

B. Sink Node
From time and period, sink nodes get information from sensor nodes. When this data matches with the required lower value to start the pump, the water pump kicks in. The sink node identifies which node sent the message and supplies water to only that part of the field which is being monitored by the respective node. Figure 1 is a basic block diagram that shows how the information flow will happen in the field. For simplicity, it has been shown with a single sensor node. From its respective part of the field, the sensor node will collect information. If it is decided by the system that water is to be supplied to that part of the field, then the necessary information is transferred wirelessly to the sink node. This sink node starts the water pump and water is supplied.  Figure 2 is a basic block diagram that shows the placement of moisture sensors across the field where each of these is connected to the combinational logic circuit which is coded and decides which sensor will be operating at any time or if at all. The combinational circuit also provides information to the higher circuit about the position and value which then decides whether the value is below the threshold to pass the water to that specific position of the sensor.

B. Supplying water to the field
The primary NodeMCU (shown in Fig. 2) does a simple yes or no operation on the information that it has obtained from the moisture sensors to decide whether the water needs to be pushed towards that direction in the field. If the final answer renders to be 'no', the control goes to the next moisture. If it is 'true', the value along with the position is sent to the secondary NodeMCU(shown in Fig. 3). Secondary NodeMCU is powered by an external power supply. The power output from the secondary NodeMCU powers the rest of the components in this part. Hence, the motor driver drives the motor to which the pump creates enough vacuum to draw the water from the water source. The combinational logic circuit in this part of the circuit decides to which part the water drawn needs to be pushed, the position is available to the combinational circuit from the secondary NodeMCU. The combinational logic circuit gives power to that solenoid valve which opens and hence the water flows to only that part of the field. Like this, an entire circle is complete, starting from measuring the values to the flow of water to that part of the field. IV. IMPLEMENTATION When the system wakes up from the sleep mode or has been powered on, the moisture sensor that has been placed at the first position is turned on, and it measures the moisture content and similarly, all the moisture sensors in the same row measure the moisture between their probes, when the entire row is complete, the primary NodeMCU calculates the average of the entire row values and label it as the value of the row. In this manner, two profits are possible, one, it is a known fact that an average is the closest value to the real value. Two, this conserves power, instead of powering on and powering off the motor and pump for each moisture sensor, if the entire row is calculated all together, the row can be watered together and hence save power and increase the battery and component life.
If the value of moisture falls short of the threshold, the value and the position of the row is sent to the secondary NodeMCU. From the data that it has acquired from the primary NodeMCU, secondary NodeMCU signals the motor turn on and power the peristaltic pump, the water is drawn into the pipes and through the combinational logic circuit, the position at which the water is to supplied is determined and corresponding solenoid valve is powered. When powered the valve opens and hence allows water to flow through that pipe only. In this manner, only that part of the field is watered where the moisture value was found to be lower than the threshold value.
In a case, where the moisture level was satisfactory when compared to the threshold value, the control through the combinational logic circuit moves on to the next row, where the entire process is repeated. The time the NodeMCU takes to switch to the next row can be set by the user and it can also be decided by the programmer after taking the due measurements of the field.
When the entire field has been swept through once, both primary NodeMCU and the secondary NodeMCU enter into sleep mode where they would be conserving the power and hence increasing the life of the battery, if used. Once awake, the process from the first row begins again.
It must be noted that when the system is being operated for the first time, each sensor node will have to be powered manually. Only after the first sensor node has completed its operation and has entered deep sleep mode will the second node be powered on and so on. This way even after they come out of their sleep modes, no two nodes will be functioning at the same time.

V. COMPONENTS USED & DESCRIPTION
Every component works under the commands of the microprocessor which is the NodeMCU to get the desired results. Every component that has been used in the system has been described in the following: NodeMCU stands for Node MicroController Unit. It is inexpensive and an open-source IoT platform. It consists of an inbuilt ESP8266 WiFi chip along with the analog pin, digital pins, and serial communication protocols which allows an easy hardware development environment with System-on-a-Chip (SoC). NodeMCU is the backbone of the project that is being defined in the paper, and all the components commands and controls start from this.

B. IC 74139
An active-low enable with dual 2-to-4-line decoder/demultiplexer. Each decoder can be wired independently and produces low output for the selected line. This is used to find one among the different parts of the field that has a requirement of irrigation as well as to send through water and active solenoid valves of that particular part of the field only.

C. IC 7404
It has six independent NOT gates in one package. The use of demultiplexer IC 74139 along with IC 7404 allows to connect multiple sensors to the nodeMCU. To convert active low signals from IC 74139 to high, they are connected to not gate IC 7404.

D. CD 4051
It is an 8 channel multiplexer and the three select lines choose one of the eight inputs and connect it forward to the output. Voltage to this logic circuit is provided through the nodeMCU itself.

E. Moisture sensor
The soil moisture sensor is a capacitor type, that is, the soil moisture sensor uses capacitance to measure dielectric permittivity of the surrounding medium. When the soil has a low moisture content, the module output is at a high level, we can imagine it as the resistance that is being offered by the soil moisture sensor surrounding is high. The output is at a low level when the area between the two capacitor plates has enough moisture, which can also be read as low resistance. In soil, dielectric permittivity is a function of the water content. The sensor creates a voltage proportional to the dielectric permittivity, and therefore the water content of the soil. The module also contains a potentiometer, which will set the threshold value. This threshold value will be compared by the LM393 comparator. Here, the two probes of the sensor measure the dielectric permittivity between them and convert that into a voltage value, hence a radius of measurement around the sensor cannot be decided.

F. L293D Motor Driver
L293D is a Motor Driver IC. The IC allows the DC motor to drive in either direction. It is a 16-pin IC that can control a set of two DC motors simultaneously in any direction. It is directly controlled by NodeMCU.

G. Peristaltic Pump
The peristaltic pump has a 'clover' pattern of rollers inside it. The clovers press on the tube which pushes the fluid forward. The voltage applied to the pump decides the revolution rate of the motor and the pressure with which the fluid will be pushed through. The nodeMCU drives the peristaltic pump. The pump is geared with a DC motor.

H. Solenoid Valve
The solenoid valve is normally closed. It requires 12V DC to completely open. Therefore, the degree of opening can be decided by the voltage supplied to it. It is connected to the pipes in the project, which direct the water to a part of the field. To select which valve has to be opened, a logical circuit has to be used which is again a combination of Demultiplexer IC 74139 and IC 7404 as defined and stated earlier.

VI. RESULT
The prototype manages to start the moment with less to no human intervention the moment power is supplied. As soon as the system starts, the moisture sensor at the first index lights up which indicates that, through the combinational logic circuit, power has been supplied to this moisture sensor and it is in measuring mode. In this manner, all the sensors in a single row get the moisture level and sequentially send it to the primary NodeMCU when the power is with them. While testing the prototype, this was observed on the computer screen. And, thereafter, as per the value of moisture in that part of the field and the threshold decided, the corresponding part of the field was watered or skipped if the respective value is below or above the threshold. The secondary NodeMCU along with the combinational logic circuit was able to water the field by running the motor and pump as well as opening the valve of solenoid valves of that particular part of the field where water supply is required. After circuiting the entire field once, the NodeMCU switched to Deep-sleep mode and therefore conserving the power.

VII. APPLICATIONS
Some of the applications of the project are listed below: • It can be used to measure the loss of moisture in the soil over time due to evaporation and intake. • Minimizes water waste and improves plant growth and the circuit is designed to work automatically and hence, there is no need for very less human intervention. • The same system or in general the same idea can be used along with sensors of temperature (DHT11 or LM35), solar exposure, pH value and mineral content of the soil in the field for example in fertilizer spraying for plants: the use of sensors which measure the number of different minerals in the soils will indicate which are deficient in the soil such as magnesium. • It can be implemented in the process of spraying of pesticides.

VIII. CONCLUSION
Using an automated irrigation system reduces the farmer's presence for irrigation which is the major part of the practice of farming and optimises the usage of water by reducing the wastage of water. The proposed controller eliminates the manual switching mechanism used by the farmers. The system can also be designed for temperature sensor-based cooling systems for temperature-sensitive plants. The use of this system will be able to contribute to the socioeconomic development of the nation. It is a fast response and a user-friendly system. The accurate measurement and watering improve yield obtained because of the accuracy of nutrients provided(through water) to field as a balanced diet for plants at various levels of their growth(seed germination, sapling, fullfledged plant, etc). This can be an industrial revolution for the methods of farming irrigation.

IX. ACKNOWLEDGEMENT
We wish to give our deep sense of gratitude and heartfelt thanks to our project mentor and Head of Department Mrs. Shoba Krishnan of Electronics & Telecommunication, VESIT, Mumbai for being the constant source of encouragement from a selection of the topic to implementation and further. We would also like to extend our thankfulness to the staff of our Telecommunication department for providing all the lab facilities.