0% found this document useful (0 votes)
56 views39 pages

Final Report

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views39 pages

Final Report

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

IOT BASED IRRIGATION SYSTEM

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.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 1


IOT BASED IRRIGATION SYSTEM

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

systems that prevent water wastage without imposing pressure on farmers.

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

order to become more efficient in production and communicating appropriate information.

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'

work much easier as they can concentrate on other farm activities.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 2


IOT BASED IRRIGATION SYSTEM

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

temperature, the air humidity.

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

SMS on GSM network or by Bluetooth.

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

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 3


IOT BASED IRRIGATION SYSTEM

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

not economically affordable.

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.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 4


IOT BASED IRRIGATION SYSTEM

METHODOLOGY

The system is a combination of hardware and software components. The

webpage is hosted online and consists of a database in which readings from sensors

are inserted using the hardware.

Figure: Block Diagram of Smart Irrigation System

An IoT based irrigation system is for efficient agricultural management

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

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 5


IOT BASED IRRIGATION SYSTEM

has provided extremely productive ways to cultivate soil with the use of cheap, easy-

to-install sensors and an abundance of insightful data they offer.

An IoT based irrigation system aims to utilize the features of embedded

system to make agriculture simple. Having sensors connected with controller, the

system reads the soil moisture, temperature and electrical conductivity of the soil and

then the sensed data are processed in the controller.

The microcontroller is the decision maker of this system. It checks for

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.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 6


IOT BASED IRRIGATION SYSTEM

IOT Section

This section comprises of a webpage which displays the current water

sprinkler status i.e. on or off and a button which redirects the user to a thing speak

page which graphically depicts the sensor values.

Figure: Webpage showing sprinkler and soil moisture status

Water sprinkler control was achieved by setting a threshold value at which

irrigation should begin. When the sensors detect moisture content before the

threshold, the sprinklers are switched on till the soil is completely moist.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 7


IOT BASED IRRIGATION SYSTEM

Figure: Flow chart of the system

The hardware device comprises of moisture sensors, Arduino Uno and

GSMGPRS SIM900A modem. The GSM modem is primary responsible for

transmitting the data obtained from arduino to internet.

The information from sensors is transmitted to an online database from

where it is used to display on a website. The webpage displays the moisture

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

on the type of soil used.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 8


IOT BASED IRRIGATION SYSTEM

Readings from the two sensors were also transmitted to a THINGSPEAK

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

from sensors or actuators, such as Arduino.

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,

the system contributed in making a smart farm.

Based on the sensed values, decision is made by the microcontroller. As an

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 sensors are connected to the respective pins of the arduino

microcontroller. The software implementations includes simple coding in C language.

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

the threshold value, the plant must be irrigated.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 9


IOT BASED IRRIGATION SYSTEM

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

maximum of 150 degree Celsius. The EC value ranges from 1-14.

Internet of Things

Internet of Things represents a general concept for the ability of network

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

TV to smart car to Smart kitchen. Everything is now getting connected to Internet.

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.

A Thing, in the Internet of Things, can be a person with a heart monitor

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

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 10


IOT BASED IRRIGATION SYSTEM

devices. Current market examples include smart thermostat systems and

washer/dryers that utilize Wi-Fi for remote monitoring.

Internet of Things or IoT is an architecture that comprises specialized

hardware boards, Software systems, web APIs, protocols which together creates a

seamless environment which allows smart embedded devices to be connected to

internet such that sensory data can be accessed and control system can be APIs,

protocols which together creates a seamless environment which allows smart

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

not needed to be connected to internet independently.

Agriculture IoT helps in increasing crop productivity by way of managing and

controlling the activities like

Crop water management - Adequate water supply is an essence for agriculture

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.

Precision agriculture - The level of accuracy of temperature, moisture, pH of

the soil affects the crop productivity to a greater extent. Higher the level of accuracy,

lower would be the chances of crops being damaged.

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

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 11


IOT BASED IRRIGATION SYSTEM

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

board), a prompt message is sent to the device and automatically a sprinkler

connected to the arduino will start sprinkling water on the affected area.

PH Sensor

PH sensor checks alkalinity and acidity of the soil. It is important to maintain

a hydroponic nutrient solution at a PH level where the nutrients are consistently

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

of the water we drink is crucial to our health.

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

threshold value can provide some artificial light to the plants.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 12


IOT BASED IRRIGATION SYSTEM

HARDWARE REQUIREMENTS

1. Atmega 328

The ATmega328 is a single-chip microcontroller created by Atmel in the mega

AVR family (later Microchip Technology acquired Atmel in 2016). It has a modified

Harvard architecture 8-bit RISC processor core.

ATmega-328 is basically an Advanced Virtual RISC (AVR) micro-controller. It

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

a look at Introduction to PIC16F877a (it’s a PIC Microcontroller) and then compare

functions of these two Microcontrollers.

The Atmel 8-bit AVR RISC-based microcontroller combines 32KB ISP flash

memory with read-while-write capabilities, 1kb EEPROM, 2kb SRAM, 23 general

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

(8-channels in TQFP and QFN/MLF packages), programmable watchdog timer with

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.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 13


IOT BASED IRRIGATION SYSTEM

Figure: Atmega 328

Features:

 Atmega328 has 28 pins in total.

 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,

ATmega328 has 6 analogue pins.

 Port B and Port D are digital ports and have 7 pins each.

 So, in total ATmega328 has 14 digital pins.

 It also supports Serial Communications, we can perform serial communication

via Pin # 2 (RX) and Pin # 3 (TX).

 It also supports SPI Protocol.

 It needs a crystal oscillator for generating the frequency. You can use crystal

oscillator ranging from 4MHz to 40 MHz

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 14


IOT BASED IRRIGATION SYSTEM

2. Motors

A DC motor is any of a class of rotary electrical machines that converts direct

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

mechanism, either electromechanical or electronic, to periodically change the

direction of current flow in part of the motor.

DC motors were the first type widely used, since they could be powered from

existing direct-current lighting power distribution systems. A DC motor's speed can

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

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 15


IOT BASED IRRIGATION SYSTEM

Features:

• Long-life: Intermittent operation over 1 million cycles with optimized brush

design.

• Continuous operating life of 3000 hours.

• High output: High heat dissipation and heat resistance achieves higher output.

• High strength: High radial load capacity due to robust construction, large

diameter output shaft and ball bearings.

• 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.

• Also available with magnetic revolution sensor and noise filter.

3. L293D Motor Driver

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

L293 is designed to provide bidirectional drive current of up to 1A at voltages from

4.5v to 36v. The L293D is designed to provide bidirectional currents of up to 600-mA

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

high-voltages loads in positive supply application.

Figure: L293D Motor Driver

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 16


IOT BASED IRRIGATION SYSTEM

Features

 Can be used to run Two DC motors with the same IC.

 Speed and Direction control is possible

 Motor voltage Vcc2 (Vs): 4.5V to 36V

 Maximum Peak motor current: 1.2A

 Maximum Continuous Motor Current: 600mA

 Supply Voltage to Vcc1(vss): 4.5V to 7V

 Transition time: 300ns (at 5Vand 24V)

 Automatic Thermal shutdown is available

 Available in 16-pin DIP, TSSOP, SOIC packages

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

will pass through.

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

amount of output implies lesser moisture content.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 17


IOT BASED IRRIGATION SYSTEM

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

considered to be in the upper 200 cm of soil. Moisture is fundamental importance to

much hydrological, biological and biogeochemical process. The proposed system

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.

Figure: Soil Moisture Sensing Unit

Control Section

Information from the sensors is transmitted to the Arduino board. The Arduino board

consists of microcontroller ATMEGA328P which is responsible for controlling the

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

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 18


IOT BASED IRRIGATION SYSTEM

Voice, SMS, Data/Fax, GPRS and integrated TCP/IP stack. The TX and RX pins

from Arduino are connected to the RX and TX of GSM modem respectively.

Arduino is an open-source electronics platform based on easy-to-use hardware and

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

of instructions to the microcontroller on the board. The Arduino programming

language (based on Wiring), and the Arduino Software (IDE), based on Processing

must be used for implementation.

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

does the defined job.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 19


IOT BASED IRRIGATION SYSTEM

SOFTWARE REQUIREMENTS

The software implementation requires the Arduino software IDE to be

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

Arduino Uno board for soil moisture sensing.

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

Arduino uno to Arduino IDE.

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

In case we use Arduino Nano, we will need an A to Mini-B cable.

Step 2

Download Arduino IDE Software. We can get different versions of Arduino

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).

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 20


IOT BASED IRRIGATION SYSTEM

After the file download is complete, unzip the file.

Figure: Opening Arduino File

Step 3

Power up the Arduino board.

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

USB and power jacks.

Check that it is on the two pins closest to the USB port.

Connect the Arduino board to the computer using the USB cable. The green

power LED (labeled PWR) should glow.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 21


IOT BASED IRRIGATION SYSTEM

Step 4

Launch Arduino IDE.

Figure: Launching Arduino IDE

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

(application.exe). Double click the icon to start the IDE.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 22


IOT BASED IRRIGATION SYSTEM

Step 5

Open our first project.

Once the software starts, we have two options

 Create a new project

Figure: Create New Project

 Open an existing project example.

To create a new project, select File → New.

To open an existing project example, select File → Example → Basics → Blink.

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.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 23


IOT BASED IRRIGATION SYSTEM

Step 6

Select the Arduino board.

Figure: Select the Arduino Board

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.

Go to Tools → Board and select the board.

Here, we have selected Arduino Uno board according to our tutorial, but we

must select the name matching the board that we are using.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 24


IOT BASED IRRIGATION SYSTEM

Step 7

Select the serial port.

Figure: Select the Serial Port

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

the board and select that serial port.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 25


IOT BASED IRRIGATION SYSTEM

Step 8

Figure: Uploading the program to the board

Upload the program to the board.

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.

A − Used to check if there is any compilation error.

B − Used to upload a program to the Arduino board.

C − Shortcut used to create a new sketch.

D − Used to directly open one of the example sketch.

E − Used to save the sketch.

F − Serial monitor used to receive serial data from the board and send the serial data

to the board.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 26


IOT BASED IRRIGATION SYSTEM

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.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 27


IOT BASED IRRIGATION SYSTEM

PROGRAM
#include <SPI.h>
#include <Ethernet.h>
#include "DHT.h"
#include <Servo.h>

Servo myservo,myservo1; // create servo object to control a


servo
// twelve servo objects can be created on most boards

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( );

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 28


IOT BASED IRRIGATION SYSTEM

Serial.print("Your IP Adress is ");


Serial.println(Ethernet.localIP( ) );
pinMode(buzz,OUTPUT);
pinMode(m1,OUTPUT);
pinMode(m2,OUTPUT);
pinMode(m11,OUTPUT);
pinMode(m21,OUTPUT);
dht.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);

EthernetClient webpage = server.available();


if (webpage)
{
Serial.println("new webpage");
boolean currentLineIsBlank = true;
while (webpage.connected ( ) )

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 29


IOT BASED IRRIGATION SYSTEM

{
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");

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 30


IOT BASED IRRIGATION SYSTEM

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;
}
}

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 31


IOT BASED IRRIGATION SYSTEM

webpage.println ("<br />");


webpage.println ("</html>");
break;
}

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);

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 32


IOT BASED IRRIGATION SYSTEM

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(){

for (pos = 100; pos >= 0; pos -= 1) { // goes from 180


degrees to 0 degrees
myservo.write(pos); // tell servo to go to
position in variable 'pos'
delay(15); // waits 15ms for the
servo to reach the position
}
}

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 33


IOT BASED IRRIGATION SYSTEM

ADVANTAGES

 Simple and efficient

 Conserves water used for irrigation

 Accurate sensing

 Low maintenance cost

 Acknowledging user about the field

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 34


IOT BASED IRRIGATION SYSTEM

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

process of irrigation by enabling efficient utilization of water resources.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 35


IOT BASED IRRIGATION SYSTEM

FURTHER WORK

To improve the efficiency and effectiveness of the system, the following

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

irrigation can be extended further to other activities in farming such as cattle

management, fire detection and climate control. This would minimalize human

intervention in farming activities.

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 36


IOT BASED IRRIGATION SYSTEM

REFERENCES

[1]Dr. Narayan G. Hegde, “Water Scarcity and Security in India”, BAIF

Development ReseachFoundation, Pune.

[2]Marvin T. Batte, “Changing computer use in agriculture: evidence from Ohio”,

Computers and Electronics in Agriculture, Elsevier science publishers, vol. 47, 1–

13, 2005

[3] Csótó, Magyar, “Information flow in agriculture – through new channels for

improved effectiveness”, Journal of Agricultural Informatics 1 (2), 25–34, 2010

[4] Jin Shen, Song Jingling, Han Qiuyan and Yang Yan, “A Remote Measurement

and Control System for Greenhouse Based on GSM-SMS”, Electronic

Measurement andInstruments, 2007. ICEMI '07. 8th International Conference

[5] Indu Gautam and S.R.N Reddy, “Innovative GSM based Remote Controlled

Embedded System for Irrigation”, International Journal of Computer

Applications Vol. 47 – No.13, June 2012

[6] R.Suresh, S.Gopinath, K.Govindaraju, T.Devika, N.SuthanthiraVanitha,

“GSM based Automated IrrigationControl using Raingun Irrigation System”,

InternationalJournal of Advanced Research in Computer and Communication

Engineering Vol. 3, Issue 2, February 2014.

[7] Karan Kansara, Vishal Zaveri, Shreyans Shah, Sandip Delwadkar, and Kaushal

Jani “Sensor based Automated IrrigationSystemwithIOT:ATechnical

Review”,(IJCSIT) International Journal of Computer Science and Information

Technologies, Vol. 6 (6) , 2015, 5331-5333

[8]Sumeet. S. Bedekar, Monoj. A. Mechkul, and Sonali. R. Deshpande “IoT based

Automated Irrigation System”, IJSRD - International Journal for Scientific

Research& Development| Vol. 3, Issue 04, 2015 | ISSN (online): 2321-0613

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 37


IOT BASED IRRIGATION SYSTEM

[9]K.S.S. Prasad, Nitesh Kumar, Nitish Kumar Sinha and Palash Kumar Saha

“Water-Saving Irrigation System Based on Automatic Control by Using

GSM Technology”, Middle-East Journal of Scientific Research 12 (12): 1824-

1827, 2012ISSN 1990-9233 c IDOSI Publications, 2012DOI:

10.5829/idosi.mejsr.2012.12.12.1258

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 38


IOT BASED IRRIGATION SYSTEM

Model of IOT Based Irrigation System

DEPT. OF E&CE, D.V.S POLYTECHNIC Shivamogga Page 39

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy