Final Report
Final Report
ABSTRACT
Automation of farm activities can transform agricultural domain from being manual and
static to intelligent and dynamic leading to higher production with lesser human supervision. This
paper proposes an automated irrigation system which monitors and maintains the desired soil
moisture content via automatic watering. Microcontroller ATMEGA328P on arduino uno platform is
used to implement the control unit. The setup uses soil moisture sensors which measure the exact
moisture level in soil. This value enables the system to use appropriate quantity of water which
avoids over/under irrigation. IOT is used to keep the farmers updated about the status of sprinklers.
Information from the sensors is regularly updated on a webpage using GSM-GPRS SIM900A
modem through which a farmer can check whether the water sprinklers are ON/OFF at any given
time. Also, the sensor readings are transmitted to a Thing speak channel to generate graphs for
analysis.
INTRODUCTION
Agriculture is the unquestionably the largest livelihood provider in India. With rising
population, there is a need for increased agricultural production. In order to support greater
production in farms, the requirement of the amount of fresh water used in irrigation also rises.
Currently, agriculture accounts 83% of the total water consumption in India. Unplanned use of water
inadvertently results in wastage of water. This suggests that there is an urgent need to develop
Over the past 15 years, farmers started using computers and software systems to organize
their financial data and keep track of their transactions with third parties and also monitor their crops
more effectively. In the Internet era, where information plays a key role in people's lives, agriculture
is rapidly becoming a very data intensive industry where farmers need to collect and evaluate a huge
amount of information from a diverse number of devices (eg., sensors, faming machinery etc.) in
With the advent of open source Arduino boards along with cheap moisture sensors, it is
viable to create devices that can monitor the soil moisture content and accordingly irrigating the
fields or the landscape as an when needed. The proposed system makes use of microcontroller
ATMEGA328P on arduino uno platform and IOT which enable farmers to remotely monitor the
status of sprinklers installed on the farm by knowing the sensor values thereby, making the farmers'
LITERATURE REVIEW
In A Remote Measurement and Control System for Greenhouse Based on GSM-SMS [4] the
proposed system introduced a GSM-SMS remote measurement and control system for greenhouse
based on PC-based database system connected with base station. Base station is developed by using a
microcontroller, GSM module, sensors and actuators. In practical operation, the central station
receives and sends messages through GSM module. Criterion value of parameters to be measured in
every base station is set by central station, and then in base stations parameters including the air
Indu et al. (2013) [5] mainly focuses on reviews in the field of remote monitoring and
control, the technology used and their potential advantages. The paper proposes an innovative
GSM/Bluetooth based remote controlled embedded system for irrigation. The system sets the
irrigation time depending on the temperature and humidity reading from sensors and type of crop
and can automatically irrigate the field when unattended. Information is exchanged between far end
and designed system via SMS on GSM network. A Bluetooth module is also interfaced with the
main microcontroller chip which eliminates the SMS charges when the user is within the limited
range of few meters to the designated system. The system informs users about many conditions like
status of electricity, dry running motor, increased temperature, water content in soil and smoke via
In [6], R.Suresh et al. (2014) mentioned about using automatic microcontroller based rain
gun irrigation system in which the irrigation will take place only when there will be intense
requirement of water that save a large quantity of water. These systems bring a change to
management of field resource where they developed a software stack called Android is used for
devices that include an operating system, middleware and key applications. The Android SDK
provides the tools and APIs necessary to begin developing applications on the Android platform
using the Java programming language. Mobile phones have almost become an integral part of us
serving multiple needs of humans. This application makes use of the GPRS feature of mobile phone
as a solution for irrigation control system. These system covered lower range of agriculture land and
In IOT SMS alarm system based on SIM900A [7], an IOT alarm system based on SIM900A
module of SIMCOM Company was designed for greenhouse. The system can gather environmental
parameters such as air temperature and air humidity. Meanwhile, with the use of AT command, this
system can also realize SMS automatic sending and receiving, environmental parameters overrun
alarm and insufficient balance alarm. Through the system setting, the alarm message can be sent to
the user-specified mobile phone automatically no matter what the users' location is. This system as a
typical application of IOT in the agriculture has got some satisfactory results in the actual operation.
METHODOLOGY
webpage is hosted online and consists of a database in which readings from sensors
system which enables farmers to contend with challenges they face. There are many
applications in IoT, which addresses the major problems like soil moisture detection,
water conservation management, crop growth monitoring, etc., This project enables
better and smarter irrigation through temperature, humidity and other sensors
networked to communicate with the user. For farmers and growers, Internet of Things
has provided extremely productive ways to cultivate soil with the use of cheap, easy-
system to make agriculture simple. Having sensors connected with controller, the
system reads the soil moisture, temperature and electrical conductivity of the soil and
moisture value and the temperature. Initially the threshold moisture and temperature
value must be defined. When the sensed moisture value goes above the threshold
value, the controller checks for the temperature. Only if the sensed temperature value
is higher than the threshold value, irrigation is done and the user is acknowledged.
This is because all crops can withstand in the dry soil moisture condition if the
temperature is moderate. This would conserve the water used for irrigation.
Sending SMS to the user about the field enables the user to remotely monitor
the agriculture area. The SMS include the warning and suggestion to the affected
system.
IOT Section
sprinkler status i.e. on or off and a button which redirects the user to a thing speak
irrigation should begin. When the sensors detect moisture content before the
threshold, the sprinklers are switched on till the soil is completely moist.
content in soil which has been divided into two categories: Low and High. Pump is
to be switched on when the moisture content is low. The threshold values depend
channel to obtain graphs. ThingSpeak is an open data platform and API for the
Internet of Things that enables you to collect, store, analyze, visualize, and act on data
The values obtained through sensors enable the system to switch the sprinkler
on and off. A farmer can remotely monitor the irrigation process on the farm. Hence,
initial step, the software for the controller must be configured. Before reading the
analog inputs from the sensors, the threshold values for each parameter must be
predefined. The moisture threshold value is set to 800 units in this project. The
threshold temperature value is 24 degree Celsius. The EC value ranges from 5.5 to
6.5 units. These values are defined by complete analysis of the soil in prior.
The controller first checks for the moisture value. When the moisture goes above 800,
then it checks for the temperature. When the temperature is below the threshold value
it means that plant can sustain for few more days without water. But if it goes above
Parameter Sensing
This module deals with the sensing unit of the project, where the sensors like
soil moisture sensor, temperature sensor and electrical conductivity sensor are placed
in contact with the soil which is to be cultivated. These sensors are interfaced with the
controlling unit via wired or wireless connections. The soil moisture sensor can
measure the dryness of the soil with the maximum measure of 1023 units. This
measure defines the complete dry soil. The temperature sensor can detect with the
Internet of Things
devices to sense and collect data from the world around us, and then share that data
across the Internet where it can be processed and utilized for various interesting
purposes. Internet of Things is very quickly becoming a reality. We can see the proof
of it around us. Our devices are getting smarter each day from smartphones to smart
Internet of Things (IoT) describes a network of physical objects that connect to each
other through the internet. Objects, or ‘things’ can transfer information wirelessly
without requiring human interaction. A ‘thing’ can be any object that can be assigned
an IP address and provided with the ability to transfer data over a network.
implant, a farm animal with a biochip transponder, an automobile that has built-in
sensors to alert the driver when tire pressure is low -- or any other natural or man-
made object that can be assigned an IP address and provided with the ability to
transfer data over a network. These devices collect useful data with the help of
various existing technologies and then autonomously flow the data between other
hardware boards, Software systems, web APIs, protocols which together creates a
internet such that sensory data can be accessed and control system can be APIs,
embedded devices to be connected to internet such that sensory data can be accessed
and control system can be triggered over internet. Also devices could be connected to
internet using various means like WiFi, Ethernet and so on. Furthermore devices may
and the crops can be damaged in either of situation of excess of water supply or in
shortage of water supply. In areas of drought condition, IoT can prove to be a great
value as it manages the limited water supply smartly with least wastage of water
resource.
the soil affects the crop productivity to a greater extent. Higher the level of accuracy,
Moisture Sensor
The Soil Moisture Sensor is used to measure the volumetric water content in
the soil. This makes it ideal for performing experiments in plants by having constant
information about the amount of water currently present in soil and accordingly
providing water to the plants for proper nourishment. This includes constant checking
of moisture content in soil and sending the readings to the android application. If the
moisture content is less than the threshold value (which is pre-fed into the arduino
connected to the arduino will start sprinkling water on the affected area.
PH Sensor
available to the plant. If the content of the soil solution is too acidic or too alkaline it
can cause lock up – a situation which restricts certain elements essential for growth
from being absorbed by the root structure. Deficiencies in the required elements
become apparent in the plants growth and can lead to plant death. Additionally the pH
Photocell Sensor
Photocell sensor picks up the light readings. These readings will be transferred
to Arduino where they will be compared with the threshold value. If it is less than the
HARDWARE REQUIREMENTS
1. Atmega 328
AVR family (later Microchip Technology acquired Atmel in 2016). It has a modified
supports the data up to eight (8) bits. ATmega-328 has 32KB internal built in
memory. This micro-controller has a lot of other characteristics. You should also have
The Atmel 8-bit AVR RISC-based microcontroller combines 32KB ISP flash
purpose I/O lines, 32 general purpose working registers, three flexible timer/counters
with compare modes, internal and external interrupts, serial programmable USART, a
byte-oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit A/D converter
internal oscillator, and five software selectable power saving modes. The device
operates between 1.8-5.5 volts. The device achieves throughput approaching 1 MIPS
per MHz.
Features:
It has 3 Ports in total which are named as Port B, Port C and Port D.
Port C is an analogue Port and it has six pins in total. So, in simple words,
Port B and Port D are digital ports and have 7 pins each.
It needs a crystal oscillator for generating the frequency. You can use crystal
2. Motors
current electrical energy into mechanical energy. The most common types rely on the
forces produced by magnetic fields. Nearly all types of DC motors have some internal
DC motors were the first type widely used, since they could be powered from
be controlled over a wide range, using either a variable supply voltage or by changing
the strength of current in its field windings. Small DC motors are used in tools, toys,
and appliances. The universal motor can operate on direct current but is a lightweight
brushed motor used for portable power tools and appliances. Larger DC motors are
used in propulsion of electric vehicles, elevator and hoists, or in drives for steel
rolling mills.
Figure: DC Motor
Features:
design.
• High output: High heat dissipation and heat resistance achieves higher output.
• High strength: High radial load capacity due to robust construction, large
• Low noise and increased insulation due to new resin brush holders.
• Large selection of gear heads and reduction ratios are available to meet all
needs.
Drivers are used to control the devices because signal coming from controller
are low signals to drive the different devices we need drivers so that device will
control easily. The L293 and L293D are quadruple high-current than if H drivers. The
at voltages from 4.5v to 36v. Both devices are designed to drive inductive loads such
as relays, solenoids, dc and bipolar stepping motors, as well as other high –current
Features
Moisture Sensing:
Two YL-69 soil moisture sensors along with LM393 comparator modules were
placed in different soil conditions for analysis. The sensor YL-69 is made up of two
electrodes. It reads the moisture content around it. A current is passed across the
electrodes through the soil and the resistance to the current in the soil determines the
soil moisture. If the soil has more water resistance will be low and thus more current
On the other hand when the soil moisture is low the sensor module outputs a high
level of resistance. This sensor has both digital and analogue outputs. Digital output is
simple to use but is not as accurate as the analogue output. Since the Atmega 328P-
PU microcontroller used for the Arduino Uno contains an onboard 10-bit 6-channel
analog-to-digital (A/D) converter, the analog input pin of Arduino can read analog
signals being sent from the sensor and return binary integers from 0 to 1023. Greater
Soil moisture is the water that is held in the spaces between soil particles. The root
zone soil moisture is the water that is available to the plants, which is generally
includes soil moisture measurement as the main module. Irrigation to the field and
acknowledgement to the user are done based on the water content in the soil.
Control Section
Information from the sensors is transmitted to the Arduino board. The Arduino board
switching on/off of the motor on which water sprinklers can be attached. Sensor
values from Arduino are transmitted to the GSM-GPRS SIM900A modem. A SIM
with 3G data pack is inserted into this modem which provides IOT features to the
system. Values are further transmitted IOT section through the modem.
The GSM modem is a highly flexible plug and play quad bandSIM900A GSM
modem for direct and easy integration to RS232 applications. It Supports features like
Voice, SMS, Data/Fax, GPRS and integrated TCP/IP stack. The TX and RX pins
software. Arduino boards are able to read inputs - light on a sensor, a finger on a
button, or a Twitter message - and turn it into an output - activating a motor, turning
on an LED, publishing something online. The board can be activated by sending a set
language (based on Wiring), and the Arduino Software (IDE), based on Processing
The moisture and temperature sensed by the sensors are processed in the arduinouno
microcontroller. When the values are beyond the threshold value, then the controller
SOFTWARE REQUIREMENTS
installed in the system. Microcontroller involves simple coding that can uploaded into
the board for execution. Here is the screenshot of coding that was uploaded into the
The threshold moisture value is defined to be 800. When the sensed moisture
is greater than 800, it means the moisture is low and the soil must be irrigated. When
the sensed value is less than 800, it means the soil has enough water.
1. Arduino IDE
In this we will get know of the process of installation of Arduino IDE and
connecting
Step 1
First we must have our Arduino board (we can choose our favorite board) and
a USB cable. In case we use Arduino UNO, Arduino Duemilanove, Nano, Arduino
Mega 2560, or Diecimila, we will need a standard USB cable (A plug to B plug), t
Step 2
IDE from the Download page on the Arduino Official website. We must select the
software, which is compatible with the operating system (Windows, IOS, or Linux).
Step 3
The Arduino Uno, Mega, Duemilanove and Arduino Nano automatically draw
power from either, the USB connection to the computer or an external power supply.
If we are using an Arduino Diecimila, we have to make sure that the board is
configured to draw power from the USB connection. The power source is selected
with a jumper, a small piece of plastic that fits onto two of the three pins between the
Connect the Arduino board to the computer using the USB cable. The green
Step 4
After our Arduino IDE software is downloaded, we need to unzip the folder.
Inside the folder, we can find the application icon with an infinity label
Step 5
Here, we are selecting just one of the examples with the name Blink. It turns the
LED on and off with some time delay. We can select any other example from the list.
Step 6
To avoid any error while uploading the program to the board, we must select
the correct Arduino board name, which matches with the board connected to the
computer.
Here, we have selected Arduino Uno board according to our tutorial, but we
must select the name matching the board that we are using.
Step 7
Select the serial device of the Arduino board. Go to Tools → Serial Port
menu. This is likely to be COM3 or higher (COM1 and COM2 are usually reserved
for hardware serial ports). To find out, we can disconnect the Arduino board and re-
open the menu, the entry that disappears should be of the Arduino board. Reconnect
Step 8
Before explaining how we can upload our program to the board, we must
demonstrate the function of each symbol appearing in the Arduino IDE toolbar.
F − Serial monitor used to receive serial data from the board and send the serial data
to the board.
Now, simply click the "Upload" button in the environment. Wait a few
seconds; we will see the RX and TX LEDs on the board, flashing. If the upload is
successful, the message "Done uploading" will appear in the status bar.
Note − If we have an Arduino Mini, NG, or other board, we need to press the
reset button
physically on the board, immediately before clicking the upload button on the
Arduino Software.
PROGRAM
#include <SPI.h>
#include <Ethernet.h>
#include "DHT.h"
#include <Servo.h>
int pos = 0;
#define DHTPIN A1
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
int temp=A1;
int buzz=8;
int moist=A2;
int m1=2;
int m2=3;
int m11=4;
int m21=5;
int ldr=6;
int s1=9;
int cms=1;
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(192, 168, 1, 177);
EthernetServer server(80);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Ethernet.begin(mac, ip);
server.begin( );
myservo.attach(s1);
pinMode(ldr,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
float h = dht.readHumidity();
// Read temperature as Celsius (the default)
float t = dht.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true)
float f = dht.readTemperature(true);
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println(F("Failed to read from DHT sensor!"));
return;
}
int mst=analogRead(moist);
{
if (webpage.available ( ) )
{
char character = webpage.read ( );
Serial.write(character);
if (character == '\n' && currentLineIsBlank)
{
webpage.println ("HTTP/1.1 200 OK");
webpage.println ("Content-Type: text/html");
webpage.println ("Connection: close");
webpage.println ("Refresh: 5");
webpage.println ( );
webpage.println ("<!DOCTYPE HTML>");
webpage.println ("<html>");
webpage.print ("<Title>IOT IRRIGATION SYSTEM
</Title>");
webpage.print ("<h1>DVS Polytechnique
Irrigation Webserver </h1>");
webpage.print ("<h4>Temperature in C: ");
webpage.print (t);
webpage.print ("</h4><h4>Humidity in C: ");
webpage.print (h);
webpage.print ("</h4><h4>Moisture Value is :
");
webpage.print (mst);
webpage.print ("</h4><h4>Light intensity :
");
webpage.print (digitalRead(ldr));
webpage.print ("</h4><h4>");
webpage.println ();
webpage.println ("</h4><h4> ");
webpage.println ();
if(t>35){
webpage.print ("</h4><h4>fan is on");
webpage.println ("</h4><h4> Relay is On");
digitalWrite(buzz,1);
pumpon1();
}
if(t<35)
{
webpage.print ("</h4><h4>fan is off");
webpage.println ("</h4><h4> Relay is
Off</h4>");
pumpoff1();
digitalWrite(buzz,0);
}
if((mst)>500)
{webpage.print ("</h4><h4>Pump is On</h4>");
pumpon();
}
if(mst<500)
{
webpage.print ("</h4><h4>Pump is Off</h4>");
pumpoff();
}
if(digitalRead(ldr)==1)
{
webpage.print ("</h4><h4>Curatin is Closed</h4>");
if(cms==1){
ms1();
cms=0;}
}
if(digitalRead(ldr)==0)
{
webpage.print ("</h4><h4>Curatin is Opened</h4>");
if(cms==0){
ms2();
cms=1;
}
}
if ( character == '\n')
{
currentLineIsBlank = true;
}
else if (character != '\r')
{
currentLineIsBlank = false;
}
}
}
delay(1);
webpage.stop();
Serial.println("webpage disconnected");
}
delay(1000);
}
void pumpon(){
digitalWrite(m1,1);
digitalWrite(m2,0);
void pumpoff(){
digitalWrite(m1,1);
digitalWrite(m2,0);
void pumpon1(){
digitalWrite(m11,1);
digitalWrite(m21,0);
void pumpoff1(){
digitalWrite(m11,1);
digitalWrite(m21,0);
}
void ms1(){
for (pos = 0; pos <= 100; pos += 1) { // goes from 0
degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to
position in variable 'pos'
delay(15); // waits 15ms for the
servo to reach the position
}
}
void ms2(){
ADVANTAGES
Accurate sensing
CONCLUSION
A system to monitor moisture levels in the soil was designed and the project
provided an opportunity to study the existing systems, along with their features and
drawbacks. The proposed system can be used to switch on/off the water sprinkler
according to soil moisture levels thereby automating the process of irrigation which is
one of the most time consuming activities in farming. Agriculture is one of the most
water-consuming activities. The system uses information from soil moisture sensors
to irrigate soil which helps to prevent over irrigation or under irrigation of soil thereby
avoiding crop damage. The farm owner can monitor the process online through a
website. Through this system it can be concluded that there can be considerable
development in farming with the use of IOT and automation. Thus, the system is a
potential solution to the problems faced in the existing manual and cumbersome
FURTHER WORK
recommendations can be put into consideration. Option of controlling the water pump
can be given to the farmer i.e. he can switch on/off the pump in order to start/stop the
process of irrigation without being present at the farm. The farmer may choose to stop
the growth of crops or the crops may get damaged due to adverse weather conditions.
In such cases farmer may need to stop the system remotely. The idea of using IOT for
management, fire detection and climate control. This would minimalize human
REFERENCES
13, 2005
[3] Csótó, Magyar, “Information flow in agriculture – through new channels for
[4] Jin Shen, Song Jingling, Han Qiuyan and Yang Yan, “A Remote Measurement
[5] Indu Gautam and S.R.N Reddy, “Innovative GSM based Remote Controlled
[7] Karan Kansara, Vishal Zaveri, Shreyans Shah, Sandip Delwadkar, and Kaushal
[9]K.S.S. Prasad, Nitesh Kumar, Nitish Kumar Sinha and Palash Kumar Saha
10.5829/idosi.mejsr.2012.12.12.1258