You are on page 1of 6

International Journal of Engineering Technology, Management and Applied Sciences

www.ijetmas.com June 2017, Volume 5, Issue 6, ISSN 2349-4476

Automated Irrigation System with Weather Forecast


Integration

Amarjit Malhotra1, Sumit Saini2, Vatsala Vasant Kale3


1
Assistant Professor, Department of Information Technology, NSIT (Delhi University)
2, 3
UG Student, Department of Information Technology, NSIT (Delhi University)

Abstract— The population of India has reached 130 user to have adequate knowledge of the crops or
crore and is still increasing. There lays a serious plants. This limited the system from being used by
problem ahead us in near future. Traditional methods everyone who is in the need of it. This was
will fail to supply food and the supply will be same but countered by built-in data in the system with a wide
demand will keep increasing. It is high time to equip variety of plants, crops ,vegetables enabling the
farmers with modern technology which will increase system to beeasily used by anyone with just
quality and quantity of yield. The main objective of this selecting the type of crop he or she is planting.
paper is to automate the irrigation process helping
farmers and the nation as a whole. Intruder attacks on
Since the system is meant to be self sufficient, it
fields are responsible for thrashing of huge amount of should not require the attention of the user too
crops. Also, It is seen that people often forget to water frequently and it should be able to inform the user if
their plants, let it be due to forgetfulness or due to the there is any kind of threat to the system like an
reason that they are away from home. The human intruder or animal damaging the crop. This self
involvement is minimized with the use of temperature and sufficiency was implemented in the system by
soil moisture sensor. The real time readings of sensors adding a infrared sensor which would detect any
are used by the microcontroller, which automates the kind of physical intrusion and immediately
whole irrigation process. informing the user through the E-mail notification.

I. INTRODUCTION II. SENSOR UNIT


Currently systems exist in this domain ranging from For developing an efficient system of
GSM-GSM system pair module to specifically plantationmanagement, the foremost input is the
tailored systems used for a particular type of crop or availability of accurate data. This data includes soil
vegetation. A lot of these systems use the concept of properties, agronomic data, physicochemical
a microcontroller overhead managing the system parameters, atmospheric data, etc, preferably on a
with slight variations depending on the specific day-to-day basis or even hourly basis. Normal
need catered by the project. However, it was noted laboratory analysis of these parameters and manual
that none of these systems were using the current decision-making take a long time even with the
technology to its maximum potential, that is most sophisticated analytical techniques.
extending the system with a forecasting unit in
order to foresee the future weather, this integration Resistance Humidity Detector (RHD) was used to
can help to reduce the risk of over irrigation or measure capacitance value of the soil and
wastage of water by surface run off which can corresponding moisture value were correlated. RHD
further ruin the crops. Also, depending on the was used since it is sensitive to even minute
temperature and humidity a crop may need more or changes in the resistance value of the soil even
less water than usually needed for its optimum when for a narrow span of difference and when
growth. This optimization can only be implemented moisture values were needed to be measured on an
by integrating a weather forecasting unit into the hourly basis.
system .Secondly, a lot of these systems require the Monitoring of physical and environmental

179 Amarjit Malhotra, Sumit Saini, Vatsala Vasant Kale


International Journal of Engineering Technology, Management and Applied Sciences

www.ijetmas.com June 2017, Volume 5, Issue 6, ISSN 2349-4476

parameters including soil moisture, relative processed and sent to the user.
humidity, air temperature, rainfall, vapor pressure It is a comprehensive system that integrates sensing
and sunshine hours is done through integrating the , wireless and processing technologies and is
sensor unit with the forecast unit. The forecast unit capable of sensing and gathering different physical
uses Yahoo API which is connected to the system parameters without loss in the sensing accuracy.
using NodeMCU, an open source IoT platform The parameters are processed and wirelessly
acting as a wifi-enabler to the system. NodeMCU is transmitted to a centralised data storage system
controlled by Arduino Uno which requests for through a gateway from where they may be
weather information from the server. This remotely accessed and analysed by the user.
information along with the Sensor readings is
arduino. Other wire of the sensor is connected to the
10-kilo ohm resistor which in turn is connected to
III. CONTROL UNIT
the 5v supply. The aim of using a 10-kilo ohm
Control Unit uses external instruments in the system resistor here is to reduce the range of the current, one
and facilitates the desired working of the system. is measuring across a given potential difference. It is
The system is controlled by the Arduino and Node a current limiting resistor. It increases the range of
MCU. The core component of the Arduino is the resistance that can be measured through sensor.
ATmega328P micro controller. The Arduino As in ohm's law, current and resistance are inversely
controls the water pump based on the reading from proportional.
the moisture sensor. Arduino starts working only
Voltage Divider
when it gets signal from node MCU. Node MCU
sends a notification after detecting change in plant’s A voltage divider involves applying a voltage source
surrounding through pir sensor. Node MCU sends across a series of two resistors. You may see it
the weather information of the plant's location to the drawn in a few different ways, but they should
user. It gets signals from the Blynk app and sends always be the same circuit. Let's call the resistor
them to Arduino. Node MCU also forwards the closest to the input voltage (Vin) R1, and the resistor
system status information to Blynk app. In this way, closest to ground R2. The voltage drop across R2 is
it provides a two-way communication channel called Vout, that’s the divided voltage our circuit
between the hardware and App. The circuit board exists to make. That’s all there is to the circuit! Vout
provides power to various components of the system. is our divided voltage. That’s what’ll end up being a
Node MCU’s core module component is esp8266 fraction of the input voltage.
which provides wireless communication capabilities. It turns out voltage is easy for microcontrollers, by
Node MCU uses different LEDs to show it’s current adding another resistor to the resistive sensors, we
status. Both Arduino and Node MCU can be can create a voltage divider. Once the output of the
programmed in arduino IDE which uses C++. Serial voltage divider is known, we can go back and
monitor is used to see the code being executed in calculate the resistance of the sensor.
Arduino or Node MCU.
The Moisture sensor measures the resistance of the
soil. It creates an electric potential between the soil
and then measures the current flowing through the
potential difference. Using ohm's law, it calculates In the above equation, R1 is the resistance of the soil
the resistance of the soil. But, even the soil with which is very high. R2 has to be very high compared
water in it has very high resistance. The resistance of to the R1 to get a good range of voltage for the
the soil is far higher than any other electric different resistances of the soil.
component resistance. So, 1 Mega resistor is Voltage Regulator
connected so that high resistance can be measured. As all the components in the circuit needs a 5v
One end of 1 Mega ohm resistor is connected to the source. It converts 12v from the adapter to output a
ground and other end to one of the sensor's wire. fixed voltage of 5v and fixed output current is 1.5
This same sensor wire gives the reading to the

180 Amarjit Malhotra, Sumit Saini, Vatsala Vasant Kale


International Journal of Engineering Technology, Management and Applied Sciences

www.ijetmas.com June 2017, Volume 5, Issue 6, ISSN 2349-4476

amp. It has three pins one for the ground, one for between each reading. Store these values in
12v input and one for 5v output. readings1 array and store the sum in the total1
Transistor variable.
The transistor acts as a switch for water pump. It has 3.1 Take the average, and save it in sensorValue1 =
one end connected to the ground, one to the total1 / numReadings.
arduino’s digital pin 6, and one to the ground of the 4. Read the value of input1 pin
water pump. Water pump is positive terminal is if( input1 == HIGH )
provided with 12v supply. As arduino cannot power
{
the water pump with its 5v .A transistor is used to do
it and to switch motor on or off through Arduino. if ( sensorValue1 < threshold )
Analog pin 1 is assigned the value A0. The aim of {
using this variable is to set the analog pin A0 as switch on the water pump by writing the high to
input pin. This pin reads the input from the moisture pump1
sensor. As it a analog pin it can read values from 0- indicate that motor is on to app by writing the high
1023, this would indicate moisture or water present to output2
in the soil. }
Input1 is assigned the value 3.Again, the aim of if(sensorValue1 > threshold1)
using this variable is to set the digital pin 3 as input
pin. This pin reads the input from the Blynk app. As {
it is a digital pin it can read either 0 or 1. Mcu would switch off the water pump by writing the low to
act as an intermediary between Arduino and app. pump1
indicate that motor is off to app by writing the low
to output2
}
}
else
{
keep the motor off by writing the low to pump1
keep indicating that motor is off to app by writing
the low to output2
}
give a delay of 500 milliseconds before reading
again
Fig. 1 Components Assembled The analogpin1 should be read after a delay of few
milliseconds so that there is some change in values.
IV. ALGORIHM Once average is calculated, a delay of about 500
1. Initialize the variables, analogPin1 = A0, input1 = milliseconds would help to give a different value
3, output2 =6, pump1 =9 sensorValue1 = 0, than that from the last calculated value. Pump
numReadings = 10 and total1 =0. section of algorithm is only entered when the user
allows so.
2. In setup, set pinmode for input1 as input and
pinmode of output2 as output and pumppin1 as Algorithm for Node MCU
output. 1 Initialization
2.1 Initialize the readings array with 0. 1.1 Set auth to token received from blynk app. Set
ssid and pass to wifi name and password. Set
3 In loop , read numReadings (10) consecuitive
moisture values, account in a delay of 5 milliseconds forecastApiKey to key received from server. Set

181 Amarjit Malhotra, Sumit Saini, Vatsala Vasant Kale


International Journal of Engineering Technology, Management and Applied Sciences

www.ijetmas.com June 2017, Volume 5, Issue 6, ISSN 2349-4476

latitide and longitude to the home location. Make a V. TESTING AND RESULTS
simple Timer object 'timer'. Make Testing the working of Sensors
2 Define weather_info function Moisture Sensor
2.1 write High to digital pin h, indicating through led Consistent readings of a home potted spinach plant
that weather message is being sent. were taken in order to:
2.2 Call updateWeatherData function on weather 1.Ensure the correct working of the sensors by
object to update class's object member variables. measuring the moisture value variation detected by
2.3 Use different getter functions and store the the sensors when the soil is subjected to adequate
returned data in the temp, humidity and other watering, minimal watering, excessive watering or
variables. no watering at all.
2.4 Add these variables into a string named toprint. 2.Collecting the data for one specific plant so as to
Use json like formatting. determine the corresponding optimum watering of
2.5 call email fucntion on blynk object. First the plant depending on its phase of growth, this data
parameter is sender's address, second is subject, third once stored into the system will free the user from
is body. Use toprint as third parameter. the hassle of knowing the exact amount a plant
needs, also it would widen the usage of the system to
2.6 write Lowto digital pin h, indicating through led
users who do not posses knowledge about
that weather message has been sent.
farming/gardening yet want to use the system.
3. In setup, use pinmode to set f, g as input pins and
Following is a graph showing temperature and
h, i as output pins.
Moisture variation of a plant throughout a day:
3.1 Connect to wifi using begin function on blynk
object.
3.2 Call weather_info function
3.3 Use timer object and call set interval function in
which first parameter is time interval and second
parameter is name of function to call.
4. In loop, add Blynk.run function and timer.run
function.
4.1 Read the digital pin f. If it is high then turn the
led of app on else turn it off. This indicates status of
water pump in app.
4.2 Set pir to 0.
4.3 Take 100 consecuitive pir sensor readings and
take their take.
4.4 Store this average in pir.
4.5 If this average reading is high then send intruder Fig. 1
attack mail to the user and swich on the led at pin i. Representation of moisture
Delay for 10 minutes to avoid spamming the user.
Soil having abundant water would have very high
What is required conductivity. As water level drops conductivity
The sysytem sends weather information around drops indicating a drop in the moisture level. Sensor
plants to user after a fixed interval. User can look up reads in 10 bits so range is 0 to 1024.
the information and decide whether to give water to Choosing Optimum time for watering
plants. Example, if it is going to rain in noon then
1.Adding water at night would mean waterlogging
there is no point of watering in morning. Also, it
for most part of the day. As there would be no
detects intrusion and sends notification to user.
sunlight to photosynthesize and use water.

182 Amarjit Malhotra, Sumit Saini, Vatsala Vasant Kale


International Journal of Engineering Technology, Management and Applied Sciences

www.ijetmas.com June 2017, Volume 5, Issue 6, ISSN 2349-4476

2.Adding water at noon means water would get hot A n E-Mail notification is sent to the user regarding
and this hot water on reaching roots would damage the current weather condition around the plants or
them. crops:
Working of the API and Notification Mechanism
System was tested for informing the user of the
current moisture levels and also for the working of
weather forecast information to be provided to the
user.

Fig. 3 Screenshot of Email Notification


Testing the Intruder Detection System
The system was tested for correct functioning of the
IR Sensor. System was checked both indoor and
outdoors. When the vicinity of the system was posed
with any kind of intruder, the system detected the
intrusion and sent a notification mail to the user

Fig.2 Application Interface showing the motor value


to be off since moisture value is above threshold
Fig 4 Screenshot of Intrusion Notification

183 Amarjit Malhotra, Sumit Saini, Vatsala Vasant Kale


International Journal of Engineering Technology, Management and Applied Sciences

www.ijetmas.com June 2017, Volume 5, Issue 6, ISSN 2349-4476

Then sink node sends the stored values to monitoring VII FUTURE WORK
station. On the basis of water level information, the Crops have always been threatened by pests which
switch is on/off. cause extreme harm and ultimately lead to complete
destruction of the farm. This leads to loss of not only
the crops but all the effort, time and money put in by
VI. CONCLUSION the farmers throughout the year. Any detection
We aimed at developing a system which would mechanism if developed to immediately alert the
tackle the inefficiency and hassle associated with a farmer if any part of his field is infected by pests
man-driven irrigation land or even a garden. While would be a much needed development in this sector.
trying to develop such a system it was a process of In today’s world, Humans have every facility,
learning and we kept on transitioning to a system technology, knowledge to shape the world better but
closer to what we envisioned. efforts are needed to be made to expand the horizons
The main aim of the project was to develop such a of knowledge and integrate the different domains to
system which would facilitate any farmer/gardener achieve bigger.
to provide the best possible nourishment to the crops
or plants and minimize any risk of overirrigation or VIII REFERENCES
underirrigation with the added benefit of saving [1]. Er.Sukhjit Singh; Er.Neha Sharma “Research Paper on Drip
water from being misused. Irrigation Management using wireless sensors”. In:
IRACST; ISSN: 2250-3501; Vol.2, No4, August 2012.
Also, we envisioned our system to be such that even
[2]. Karan Kansara; Vishal Zaveri; Shreyans Shah; Sandip
a layman should be able to make the use of the Delwadkar; Kaushal Jani “Sensor based Automated
system, this we achieved by feeding pre determined Irrigation System with IOT: A Technical Review”.
data to the system and letting the system decide [3]. Shiraz Pasha B.R.; Dr. B Yogesha; “Microcontroller
whether the plant or crop needs watering or not. Based Automated Irrigation System”. The
We also integrated an IR sensor to save the plants or International Journal Of Engineering And Science
crops from any possible damage by animals, this (IJES), Volume3, Issue 7, June 2014.
integration also helped the use to be at a greater [4]. Venkata Naga Rohit Gunturi, “Micro Controller
Based Automatic Plant Irrigation System”,
sense of peace while he or she is away from the
International Journal of Advancements in Research &
place where the system is situated. Technology, Volume 2,April-2013
[5]. Mahir Dursun and Semih Ozden, “A wireless
A Cost Efficient System application of drip irrigation automation supported by
soil moisture sensors”, Scientific Research and
In our study we saw some systems which were made Essays, Volume 6 , 4 April 2011.
on RaspberryPi as a platform, However the systems [6] Callaway, E.H. "Wireless sensor networks:
thus produced had high deployment cost and cost of architectures and protocols". Auerbach
maintenance increased every year. Following shows Publications: New York, NY, USA, 2004.
the cost effectiveness of the project: [7] Qingshan, S.; Ying, L.; Gareth, D.; Brown,
D."Wireless intelligent sensor networks for
refrigerated vehicle". In IEEE 6th Symposium on
Emerging Technologies Mobile and Wireless
Communication, Shanghai, China, 2004.
[8] Mahir Dursun and Semih Ozden, "A wireless
application of drip irrigation automation supported by
soil moisture sensors", Scientific Research and
Essays Vol. 6(7), pp. 1573-1582, 4 April,
2011.Available online at http://www. Academic
journals.org/ SRE ISSN 1992-2248 ©2011 Academic
Journals.
[9] Baggio A (2005). "Wireless sensor networks in
precision agriculture". In: On-line Proc. of the
Workshop on Real-World Wireless Sensor Networks, pp.

184 Amarjit Malhotra, Sumit Saini, Vatsala Vasant Kale

You might also like