Smart Irrigation System-1
Smart Irrigation System-1
Now days we can see nearly everything which was once controlled by human being are
being automated using machines and electronics circuits. Even though many things
have been automated the irrigation system in which we are using machines to saw
seeds remove unwanted plants cutting crops and processing the product etc., one
thing was still controlled by human being that is controlling the moisture level of the
field and turning the suitable valve on and off as per the requirement. Here we are
making an attempt to fulfill this requirement a by using micro controller and sensors.
CONTENTS
Sl No Chapter Name Page No
1 INTRODUCTION 1-3
Introduction
Block diagram
3 EXISTING SYSTEM 6
4 PROPOSED SYSTEM
Advantages
System Architecture 7-8
5 SYSTEM DESIGN
Requirement Analysis
Data Flow Diagram
Entity Relationship Diagram
Database Design
Use Case Diagram 9-19
Modules
6 CODING 20-29
7 TESTING
Types of Testing
Testing Results 30-33
1 System Architecture 8
3 ER diagram 11
List of Tables
1 Database Design 12
CHAPTER 1
INTRODUCTION
1.1
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 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 IJSER International Journal of
Scientific & Engineering Research Volume 8, Issue 5, May-2017 45 ISSN 2229-5518 IJSER ©
2017 http://www.ijser.org 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 Wi Fi, Ethernet and so on. Furthermore devices may not needed to be connected
to internet independently. Agriculture is the backbone of Indian Economy. In today’s world, as we see
rapid growth in global population, agriculture becomes more important to meet the needs of the human race.
However, agriculture requires irrigation and with every year we have more water consumption than rainfall, it
becomes critical for growers to find ways to conserve
BE/Dep.of CSE/BNMIT 1
Smart Irrigation System
water while still achieving the highest yield. But in the present era, the farmers have been using irrigation
technique through the manual control in which they irrigate the land at the interval. According to statistics,
agriculture uses 85% of available resources worldwide, and this percentage will continue to be dominant in
water consumption because of population growth and increased food demand. There is an urgent need to
create strategies based on science and technology for sustainable use of water, including technical,
agronomic, managerial and institutional improvements. Agricultural irrigation based on Internet technology
is based on crop water requirement rules. By using Internet technology and sensor network technology we
can control water wastage and to maximize the scientific technologies in irrigation methods. Hence it can
greatly improve the utilization of water and can increase water productivity. The Internet of Things (IoT) is a
technology where in a mobile device can be used to monitor the function of a device. The Internet of Things
(IoT) is concerned with interconnecting communicating objects that are installed at different locations that
are possibly distant from each other. Internet of Things (IoT) is a type of network technology, which senses
the information from different sensors and makes anything to join the Internet to exchange information. It can
also be used to modify the status of the device. The central processing unit will also include communication
device to receive data from the sensors and to be relayed to the user’s device. This will be done using a higher
communication device such as a Wi-Fi module. The data processed by the central module is converted to
meaningful data and relayed to the user. The user can view the data with the help of a handheld device such
as a mobile phone or a tablet. Nowadays water scarcity is a big concern for farming. This project helps the
farmers to irrigate the farmland in an efficient manner with automated irrigation system based on soil
moisture
BE/Dep.of CSE/BNMIT 2
Smart Irrigation System
BE/Dep.of CSE/BNMIT 3
Smart Irrigation System
CHAPTER 2
LITERATURE SURVEY
Primary investigation is carried out under the following stages, such as Understanding the existing
approaches, Understanding the requirements, developing an abstract for the system. In this paper,
soil moisture sensor, temperature and humidity sensors placed in root zone of plant and transmit
data to android application. Threshold value of soil moisture sensor that was programmed into a
microcontroller to control water quantity. Temperature, humidity and soil moisture values are
displayed on the android application. This paper on "Automatic Irrigation System on Sensing Soil
Moisture Content" is intended to create an automated irrigation mechanism which turns the pumping
motor ON and OFF on detecting the dampness content of the earth. In this paper only soil moisture
value is considered but proposed project provided extension to this existed project by adding
temperature and humidity values. Remote Monitoring in Agricultural Greenhouse Using Wireless
Sensor and Short Message Service (SMS).This proposed paper is arduino baseds remote irrigation
system developed for the agricultural plantation, which is placed at the remote location and required
water provides for plantation when the humidity of the soil goes below the set-point value. But in
this we did not aware about the soil moisture level so to overcome this drawback proposed system
included with extra feature soil moisture value and temperature value which displayed on the farmer
mobile application “Irrigation Control System Using Android and GSM for Efficient Use of Water
and Power” this system made use of GSM to control the system which may cost more so to
overcome that proposed system used arduino yun board which already consist of in build wifi
module “Microcontroller based Controlled Irrigation System for Plantation” In th[1is paper old
generation with lesser memory microcontroller is used to control the system but proposed system
made use of arduino yun board which is user friendly and it helps to dump the programs easily. “A
wireless application of drip irrigation automation supported by soil moisture sensors” in this paper
irrigation is carried out using soil moisture values but extend to this proposed system displays
temperature and using soil moisture values but extend to this proposed system displays temperature
and humidity values. By referring all above papers it found that no such systems are existed with all
integrated features but proposed system includes these all features such as displaying temperature, humidity
BE/Dep.of CSE/BNMIT 4
Smart Irrigation System
and soil moisture values and also automatic switching on and off of motor by considering soil moisture
values.
[1] Automated Irrigation system using WSN and GPRS Module having main goal is that
optimize use of water for agriculture crops.This system is composed of distributed wireless sensor
network with soil moisture and temperature sensor in WSN. Gateway units are used to transfer
data from sensor unit to base station, send command to actuator for irrigation control and
manage data of sensor unit. Algorithm used in system for controlling water quantity as per
requirement and condition of filed. It is programmed in microcontroller and it sends command
through actuator to control water quantity through valve unit. Whole system is powered by
photovoltaic panels. Communication is duplex take place through cellular network. Web
application manage the irrigation through continuous monitoring and irrigation scheduling
programming. It can be done through web pages.
BE/Dep.of CSE/BNMIT 5
Smart Irrigation System
CHAPTER 6
EXISTING SYSTEM
In the present era one of the greatest problem faced by the world is water scarcity and agriculture
being a demanding occupation consumes plenty of water. Therefore, a system is required that
uses water judiciously. Smart irrigation systems estimate and measure diminution of existing
plant moisture in order to operate an irrigation system, restoring water as needed while
minimizing excess water use.
CHAPTER 4
PROPOSED SYSTEM
The proposed device uses a microcontroller (Node MCU) that has a Wi-Fi module over it
(ESP8266). Web application is used as the user interface. Soil moisture sensor, humidity and
temperature sensor (DHT11), Ph sensor, DS18B20 and relay module are used. This relay is
connected to a water pump which pumps water to the crops when the relay is ON. The soil moisture
sensor senses the moisture level of the soil, depending on the level of moisture, Node MCU decides
whether to water the crop or not. By using appropriate functions and conditional statements in the
code written for the Node MCU functioning, the watering of the crop starts by Node MCU making
relay ON when the moisture content is below a threshold value and is made OFF when there is
enough moisture content in the soil.
Regulated power
supply
Clock
TEMP source
SENSOR
Field valve
Field controller
To field 1
Field-1 moisture Node
sensor
Field-2 MCU To field 2
Water level
sensor
Motor controller
Well
BE/Dep.of CSE/BNMIT 8
Smart Irrigation System
CHAPTER 5
SYSTEM DESIGN
o Microcontroller
o ADC Unit
o LCD
o Temperature Sensor
o Water level Sensor
o Moisture Sensor
o Power Supply
Software Requirements
o Embedded C Language
o Keil Cross Compiler
o Flash Magic
o Android
o JAVA
o SQLITE
BE/Dep.of CSE/BNMIT 9
Smart Irrigation System
LEVEL 0
LEVEL 1
BE/Dep.of CSE/BNMIT 10
Smart Irrigation System
Name
User Id
1
Soil
N Moisture
User Controls Sensor
Temper
ature
N Water
level
Senses Result
Data
BE/Dep.of CSE/BNMIT 11
Smart Irrigation System
BE/Dep.of CSE/BNMIT 12
Smart Irrigation System
BE/Dep.of CSE/BNMIT 13
Smart Irrigation System
5.6 Modules
Node MCU
1. Voltage:3.3V.
2. Wi-Fi Direct (P2P), soft-AP.
3. Current consumption: 10uA~170mA.
4. Flash memory attachable: 16MB max (512K normal).
5. Integrated TCP/IP protocol stack.
6. Processor: Tensilica L106 32-bit.
7. Processor speed: 80~160MHz.
8. RAM: 32K + 80K.
BE/Dep.of CSE/BNMIT 14
Smart Irrigation System
9. GPIOs: 17 (multiplexed with other functions).
10. Analog to Digital: 1 input with 1024 step resolution.
11. +19.5dBm output power in 802.11b mode
12. 802.11 support: b/g/n.
13. Maximum concurrent TCP connections: 5.
PIN DIAGRAM
RELAY
The relay module is an electrically operated switch that allows you to turn on or off a circuit using
voltage and/or current much higher than a microcontroller could handle. There is no connection
between the low voltage circuit operated by the microcontroller and the high power circuit. The
relay protects each circuit from each other. Each channel in the module has three
4
BE/Dep.of CSE/BNMIT 16
Smart Irrigation System
connections named NC, COM, and NO. Depending on the input signal trigger mode, the jumper cap
can be placed at high level effective mode which ‘closes’ the normally open (NO) switch at high
level input and at low level effective mode which operates the same but at low level input. work in
Arduino IDE environment.
LCD
In recent years the LCD is finding widespread use replacing LED`s(seven segment or other multi
segment LEDS).This is due to the following reasons:the declining prices of LCDS;the ability to
display numbers ,characters and graphics.,this is in contrast to LED`s which are limited to numbers
and few characters;Incorporation of refreshing controller into the LCD thereby relieving of the task
of refreshing the LCD ,in contrast LED must be refreshed by the CPU(or in some other way) to keep
displaying the data;ease of programming for characters and graphics.
REGISTERS IN LCD
There are two very important registers inside the LCD.The register select is used for the selection of
command or data register as follows: If RS=0 instruction command code register is selected
allowing the user to send a command such as clear display, cursor at home etcetera. If RS=1 data
register is selected allowing the user to send data to be displayed on the LCD
4
BE/Dep.of CSE/BNMIT 17
Smart Irrigation System
The display panel is made of glass .Do not subject it to a mechanical shock by dropping it from
a high place, etc.
If the display panel is damaged and the liquid crystal substance inside it leaks out ,do notget in
your mouth. if the substance come into contact with your skin or clothes promptlywash it off using
soap and water
Do not apply excessive force to the display surface or the adjoining areas since this may cause
the color tone to vary.
The polarizer covering the display surface of the LCD module is soft and easily scratched
handle this polarizer carefully.
To prevent destruction of the elements by static electricity ,be careful to maintain an optimum
work environment.
Storage precautions: when storing the LCD modules, avoid exposure to direct sunlightor to the
light of fluorescent lamps. keep the modules in bags designed to prevent static electricity charging
under low temperature/normal humidity conditions (avoid high temperature/high humidity and low
temperature below Whenever possible, the LCD modules should be stored in the same conditions in which
they were shipped from our company.
Temperature sensor
The LM34 is a precision Fahrenheit temperature sensor. It is extremely simple to use: just connect
5V and ground and begin reading the sensor values. The device outputs 0V for 0 degrees F and
increases its output by 0.01V for every increased degree F. This makes the theoretical upper
temperature limit 500 degree F, but the device will only work up to around 250 degrees F.
4
BE/Dep.of CSE/BNMIT 18
Smart Irrigation System
Features
7. DC Motor
4
BE/Dep.of CSE/BNMIT 19
Smart Irrigation System
DC Powered Pumps use direct current from motor or solar power to move fluid in a variety of
ways. Motorized pumps operate on 6, 12, 24, or 32 volts of DC power and use hand-operated,
electric, pneumatic, or hydraulic motors Many DC powered pumps use centrifugal force or
positive displacement to move fluids.
4
BE/Dep.of CSE/BNMIT 20
Smart Irrigation System
CHAPTER 6
CODING
4
BE/Dep.of CSE/BNMIT 21
Smart Irrigation System
float web_tempval;
String web_soil1;
String web_soil2;
String web_water;
4
BE/Dep.of CSE/BNMIT 22
Smart Irrigation System
{
Serial.begin(9600);
pinMode(temp,INPUT);
pinMode(soil1,INPUT);
pinMode(soil2,INPUT);
pinMode(relay1,OUTPUT);
pinMode(relay,OUTPUT);
digitalWrite(relay1,HIGH);
digitalWrite(relay,HIGH);
lcd.init();
lcd.backlight();
lcd.clear();
lcd.setCursor(0,0);
lcd.print("connect to");
lcd.setCursor(0,1);
lcd.print("irrigation");
/* Explicitly set the ESP8266 to be a WiFi-client, otherwise, it by default,
would try to act as both a client and an access-point and could cause
network-issues with your other WiFi-devices on your WiFi-network. */
WiFiManagerParameter custom_output("IPAddress", "IPAddress", output, 15);
// WiFiManager
// Local intialization. Once its business is done, there is no need to keep it around
WiFiManager wifiManager;
wifiManager.setSaveConfigCallback(saveConfigCallback);
4
BE/Dep.of CSE/BNMIT 23
Smart Irrigation System
// Uncomment and run it once, if you want to erase all the stored information
//wifiManager.resetSettings();
4
BE/Dep.of CSE/BNMIT 24
Smart Irrigation System
Serial.println("Connected.");
strcpy(output, custom_output.getValue());
Serial.println("web ip address:" + String(output));
server.begin();
Blynk.config(auth);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Connected:)");
delay(1000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("SMART IRRIGATION");
lcd.setCursor(0,1);
lcd.print("USING IoT");
delay(2000);
lcd.clear();
timer.setInterval(2000,sen);
timer.setInterval(30000,rst);
timer.setInterval(5000,web_push);
void rst()
{
web_tempval =0;
4
BE/Dep.of CSE/BNMIT 25
Smart Irrigation System
web_soil1 ="-";
web_soil2 ="-";
web_water="-";
flag=0;
flag1=0;
flag2=0;
flag3=0;
}
void web_push()
{
Blynk.virtualWrite(V4,String(web_tempval)+","+web_soil1+","+web_soil2+","+web_water);
}
Void sen()
{
soilval1 = digitalRead(soil1);
soilval2 = digitalRead(soil2);
waterval = digitalRead(water);
Serial.println("soil1:"+String(soilval1));
Serial.println("soil2:"+String(soilval2));
Serial.println("water:"+String(waterval));
if(soilval1 == 1 && flag1==0)
{
digitalWrite(relay,LOW);
Serial.println("soil is dry");
up("SOIL1 IS DRY");
web_soil1 = "SOIL1 IS DRY";
flag1 =1;
4
BE/Dep.of CSE/BNMIT 26
Smart Irrigation System
lcd.clear();
lcd.setCursor(0,0);
lcd.print("MOISTURE1 IS LOW");
}
if(soilval2 ==1 && flag==0)
{
digitalWrite(relay1,LOW);
Serial.println("soil2 is dry");
up("SOIL2 IS DRY");
web_soil2 = "SOIL IS DRY";
flag =1;
lcd.clear();
lcd.setCursor(0,0);
lcd.print("MOISTURE2 IS LOW");
}
int tempadcval;
//float tempval;
tempadcval = analogRead(temp); /* Read Temperature */
tempval = (tempadcval * 3.3); /* Convert adc value to equivalent voltage */
tempval = (tempval/10); /* LM35 gives output of 10mv/°C */
web_tempval=tempval;
Serial.println("Temperature : "+String(tempval)+"*C");
if(tempval>37.5 && flag3==0)
{
lcd.clear();
4
BE/Dep.of CSE/BNMIT 27
Smart Irrigation System
lcd.setCursor(0,0);
lcd.print("TEMP IS HIGH");
up("TEMP IS HIGH");
flag3=1;
}
Else
{
digitalWrite(relay,HIGH);
digitalWrite(relay1,HIGH);
}
}
void loop()
{
Blynk.run();
timer.run();
4
BE/Dep.of CSE/BNMIT 28
Smart Irrigation System
}
// Make an HTTP request to the IFTTT web service
void makeIFTTTRequest(String dString)
{
Serial.print("Connecting to ");
Serial.print(server1);
WiFiClient client;
int retries = 5;
while(!!!client.connect(server1, 80) && (retries-- > 0)) {
Serial.print(".");
}
Serial.println();
if(!!!client.connected()) {
Serial.println("Failed to connect...");
// Temperature in Celsius
String jsonObject = String("{\"value1\":\"") + dString + "\"}";
4
BE/Dep.of CSE/BNMIT 29
Smart Irrigation System
// Comment the previous line and uncomment the next line to publish temperature readings in
Fahrenheit
/*String jsonObject = String("{\"value1\":\"") + (1.8 * bme.readTemperature() + 32) +
"\",\"value2\":\""
+ (bme.readPressure()/100.0F) + "\",\"value3\":\"" + bme.readHumidity() + "\"}";*/
Serial.write(client.read());
}
Serial.println("\nclosing connection");
client.stop();
}
4
BE/Dep.of CSE/BNMIT 30
Smart Irrigation System
CHAPTER 7
TESTING
Types of Testing
Unit testing
Unit testing involves the design of test cases that validate that the internal program logic is
functioning properly, and that program input produce valid outputs. All decision branches and internal code
flow should be validated. It is the testing of individual software units of the application .it is done after the
completion of an individual unit before integration. This is a structural testing, that relies on knowledge of its
construction and is invasive. Unit tests perform basic tests at component level and test a specific business
process, application, and/or system configuration. Unit tests ensure that each unique path of a business process
performs accurately to the documented specifications and contains clearly defined inputs and expected
results.
Functional test
Functional tests provide systematic demonstrations that functions tested are available as specified bythe
business and technical requirements, system documentation, and user manuals.
Functional testing is centered on the following items:
Valid Input : identified classes of valid input must be accepted. Invalid Input : identified
classes of invalid input must be rejected.Functions : identified functions must be exercised.
Output : identified classes of application outputs must be exercised.
System Test
System testing ensures that the entire integrated software system meets requirements. It tests a configuration
to ensure known and predictable results. An example of system testing is the configuration oriented system
integration test. System testing is based on process descriptions and flows, emphasizing pre-driven process
links and integration points.
Performance Test
The Performance test ensures that the output be produced within the time limits,
4
BE/Dep.of CSE/BNMIT 31
Smart Irrigation System
and the time taken by the system for compiling, giving response to the users and request being send to the
system for to retrieve the resu
Integration Testing
Software integration testing is the incremental integration testing of two or more integrated software
components on a single platform to produce failures caused by interface defects.
The task of the integration test is to check that components or software applications, e.g. componentsin a
software system or – one step up – software applications at the company level – interact without error.
Acceptance Testing
User Acceptance Testing is a critical phase of any project and requires significant participation bythe end
user. It also ensures that the system meets the functional requirements.
The Acknowledgements will be received by the Sender Node after the Packets are received by
theDestination Node
The Route add operation is done only when there is a Route request in need
The Status of Nodes information is done automatically in the Cache Updation process
4
BE/Dep.of CSE/BNMIT 32
Smart Irrigation System
BE/Dep.of CSE/BNMIT 33
Smart Irrigation System
BE/Dep.of CSE/BNMIT 34
Smart Irrigation System
The automated irrigation system implemented was found to be feasible and cost effective for
optimizing water resources for agriculture production. This irrigation system allows
cultivation in places with water scarcity thereby improving sustainability. The irrigation
system helps the farmer by making his work smarter. As the demand for water increases, along
with the need to protect aquatic habitats, water conservation practices for irrigation need to be
effective and affordable. As multiple sensors are used water can be provided only to the
required area of land. This system reduces the water consumption to greater extent. It needs
minimal maintenance. The power consumption has been reduced very much. The crop
productivity increases and the wast-age of crops are very much reduced. The extension work
is to make user interface much simpler by just using SMS messages for notifications and to
operate the switches
BE/Dep.of CSE/BNMIT 35
Smart Irrigation System
SCREENSHOTS
1. Node MCU
2. LCD
BE/Dep.of CSE/BNMIT 36
Smart Irrigation System
3. Temperature sensor
BE/Dep.of CSE/BNMIT 37
Smart Irrigation System
5. I2C
6. DC Motor
Smart Irrigation System
REFERENCES
[1] Joaquin Gutierrez Jaguey et al., “Smartphone irrigation sensor”, Sensors Journal, vol. 15, NO.
9, September- 2015.
[2] David Chaparro, MerceVall-llossera, Maria Piles, Adriano Camps, Christoph R¨udiger and
Ramon Riera-Tatch, "Predicting the Extent of Wildfires Using Remotely Sensed Soil Moisture and
Temperature Trends", IEEE journal of selected topics in applied earth observations and remote
sensing,VOL. 9, NO. 6, June 2016.
[3] Joaquín gutiérrez et al., “Automated irrigation system using a wireless sensor network and gprs
module”, ieeetransactions on instrumentation and measurement, vol. 63, no.1, january 2014.