A Project Report
On
“Raspberry Pi and Arduino Based Automated Irrigation System”
Sponsored by
Karnataka State Council for Science and Technology[KSCST]
Indian Institute of Science Campus, Bangalore
Submitted in partial fulfillment of the requirements for the award of the degree of
Bachelor of Engineering
in
Information Science and Engineering
Submitted by
Aishwarya T 4GW13IS001
Chaithra M 4GW13IS006
Meghana M R 4GW13IS024
Sushma R Krishnan 4GW13IS048
(Affiliated to VTU, Belagavi, Approved by AICTE, New Delhi & Govt. of Karnataka)
2017
ACKNOWLEDGEMENT
We sincerely owe our gratitude to all the persons who helped and
guided us in completing this project work.
First and foremost we offer our sincere thanks to Smt. Vanaja B Pandit,
Honorable Secretary, GSSSIETW and the management of GSSSIETW, Mysuru
for providing help and support to carry out the project.
We would like to sincerely thank our project guide Mrs. Ayesha Taranum
and Mrs. Chaya P , Assistant Professors, Department of Information Science
and Engineering for their valuable guidance, constant assistance and
constructive suggestions for the effectiveness of project, without which this
project would not have been possible.
We would also like to thank all our ISE staff members who have always been
with us extending their precious suggestions, guidance and encouragement
throughout the project.
Lastly, we would like to thank our parents and friends for their support,
encouragement and guidance throughout the project.
Aishwarya T (4GW13IS001)
Chaithra M (4GW13IS006)
Meghana M R (4GW13IS024)
Sushma R Krishnan (4GW13IS048)
i
ABSTRACT
ii
TABLE OF CONTENTS
Acknowledgement i
Abstract ii
Contents iii
List of Figures v
List of Tables vi
1. INTRODUCTION 01-03
1.1 Overview 01
1.3 Objectives 02
1.4 Advantages 02
3.3Feasibility Analysis 09
iii
4.2 Methodology 13
5. IMPLEMENTATION 17-23
6. TESTING 24-27
7.1 Snapshots 28
REFERENCES 31-32
iv
LIST OF FIGURES
Block Diagram
4.1 11
4.6
Data flow diagram 16
7.1
The model for the proposed system 28
v
LIST OF TABLES
vi
Raspberry Pi and Arduino Based Automated Irrigation System
Chapter 1
INTRODUCTION
At the present era, the farmers have been using irrigation technique in India through
the manual control in which the farmers irrigate the land from time to time. This process
sometimes consumes more water. Automatic irrigation scheduling consistently has shown to
be valuable in water use efficiency with respect to manual irrigation based on direct soil
water measurements. Irrigation of plants is usually a very time-consuming activity which has
to be done in a reasonable amount of time; it requires a large amount of human resources. All
the steps were executed by humans traditionally.
Nowadays, some systems use technology to reduce the number of workers and to
reduce the time required to water the plants. With such systems, the control is very limited
and many of the resources are still wasted. Water is one of these resources which is used
excessively. Mass irrigation is the method which is used to water the plant. This method
represents massive losses since the amount of water given exceeds the plants’ needs. The
excess water gets discharged by the holes of the pots, or it percolates through the soil in the
fields. In addition to the excess cost of water, labour is becoming more and more expensive.
The proposed irrigation system makes the efficient use of water. Water is fed to the
plant whenever there is need. There already exist irrigation systems which water plants on the
basis of soil humidity, pH value of soil, temperature and light. Wherever these parameters are
required in big agricultural fields their productivity of the crop matters.
The proposed irrigation system will be very efficient in areas like house gardens,
office premises, buildings etc. where watering plants at regular interval matters. This system
also presents an smart drip irrigation system to water plants using devices like raspberry pi,
Arduino microcontrollers. Zigbee is used to control the system wirelessly. And also the user
gets the status time to time.
1.3 Objectives
The objectives of the project is to design a smart drip irrigation system to water plants with
the use of devices like raspberry pi, Arduino microcontrollers. Zigbee is used to control the
system wirelessly while Python programming language is used for automation purpose.
This system also contributes an efficient and fairly cheap automation irrigation system.
System once installed has no maintenance cost and is easy to use. Environment parameters
monitoring system based on wireless communication technology has been developed to
control remotely, which realizes the measurement of temperature, rain fall, soil parameters.
Monitoring system based on wireless communication technology has been developed to
control remotely, which realizes the measurement of temperature, rain fall, soil parameters.
1.4 Advantages
Chapter 1: Introduction
This chapter provides the overview of the project.
Chapter 2: Literature Survey
This chapter specifies about the related work and background works of this project.
Chapter 3: Software Design
Requirement
The chapter summarizes about the system requirement specifications, functional and non-
functional requirements of this project.
Design
This module signifies the design description, system architecture and explanation of modules.
Chapter 4: Implementation
This module of the chapter consists the project implementation and the functionality.
Testing
This module describes the types of testing required for this project and the test cases designed
and implemented.
Chapter 5: Results and Conclusion
This chapter includes the snapshots of the working that is developed by this project and the
conclusion.
Chapter 2
LITERATURE SURVEY
Related Work
After the research in the agricultural field, researchers found that the yield of
agriculture goes on decreasing day by day. Use of technology in the field of agriculture plays
important role in increasing the production as well as in reducing the extra man power efforts,
water requirement and fertilizer requirement.
Bennis, H. Fouchal, O. Zytoune, D. Aboutajdine, “Drip Irrigation System using Wireless Sensor
Networks” The Model includes soil moisture, temperature and pressure sensors to monitor the
irrigation operations. Specifically, we take into account the case where a system malfunction
occurs, as when the pipes burst or the emitters block. Also, we differentiate two main traffic
levels for the information transmitted by the WSAN, and we use an adequate priority-based
routing protocol to achieve high QoS performance. Simulations conducted over the NS-2
simulator show promising results in terms of delay and Packet Delivery Ratio (PDR), mainly
for priority traffic [1].
Joaquín Gutiérrez, Juan Francisco Villa-Medina et al. “Automated Irrigation System Using a
Wireless Sensor Network and GPRS Module, In this paper the System has a distributed wireless
network of soil-moisture & temperature sensors placed in root zone of plants. Gateway unit
handles sensor information, triggers actuators, and transmits data to a web application. An
algorithm was developed with threshold values of sensors that was programmed into a
microcontroller-based gateway to control water quantity [2].
Sangamesh Malge, Kalyani Bhole, “Novel, Low cost Remotely operated smart Irrigation
system" In this paper a Small embedded system device (ESD) which takes care of a whole
irrigation process. The PIC18F4550 microcontroller interfaced with GSM module works as a
brain and several sensors like temperature, level and rain works as eyes of this ESD. If and
only if eyes of the ESD see all parameters are within a safe range, the PIC18F4550 starts
irrigation process by starting the irrigation pump. The farmer gets time to time feedback from
ESD through SMS about the action that has taken place by PIC18F4550 [3].
Nikhil Agrawal, Smita Singhal, “Smart Drip Irrigation System using Raspberry pi and
Arduino” The commands from the user are processed at raspberry pi using python
programming language. Arduino microcontrollers are used to receive the on/off commands
from the rasperry pi using zigbee protocol. Star zigbee topology serves as backbone for the
communication between raspberry pi and end devices. Raspberry pi acts a central coordinator
and end devices act as various routers [4].
Pravina B. Chikankar, Deepak Mehetre, Soumitra Das, “An Automatic Irrigation System using
ZigBee in Wireless Sensor Network” In the research field of wireless sensor network power
efficient time is major issue which can be overcome by using ZigBee technology. The main
idea is to understand how data travels through wireless medium transmission using WSN and
monitoring system. Design of an irrigation system which is automated by using controllable
parameter such as temperature, soil moisture and air humidity because they are the important
factors to be controlled in PA(Precision Agriculture) [5].
Sneha Angal “Raspberry pi and Arduino Based Automated Irrigation System” The paper
presents a home automation system which is based on Raspberry pi, Arduino
microcontrollers, and zigbee and relay boards to water plants. Raspberry pi acts as the control
block in the automatic irrigation system to control the flow of motor.
The commands from the Arduino are processed at raspberry pi. Zigbee module is used for
communication between the Raspberry pi and Arduino. This paper presents an efficient and
fairly cheap automation irrigation system. By using moisture sensor we will make the
irrigation system smart and automated. System once installed has no maintenance cost and is
easy to use[6].
Bhagyashree K.Chate , Prof.J.G.Rana ,”Smart irrigation system using Raspberry pi” The aim
of this paper is to develop a smart irrigation monitoring system using raspberry pi.Focus area
will be parameters such as temperature and soil moisture. This system will be a substitute to
traditional farming method .We will develop such a system that will help a farmer to know
his field status in his home or he may be residing in any part of the world. It proposes a
automatic irrigation system for the agricultural lands. Currently the automation is one of the
important role in the human life.
It not only provide comfort but also reduce energy, efficiency and time saving. Now the
industries are use automation and control machine which is high in cost and not suitable for
using in a farm field. So here it also design a smart irrigation technology in low cost which is
usable by Indian farmers. Raspberry pi is the main heart of the whole system.
An automated irrigation system was developed to optimize water use for agricultural crops.
Automation allows us to control appliances autom-atically. The objectives of this paper were
to control the water motor automatically, monitor the plant growth using webcam and we can
also watch live streaming of farm on android mobiles by using wi-fi.[7]
This project focuses on a smart irrigation system which is cost effective. As the technology is
growing and changing rapidly, Wireless sensing Network (WSN) helps to upgrade the
technology where automation is playing important role in human life. Automation allows us
to control various appliances automatically.
DC motor based vehicle is designed for irrigation purpose. The objectives of this paper were
to control the water supply to each plant automatically depending on values of temperature
and soil moisture sensors. Mechanism is done such that soil moisture sensor electrodes are
inserted in front of each soil. It also monitors the plant growth using various parameters like
height and width. Android app.[8]
Nikhil Agrawal , Smita Singhal “Smart Drip Irrigation System using Raspberry pi and Arduino” This
paper proposes a design for home automation system using ready-to-use, cost effective and
energy efficient devices including raspberry pi, arduino microcontrollers, xbee modules and
relay boards. Use of these components results in overall cost effective, scalable and robust
implementation of system.
The commands from the user are processed at raspberry pi using python programming
language. Arduino microcontrollers are used to receive the on/off commands from the
rasperry pi using zigbee protocol.Star zigbee topology serves as backbone for
thecommunication between raspberry pi and end devices.Raspberry pi acts a central
coordinator and end devices act as various routers.
Low-cost and energy efficient drip irrigation system serves as a proof of concept. The design
can be used in big agriculture fields as well as in small gardens via just sending an email to
the system to water plants. The use of ultrasound sensors and solenoid valves make a smart
drip irrigation system. The paper explains the complete installation of the system including
hardware and software aspects.[9]
Gajjala Ashok, Gogada Rajasekar, “Smart Drip Irrigation System using Raspberry Pi
and Arduino” This paper proposes a design for home automation system using ready-to-use,
cost effective and energy efficient devices including raspberry pi, arduino microcontrollers,
xbee modules and relay boards. Use of these components results in overall cost effective,
scalable and robust implementation of system.
The sensor data were uploaded in to cloud by raspberry pi using python programming
language. Arduino microcontrollers used to transmit the sensor data to the raspberry pi using
zigbee protocol. Star zigbee topology serves as backbone for the communication between
raspberry pi and end devices. Raspberry pi acts a central coordinator and end devices act as
various routers. Low-cost and energy efficient drip irrigation system serves as a proof of
concept.
The design can be used in big agriculture fields as well as in small gardens and water plants.
The use of ultrasound sensors and solenoid valves make a smart drip irrigation system. The
paper explains the complete installation of the system including hardware and software
aspects.[10]
Chapter 3
SYSTEM REQUIREMENTS AND SPECIFICATION
System requirement specification gives the complete description of the behavior about the
system developed by this project. This includes specification of functional and non functional
requirements of the application. The interaction of the users with the application is
represented with the help of use cases and there analysis. This also includes the description
about feasibility, risk analysis and external interface requirements to accomplish this project.
● Security
It is the feature of the system which ensures that system must be protected from the
unintentional or malignant harm.
● Performance
The way in which the system meets its performance targets is for it to
be specified clearly and explicitly. The system itself might not need anything
specifically for its basic operation, but the complete system along with the
components connected may have some Performance requirements.
User-friendly
The graphical user interface (GUI) is user-friendly.
● Usability
Usability determines how difficult it is to learn and use the system.
● Availability
It means for how long the system is available for its users and for how long the
system will be operational.
Reliability
Reliability determines how often the software fails. The measurement is expressed in
Mean Time Between Failures (MTBF). The system is completely tested for
robustness before the deployment. The module developed thus maintains data
consistency.
The performance of the software may be hinder due to various causes like unresponsive GUI and
misstep to execute given commands. One of the cause can be large-sized front end, which can
be changed by building light-weight GUI. Systems are advised to design in a way that front and back-
end can communicate directly.
HARDWARE REQUIREMENTS:
Arduino Uno
Raspberry Pi
Water Pump
Jump Wires
Bread Board
Motor driver
Laptop
Mobile phone
SOFTWARE REQUIREMENTS
Chapter 4
SYSTEM ANALYSIS AND DESIGN
Raspberry Pi: The Raspberry Pi is a low cost, credit-card sized computer. Its capable of
doing everything you’d expect a desktop computer to do, from browsing the internet and
playing high-definition video, making spreadsheets, and playing games. There are different
models of Raspberry Pi from Raspberry Pi 0 to Raspberry Pi 3.
Motor: A Motor is a device which converts electrical power into mechanical rotation using
the principle of electromagnetism. Electro-magnetism: A wire wound on a ferrite core
carrying electric current generates a magnetic field; this principle is called Electro-magnetism
DC motor:
DC motor in simple words is a device that converts direct current (electrical energy) into
mechanical energy.
Soil moisture Sensor: Soil moisture sensor includes comparator (LM393) which converts
analog data to discrete. Two soil probes consist of two thin copper wires each of 5 cm length
which can be immersed into the soil under test. The circuit gives a voltage output
corresponding to the conductivity of soil. The soil between the probes acts as a variable
resistance whose value depends upon moisture content in soil. The resistance across soil
probes can vary from infinity (for completely dry soil) to a very little resistance (for 100%
moisture in soil).
It consist of different types of sensing units such as Soil moisture sensor to measure water
content of soil, temperature sensor to detect the temperature. DC motor based vehicle is
designed for Irrigation purpose. Webcam is interfaced to Raspberry Pi using USB port. Robot
moves forward for 5 seconds. It stops at the 1st plant. Image of that plant is taken using
webcam. Raspberry Pi performs Image Processing which gives calculates the growth of plant
using height and width parameters. If the growth of plant is improper, it will spray fertilizer
on plant. If the growth of plant is proper, the soil moisture electrode is inserted in soil. The
set point for soil moisture sensor is 4000.
If the soil moisture value is less than 4000, water will be supplied for 2 seconds. If the soil
moisture value is less than 4000, water will be supplied for 1 second. If the soil moisture
value is greater than 4000, no water supply takes place. The Raspberry Pi will send all the
Information to the server using Wi-Fi. We are designing an Android App based server. The
android app has a GUI which will show all the data to user.
4.2 METHODOLOGY
The system can be represented using algorithms and algorithms are designed using
flowcharts.
The logics of the algorithm help to identify whether there is need of water to plant. Further,
logics and decision making conditions help soil moisture condition of the soil and it always
maintain moisture and also the user gets the status of the motor on the mobile. First the
moisture sensor senses the soil.
The output of the moisture is in the analog form. The ADC of the Arduino converts the
output of the moisture sensor into digital form. The digital value is then send to the Raspberry
pi through RF module which decides whether to soil is wet or dry and according to that water
the plant. If the soil is dry, Raspberry pi actuates the relay and water pump starts which leads
to water to flow. If the soil is wet, Raspberry pi turns the relay of as a result water pump is off
and water flow stop.
A Soil Moisture Sensor Probe to sense the soil moisture level. To make probe, we have
cut and etched a Copper clad Board according to the Picture shown below. One side of
the probe is directly connected to Vcc and other probe terminal goes to the base of BC547
transistor. A potentiometer is connected to the base of the transistor to adjust the
sensitivity of the sensor.
Raspberry Pi
Raspberry pi is a pocket personal computer with Linux operating system on it. This is
great cheap to encourage young people for learning, programming, experimenting and for
making innovation. Resembling like motherboard, raspberry pi has all the components to
connect inputs, outputs and storage.
Data flow diagram depicts the working of Raspberry pi using various sensors. The flow of
data with the help of Wi-Fi module and mobile which informs the farmer about the soil
moisture.
Chapter 5
IMPLEMENTATION
This includes the details about technologies used for the implementation of this projectand
control flow of all the modules and sub modules.
ARDUINO:
The Arduino microcontroller is an easy to use yet powerful single board computer that has
gained considerable traction in the hobby and professional market. The Arduino is open-
source, which means hardware is reasonably priced and development software is free. This
guide is for students in ME 2011, or students anywhere who are confronting the Arduino for
the first time. For advanced Arduino users, prowl the web; there are lots of resources. The
Arduino project was started in Italy to develop low cost hardware for interaction design.
The latest version, Raspberry Pi 3, was announced in February 2016. It comes with a 1.2GHz
64-bit quad-core ARMv8 CPU, 1GB RAM, built-in wireless/Bluetooth support and much to
program them using a variety of programming tools/environments. In this article, let’s get
started with programming on the Raspberry Pi using one of the most popular languages in the
world, Python.
The Raspberry Pi has been nothing short of a revolution in introducing millions of people
across the world to computing and being one of the drivers behind introducing computer
programming to everyone. It has powerful enough hardware to get started with programming
and the US$ 35 price tag is hard to beat.
The makers of Raspberry Pi have also paid special attention to ensuring that barriers to
getting started are minimal. The recommended Linux distribution for Raspberry Pi, Raspbian,
comes bundled with multiple programming languages and IDEs so that you are ready to go
from the time you power on the mini development board.
Python, on the other hand, is one of the most popular languages in the world and has been
around for more than two decades. It is heavily used in academic environments and is a
widely supported platform in modern applications, especially utilities, and desktop and Web
applications. Python is highly recommended as a language that is easy for newcomers to
program. With its easy-to-read syntax, the introduction is gentle and the overall experience
much better for a newbie.
The latest version of the Raspbian OS comes bundled with both Python 3.3 and Python 2.x
tools. Python 3.x is the latest version of the Python language and is recommended by the
Raspberry Pi Foundation too.
def gpio_setup() {
def check_for_pump_start()
{
main method {
//calls GPIO setup
gpio_setup() {
while (true)
#include <SoftwareSerial.h>
String password="dontconnect";
int old = 1;
void connectWIFI()
Serial.println(cmd);
mySerial.println(cmd);
delay(6000);
if(mySerial.find("OK")){
Serial.println("Connected!");
else{
Serial.println("Not Connected.");
mySerial.println("AT+CIPSTAMAC?");
connectWIFI();
cmd += server;
cmd += "\",8080";
mySerial.println(cmd);
delay(300);
//This is our HTTP GET Request change to the page and server you want to load.
if (old==0)
Serial.println(cmd);
mySerial.print("AT+CIPSEND=");
mySerial.println(cmd.length());
Serial.println("AT+CIPSEND="+cmd.length());
if(mySerial.find(">"))
mySerial.println(cmd);
else
Serial.println("Closed Connection");
mySerial.println("AT+CIPCLOSE");
void setup() {
Serial.begin(9600);
pinMode(VAL_PROBE, INPUT);
while (!Serial) {
// wait for serial port to connect. Needed for native USB port only
Serial.println("START");
mySerial.begin(9600);
connectWIFI();
getRequest("1");
//Serial.println(moisture);
if (moisture!=old){
old = moisture;
Serial.println(old);
getRequest(old+"");
if (mySerial.available())
Serial.write(mySerial.read())
app = Flask(__name__)
motorPin = 3
GPIO.setmode(GPIO.BCM)
GPIO.setup(motorPin, GPIO.OUT)
@app.route('/<state>')
def hello_world(state):
if state=1:
GPIO.output(motorPin, GPIO.HIGH)
else:
GPIO.output(motorPin, GPIO.LOW)
return 'done'
if __name__ == "__main__":
app.run(host='0.0.0.0',
port=8080, debug=True)
Chapter 6
TESTING
System testing is the process of checking the objective and requirements. It is a very critical
element of software quality assurance (SQA) and represents the review of specification,
design and coding. Testing represents an interesting anomaly i.e deviation from what is
actually required for the software. Thus, a series of tests are performed for the proposed
system before the system is ready for customer acceptance. Some of the various test cases
used to test the system are as follows
The test cases are written for testing against requirements of the unit being tested.
If the unit modifies the database, test for the integrity of the database after the
operation.
CHAPTER 7
RESULTS AND DISCUSSION
The results of the system is as shown below
Hardware Part
In this work, we successfully develop a system that can help in an automated irrigation
system by analyzing the moisture level of the ground. The smart irrigation system proves to
be a useful system as it automates and regulates the watering without any manual
intervention. The primary applications for this project are for farmers and gardeners who do
not have enough time to water crops/plants.
The moisture sensors and temperature sensor measure the moisture level (water content) and
temperature of the different plants. If the moisture level is found to be below the desired
level, the moisture sensor sends the signal to the Arduino board which triggers the Water
Pump to turn ON and supply the water to respective plant. The system may be further
extended for outdoor utilization.
CONCLUSION
Using this system, one can save manpower, water to improve production and
ultimately increase profit.
The automated irrigation system is feasible and cost effective for optimizing water
resources for agricultural production.
The system would provide feedback control system which will monitor and control all
the activities of irrigation system efficiently.
FUTURE WORK
This Smart irrigation proves to be the system automates for irrigation system and regulates
water for irrigation is done without manual Using this system, solenoid valves and relay
board can be controlled remotely which opens the opportunities to control the water flow as
well as the electrical flow.
Irrigation system is automated with depends on sensor Report the pump is operated by the
weather condition by soil, rain and temperature conditions the water pump will work and by
wireless zigbee the data is communicate and the sensor readings are uploaded into cloud
network by Wifi technology.
REFERENCES