FINAL Year Project Report
FINAL Year Project Report
Bachelor of Technology
In
Computer Science and Engineering
Under the Supervision of
M .r Amitas
Gangwar (Assistant
Professor)
By
DECLARATION
I hereby declare that this submission is my own work and that, to the best of my
knowledge and belief. It contains no matter previously published or written by any
other person nor material which to substantial extent has been accepted to the
award of any degree or diploma of the university or other institute of higher
learning except where due acknowledge has been made in the text.
Signature:
Name : Nikhil Goswami
Roll No 1716410163
Signature:
Name : Nitin Kumar Kashayap
Roll No 1716410164
Signature:
Name : Shikhar Srivastava
Roll No 1716410222
Signature:
Name : Shivam Tiwari
Roll No 1716410226
ii
CERTIFICATE
This is to certify that the project titled “Smart Plant Monitoring System”, which
is submitted by
in partial fulfilment of the requirement for the award of the degree of Bachelor of
Dr. A.P.J. Abdul Kalam Technical University, Lucknow during the academic year
2019-21, is the record of candidate’s own work carried out by him under my
supervision. The matter embodied in this report is original and has not been
ACKNOWLEDGEMENT
It gives us a great sense of pleasure to present the report of B.Tech. Project “Smart
Plant Monitoring System” undertaken during B.Tech. Final Year. We owe special debt of
gratitude to our project guide Mr. Amitas Gangwar (Assistant Professor, CSE), PSIT,
Kanpur for his constant support and guide throughout course of our work. His
sincerity, thoroughness and perseverance have been a constant source of inspiration for
us. It is only his cognizant efforts that our endeavors have seen light of the day.
We also do not like to miss the opportunity to acknowledge the contribution of all faculty
members of the department for their kind assistance and cooperation during the
development of our project. Last but not the least, we acknowledge our friends for their
contribution in the completion of the project.
Signature:
Name : Nikhil Goswami
Roll No 1716410163
Signature:
Name : Nitin Kumar Kashayap
Roll No 1716410164
Signature:
Name : Shikhar Srivastava
Roll No 1716410222
Signature:
Name : Shivam Tiwari
Roll No 1716410226
iv
ABSTRACT
In the IOT based smart plant monitoring system we can monitor and control using
system based on Ethernet. In this project we use different modules such as IOT,
This project uses sensors such as humidity sensor is also given to know about the
atmospheric humidity of that place. By having knowledge of all these one can take
action accordingly. Moisture sensor sense the soil is dry or wet. If soil is dry
automatically water pump will get ON. And the sensor values are given to ADC to
get processed by Arduino controller. The temperature sensor DHT11 senses the
the micro controller through ADC. The analog signal is converted into digital
certain hazards is will be very difficult to monitor the parameter through wires
wireless device to monitor the parameters so that we can take certain steps even
in worst case. Few years back the use of wireless device was very less, but due the
transfer through wireless like Wi-Fi, Bluetooth, WI-Max, etc. This project is
designed as a plant monitoring system based on IOT. The soil moisture value,
temperature and humidity values are updated in the internet through IOT module
TABLE OF CONTENTS
1. INTRODUCTION 1
1.1 Problem Statement 2
1.2 Purpose 2
1.3 Existing System 2
1.4 Proposed System 3
3
1.5 Architecture of Proposed System
4
1.6 Working of the proposed System
4
1.7 Prototype of Smart Plant Monitoring System
2. FEASIBILITY STUDY 5
2.1 Technical Feasibility 5
2.2 Operational Feasibility 5
2.3 Economic Feasibility 6
3. REQUIREMENT ELICITATION 7
3.1 Requirement Elicitation 7
3.2 Requirement Analysis 7
3.3 Requirement Gathering 8
vi
4. DESIGNING 10
4.1 Components Used 10
4.1.1 Arduino UNO 10
4.1.2 Temperature and Humidity Sensor 10
4.1.3 Soil Moisture Sensor 11
4.1.4 Light Sensor 11
4.1.5 Voltage Regulator 11
4.1.6 ESP-12F Wi-Fi module 12
4.1.3.1 Relay 12
4.1.3.2 DFD Level-1 13
4.1.4 Use Case Diagram 13
4.1.5 Activity Diagram 15
6. TESTING 37
6.1 Unit Testing 37
6.1.1 Testing Objectives 38
6.1.2 Features to Be Tested 38
6.2 Integration Testing 39
6.2.1 Big-Bang Testing 39
6.2.2 Bottom-Up Testing 39
6.2.3 Top-Down Testing 40
6.3 System Testing 40
6.4 Functional Testing 40
6.4.1 Black Box Testing 41
6.4.2 White Box Testing 42
6.4.2.1 Statement Testing 42
6.4.2.2 Branch Testing 43
6.5 Integration Testing 43
6.6 Acceptance Testing 44
7. FUTURE SCOPE 45
8. CONCLUSION 46
9. REFERENCES 47
viii
LIST OF FIGURES
CHAPTER 1
INTRODUCTION
Agriculture is the backbone of our country and most of the people depend on
agriculture. The water resource is not used in an effective manner, so the water is
wasted. In order to overcome this irrigation process can be automated. Internet of
Things (IoT) plays an important role in most of the fields. The agriculture is the
area where a lot of improvement is needed because that is one of the essential
needs and a large sector of people is involved in that. The use of Internet of things
in this field will be helpful to reduce the wastage of water. So that the temperature
as well as humidity and light are measured by means of sensors and depend up on
the outcome further processing can be performed. We propose a system that will
capture all the details about the soil and the temperature by means of different
sensors. The sensed information will be sent to the processor and depends up on
the outcome the alert message will be passed and the appropriate amount of water
will be released to the crop.
The IoT devices can also be used in home for monitoring the garden real time.
The Raspberry and Arduino plays an important role in processing the information
that is received from various sensors. The cost of these devices will be affordable.
Much research focus is on finding the effect of these devices in the environment,
if it causes any side effects to the humans. The Raspberry-pi is used wherever a
large amount of processing is required and Arduino in terms of interconnecting
certain hardware devices and performs a little amount of processing. The
installation of the sensors for finding the humidity level is one major factor to
avoid the wastage of water. The next process is to identify the temperature and
whether there is enough amount of light energy. So, in this situation the solution
can be identified by the farmers itself if they are equipped with a system that can
provide the details about the condition of the plant. These set of processes will be
helpful in the growth of the crop.
1.1 Problem Statement:
In the case of traditional irrigation system water saving is not considered. Since,
the water is irrigated directly in the land, plants under go high stress from
variation in soil moisture, therefore plant appearance is reduced. The absence of
automatic controlling of the system result in improper water control system. The
major reason for these limitations is the growth of population which is increasing
at a faster rate. At present there is emerging global water crisis where managing
scarcity of water has become a serious job. This growth can be seen in countries
which have shortage of water resources and are economically poor. So this is the
serious problem in Smart Irrigation System. So we want to design a Smart
Irrigation System which is based on IOT using Arduino microcontroller that
operate automatically by sensing the moisture content of the soil and turn
ON/OFF the pump using relay without the intervention of farmer and hence save
water.
1.2 Purpose:
Smart Plant Monitoring System using IOT Technology: Internet of Things
technology is suitable for the smart plant monitoring system. This is also suitable
to check the soil conditions as well, which may help to start a better growth of
a plant. It may support to control water usage and wastage of water.
2) When sensors get ON it will read the data from soil and from surrounding.
3) According to the values that are detected by sensors motor will turn ON/OFF.
4) If moisture value is below threshold value, then the relay will be activated and
the motor will be turn ON and adequate water will be supplied.
5) If moisture level is high, then it will stop the motor and water supply will also
stop.
6) All the values that are collected from sensor is send via ESP8266 Wi-Fi module
to the cloud server and it is stored in online database.
7) Cloud server will create the pie-chart for the data received by WI-FI module.
8) And, then whole information will show on the Webpage.
Chapter 2
FEASIBILITY STUDY
Proposed project is beneficial only if it can be turned into information systems that
will meet the user’s requirements. Simply stated, this test of feasibility asks if the
system will work when it is developed and installed. Are there major barriers to
Implementation? Here are questions that will help test the operational feasibility
of a project:
a. Is there sufficient support for the project from management from users?
If the proposed system is not highly accurate, there may be resistance.
b. Is a new business method acceptable to the user? If the new method is
actually helping the user, it is welcomed. Otherwise, a problem is there.
c. Has the user been involved in the planning and development of the
project?
d. Early involvement reduces the chances of resistance to the system and in
general and increases the likelihood of successful project. A huge and diverse
dataset surely supports.
e. Since the proposed system was to help take an important decision, our
findings express it to be operationally feasible.
CHAPTER 3
REQUIREMENT ELICITATION
CHAPTER 4
DESIGNING
In this chapter, the objectives are to learn, develop and furnish the project. To see,
step-wise how things are implemented and put together to bring the project live.
Our edible food items and everything is produced through a system which is
called irrigation system. The main objective is to take the irrigation, a next step
further. The major parameters to be measured, to make it smart is to monitor the
temperature and humidity (presence of rain) and then control the watering
system through the submersible pump. And, all these sensors and pump are
connected through the Arduino UNO. In simple words, on one side, the Arduino
UNO monitors the Temperature and Humidity though the respective sensors. And,
on the other hand Arduino checks the condition and judge if the watering is
necessary or not. The following steps guides through the procedure undertaken to
make Irrigation Smart:
Step1: In this above proposal two different types of sensors (i.e. Temperature&
moisture) are used to detect the required scarcity of water in the soil for proper
undergoing of the process, that is, for proper irrigation.
Step2: Required action by the help of controller (i.e. Arduino UNO) is to be taken
for the deficit of the physical parameters of the soil for a healthy process.
Step4: For the exact amount of water in the soil to be measured is to read the
analog output of the Moisture Sensor. According to the measured values the motor
will be switched on or off. Arduino will control all these processes.
Components used:
1. Arduino UNO:
Overview:
The Arduino Uno is a microcontroller board based on the ATmega328
(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM
outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a
power jack, an ICSP header, and a reset button. It contains everything needed to
support the microcontroller; simply connect it to a computer with a USB cable or
power it with a AC-to-DC adapter or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-
to-serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to
version R2) programmed as a USB-to-serial converter. Revision 2 of the Uno
board has a resistor pulling the 8U2 HWB line to ground, making it easier to put
into DFU mode. Revision 3 of the board has the following new features:
pinout: added SDA and SCL pins that are near to the AREF pin and two other new pins
placed near to the RESET pin, the IOREF that allow the shields to adapt to the voltage
provided from the board. In future, shields will be compatible both with the board that
use the AVR, which operate with 5V and with the Arduino Due that operate with 3.3V.
The second one is a not connected pin, that is reserved for future purposes.
Stronger RESET circuit.
At mega 16U2 replace the 8U2.
"Uno" means one in Italian and is named to mark the upcoming release of
Arduino 1.0. The Uno and version 1.0 will be the reference versions of Arduino,
moving forward. The Uno is the latest in a series of USB Arduino boards, and the
reference model for the Arduino platform; for a comparison with previous
versions, see the index of Arduino boards.
4. Light Sensor:
A light sensor is a passive sensor that is used to indicate the intensity of the light
by examining the radiant energy that exists in a certain range of frequencies. In
the spectrum of electromagnetic waves, the ranges of frequencies that are used to
detect using a sensor are between infrared to visible and up to ultraviolet. Light
sensors convert the light energy in the form of photons to electrical energy in the
form of electrons. Hence, they are also called as Photo Sensors or Photo Detectors
or Photo Electric Devices.
14
5. Voltage Regulator:
Features
• Output Current up to 1A
• Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V
• Thermal Overload Protection
• Short Circuit Protection
• Output Transistor Safe Operating Area Protection
The ESP-12F is a Wi-Fi module based on ESP8266, with built-in 32Mbit Flash, in
the small SMD22 package. There're also onboard PCB antenna and metal shield.
In short, it's a small form factor and fairly high cost effective Wi-Fi___33
modules.
With the pre-flashed AT firmware, you can control the module through UART AT
commands easily. The module integrates MCU inside, supports other
developments like Lau/Micro python/Arduino to achieve flexible and fast
prototyping, make it easy to integrate the module into IoT applications.
15
Features
7. Relay:
A relay is an electrical switch that uses an electromagnet to move the switch from
the off to on position instead of a person moving the switch. It takes a relatively
small amount of power to turn on a relay but the relay can control something that
draws much more power. Ex: A relay is used to control the air conditioner in your
home. The AC unit probably runs off of 220VAC at around 30A. That's 6600
Watts! The coil that controls the relay may only need a few watts to pull the
contacts together.
16
8.Motor:
An electric motor converts electrical energy into mechanical motion. The reverse
task, that of converting mechanical motion into electrical energy, is accomplished
by a generator or dynamo. In many cases the two devices differ only in their
application and minor construction details, and some applications use a single
device to fill both roles. For example, traction motors used on locomotives often
perform both tasks if the locomotive is equipped with dynamic brakes.
17
CHAPTER 5
CODING AND IMPLEMENTATION
22
Memory
The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2
KB of SRAM and 1 KB of EEPROM (which can be read and written with the
EEPROM library).
Input and Output
Each of the 14 digital pins on the Uno can be used as an input or output, using pin
Mode (), digital Write (), and digital Read () functions. They operate at 5 volts.
Each pin can provide or receive a maximum of 40 mA and has an internal pull-up
resistor (disconnected by default) of 20-50 ohms. In addition, some pins have
specialized functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. These pins are connected to the corresponding pins of the ATmega8U2
USB-to-TTL Serial chip.
External Interrupts: 2 and 3. These pins can be configured to trigger an
interrupt on a low value, a rising or falling edge, or a change in value. See the
attach Interrupt () function for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog Write
() function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10
bits of resolution (i.e. 1024 different values). By default, they measure from
ground to 5 volts, though is it possible to change the upper end of their range
using the AREF pin and the analog Reference () function. Additionally, some
pins have specialized functionality:
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using
the Wire library.
See also the mapping between Arduino pins and ATmega328 ports. The
mapping for the Atmega8, 168, and 328 is identical.
Communication
24
The Arduino Uno has a number of facilities for communicating with a
computer, another Arduino, or other microcontrollers. The ATmega328
provides UART TTL (5V) serial communication, which is available on digital
pins 0 (RX) and 1 (TX). An ATmega16U2 on the board channels this serial
communication over USB and appears as a virtual com port to software on the
computer. The '16U2 firmware uses the standard USB COM drivers, and no
external driver is needed. However, on Windows, a .in file is required. The
Arduino software includes a serial monitor which allows simple textual data to
be sent to and from the Arduino board. The RX and TX LEDs on the board will
flash when data is being transmitted via the USB-to-serial chip and USB
connection to the computer (but not for serial communication on pins 0 and 1).
A Software Serial library allows for serial communication on any of the Uno's
digital pins.
The ATmega328 also supports I2C (TWI) and SPI communication. The
Arduino software includes a Wire library to simplify use of the I2C bus; see the
documentation for details. For SPI communication, use the SPI library.
Programming
The Arduino Uno can be programmed with the Arduino software (download).
Select "Arduino Uno from the Tools > Board menu (according to the
microcontroller on your board). For details, see the reference and tutorials.
The ATmega328 on the Arduino Uno comes preboned with a bootloader that
allows you to upload new code to it without the use of an external hardware
programmer. It communicates using the original STK500 protocol (reference, C
header files).
You can also bypass the bootloader and program the microcontroller through
the ICSP (In-Circuit Serial Programming) header; see these instructions for
details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is
available. The ATmega16U2/8U2 is loaded with a DFU bootloader, which can
be activated by:
On Rev1 boards: connecting the solder jumper on the back of the board (near
the map of Italy) and then resetting the 8U2.
On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line
to ground, making it easier to put into DFU mode.
To test the sketch, we'll use an Arduino. You can use any microcontroller that can
do microsecond timing, but since it’s a
little tricky to code it up, we suggest verifying the wiring and sensor work with an
Arduino to start.
Begin by downloading the DHT library from our GitHub repository. To
download, click the DOWNLOADS button in the
top right corner. Rename the uncompressed folder DHT and make sure that it
contains the dht.cpp file and others.
Then drag the DHT folder into the Arduino sketch folder/libraries/ folder. You
may have to create that libraries subfolder
if it doesn’t exist. Restart the IDE. Now load up the Examples->DHT->DHTtester
sketch.
Code:
#include <SoftwareSerial.h>
#include <dht11.h>
dht11 DHT11; // create object of DHT11
#define dhtpin 9 // set the pin to connect to DHT11
const byte rxPin = 3;
const byte txPin = 2;
SoftwareSerial ESP8266(rxPin, txPin);
#define soilPin A0
#define ldrPin A1
#define rlyPin 10
#define rledPin 11
#define gledPin 12
#define bledPin 13
int i = 0, sv = 0, soilv = 0, lv = 0, ldrv = 0;
String A;
String B;
String C;
String D;
String E;
String F;
26
String TA = "N";
String LA = "N";
This will make the data appear correctly for the correct sensor. Upload the sketch!
You should see the temperature and humidity. You can see changes by breathing
onto the sensor (like you would to
fog up a window) which should increase the humidity.
You can add as many DHT sensors as you line on individual pins, just add new
lines such as
DHT dht2 = DHT(pin, type);
below the declaration for the initial dht object, and you can reference the new dht2
whenever you like.
soilv = analogRead(soilPin);
delay(100);
sv = 1023 - soilv;
ldrv = analogRead(ldrPin);
delay(100);
lv = 1023 - ldrv;
Serial.print("Temperature:");
Serial.print(getTemp('C'));
Serial.println("C ");
// Serial.print(getTemp('F'));
// Serial.print("F ");
// Serial.print(getTemp('K'));
// Serial.print("K ");
Serial.print("Humidity:");
Serial.print (humidity);
Serial.println("%");
Serial.print("Soil Moisture: ");
Serial.print(sv);
Serial.println();
Serial.print("Light: ");
Serial.println(lv);
// Serial.print("i=");
// Serial.println(i);
// if (i == 20) {
// i = 0;
// for (int n = 0; n < 5; n++) {
// Serial.println("UPDATING DATA");
// iotupdate(String(getTemp('C')), String(humidity), String(sv), String(lv),
String(TA), String(LA));
// delay(3000);
// }
// }
//
// i++;
void connectserver() {
// ESP8266.println("AT");
// delay(1000);
//lcd.clear();
// lcd.setCursor(0, 1);
// lcd.print("ConnectingServer");
Serial.println("connectingserver");
ESP8266.println("AT+CIPMUX=1");
delay(200);
ESP8266.println("AT+CIPSTART=4,\"TCP\",\"www.itechbuilders.com\",80");//
208.91.198.130 192.168.1.19
delay(200);
}
}
30
CHAPTER 6
TESTING
Software Testing is an investigation conducted to provide stakeholders with
information about the quality of the product or service under test. Software
Testing can also provide an objective, independent view of the software to allow
the business to appreciate and understand the risks of software implementations.
Test techniques include the process of executing a program or application with the
intent of finding software bugs (errors or other defects), and verifying that the
software product is fit for use.
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.
In Computer programming, unit testing is a software testing method by which
individual units of source code, sets of one or more computer program modules
together with associated control data, usage procedures, and operating procedures,
are tested to determine whether they are fit for use.
Unit testing is a software development process in which the smallest testable parts
of an application, called units, are individually and independently scrutinized for
proper operation. Unit testing can be done manually but is often automated.
Unit testing is usually conducted as part of a combined code and unit test phase of
the software lifecycle, although it is not uncommon for coding and unit testing to
be conducted as two distinct phases.
1. Test strategy
2. Approach
Field testing will be performed manually and functional tests will be written in
detail.
internal workings. In our project, valid input is image resultant output well-
structured image should be received.
this technique, we can check what the source code is expected to do and what it
should not. It can also be used to check the quality of the code and the flow of
different paths in the program. The main drawback of this technique is that we
cannot test the false condition in it.
The main idea of statement testing coverage is to test every statement in the
object’s method by executing it at least once. However, realistically, it is
impossible to test a program on every single input, so you never can be sure that a
program will not fail on some input.
6.4.2.1 Branch Testing
The main idea behind branch testing coverage is to perform enough tests to ensure
that every branch alternative has been executed at least once under some test. As
in statement testing coverage, it is unfeasible to fully test any program of
considerable size.
Branch Coverage is a testing method, which aims to ensure that each one of the
possible branches from each decision point is executed at least once and thereby
ensuring that all reachable code is executed.
That is, every branch taken each way, true and false. It helps in validating all the
branches in the code making sure that no branch leads to abnormal behaviour of
the application.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
38
TESTING RESULTS
39
1. Soil Moisture Sensor Value:
(a) In case there is no water in the plant the soil moisture sensor value will be
between 0 to 300 and the red LED will be on and relay and the pump will be on .
It is shown below:
40
(b) In case there is water up to level one in the plant the soil moisture sensor value
will be between 300 to 700 and the red LED as well as green LED will be on and
relay will be off. It is shown below:
41
(c) In case there is water up to level two in the plant the soil moisture sensor value
will be between 700 to 1023 and the red LED, green LED and blue LED will be
on and relay as well as pump will be off. It is shown below:
42
2. Light Sensor value: If the light value is greater than 400, it shows day
time:
If the light value is less than 400, it will show night time and will give us a light
alert:
44
CHAPTER 7
FUTURE SCOPE
The future scope of this project can be comprehended in many aspects such as
to add camera module to detect whether the plants are getting enough resources
and whether they are growing without any resistances. Camera module clicks
picture and send it through mail. Our project can be improvised by using a
sensor to note the soil ph value such that usage of unnecessary Fertilizers can
be reduced. A water meter can be installed to estimate the amount of water used
for irrigation and thus giving a cost estimation. Further, it also reduces the
investment of farmers. In addition to the excess cost of water, labour is becoming
more and more expensive. 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 a smart drip irrigation
system to water plants using devices like raspberry pi, Arduino microcontrollers.
This type of agriculture application of Internet of things in the real world
environment is necessary to know the effect of the environment on such system.
So is always better to know the risks beforehand.
45
CHAPTER 8
CONCLUSION
By completing this project, a smart irrigation system has been implemented
using Arduino UNO module. It is an automated system and beneficial for
mankind. This project proposes a design for smart home garden irrigation
system that implements ready-to-use, energy-efficient, and cost effective devices.
REFERENCES
[1] Y.G. Gawali, D.S. Chaudhuri, H.C. Chaudhuri, “Review paper on Automated
irrigation system using WSN”, IJARECE Volume 5, Issue 6, June 2016.
[2] A. Joshi, L. Ali, “Survey on auto irrigation system”, IEEE Catalog Number
CFP17D81- POD, March 2017.
[4] D. Rane, P.R. Indurkar, “Review paper on Automatic irrigation system using
RF module”, IJAICT vol 1, Issue 9, January 2015.
[5] B.K. Chate.J.G. Rana,” Smart irrigation system using Raspberry pi”, IRJET,
vol 3 issue 5, May 2016.