BlackBook Report
BlackBook Report
ON
SUBMITTED TO THE
UNIVERSITY OF MUMBAI
BACHELOR OF ENGINEERING
IN
COMPUTER ENGINEERING 2017-2018
Submitted by
BACHELOR OF ENGINEERING
IN
COMPUTER ENGINEERING
by
Kevin Dias Roll No.13
Larissa Fernandes Roll No.16
Agin Jose Roll No.71
Supervisor (s):
Ms. Shafaque Fatma Syed
Ms. Ditty Varghese
2017-2018
CERTIFICATE
by Kevin Dias, Larissa Fernandes and Agin Jose is approved for the degree
of Computer Engineering course of Bachelor of Engineering.
Examiners
1.______________________________
2.______________________________
Date:
Place:
DECLARATION
I declare that this written submission represents my ideas in my own words and
where others' ideas or words have been included, I have adequately cited and
referenced the original sources. I also declare that I have adhered to all
principles of academic honesty and integrity and have not misrepresented or
fabricated or falsified any idea/data/fact/source in my submission. I understand
that any violation of the above will be cause for disciplinary action by the
Institute and can also evoke penal action from the sources which have thus not
been properly cited or from whom proper permission has not been taken when
needed.
--------------------------------------------------
(Signature)
2. Ms. Larissa Fernandes, 16
--------------------------------------------------
(Signature)
3. Mr. Agin Jose, 71
--------------------------------------------------
(Signature)
Date:
ABSTRACT
Chili crop is very essential to the Indian economy since it is the largest producer and
consumer of chili. Since the crop is easily affected by environmental conditions like change in
temperature, humidity and easily susceptible to diseases caused by bacteria or pests, the yield
of the crop is affected. The demand being so high and the supply being limited, measures need
to be taken to prevent diseases from attacking the crop. This project focuses on a methodology
that proposes stress analysis as a measure to predict diseases. This can be prevented by
performing stress analysis and calculating the evapotranspiration rate of the plant. Using
thermal imaging and a decision support system which will continuously monitor the
environmental changes, a statistical as well as an analytical report can be provided to the
farmer with the help of which he can make effective decisions which will benefit the growth of
the crop.
i
CONTENTS
• ABSTRACT i
• CONTENTS ii
• LIST OF FIGURES iv
• LIST OF TABLES v
• ABBREVIATIONS vi
1. Introduction 1
1.1. Introduction 1
2. Literature Survey 3
2.1. Introduction 3
3. Problem Statement 6
3.1. Scope 6
4. System Analysis 7
4.4. Analysis 8
ii
4.6. Methodology 14
4.8. Architecture 15
5. Implementation 18
5.1. Module I 18
5.2. Module II 19
5.4. Module IV 26
5.5. Module V 30
8. Conclusion 38
9. References 39
10. Appendix 40
iii
List of Figures
Figure No. Figure Title Page No.
1.1 Country Wise Share in Chilli Production 1
4.1 Arduino UNO 9
4.2 Soil Moisture Sensor 10
4.3 Temperature and Humidity Sensor 10
4.4 Leaf Wetness Sensor 11
4.5 Raspberry Pi 2 11
4.6 Methodology 15
4.7 System Architecture 16
4.8 System Flow 17
5.1 Location 18
5.2 Sowing Seeds 18
5.3 Testing Sensor Circuit 19
5.4 Installing the Hardware 20
5.5 Installing Sensor System 20
5.6 Installed Sensor System 21
5.7 DynamoDB on AWS 22
5.8 Tables Created in DynamoDB 23
5.9 WSN Table 23
5.10 Cam Table 24
5.11 Amazon EC2 Server 25
5.12 EC2 Instance Running 25
5.13 Humidity data vs Time 26
5.14 Leaf Wetness data vs Time 27
5.15 Moisture data vs Time 27
5.16 Temperature Data data vs Time 28
5.17 Infrared Images of Chili Crop 29
5.18 Main Page 31
5.19 Sensor Selection Page 31
5.20 Temperature Graph 32
5.21 Humidity Graph 32
5.22 Soil Moisture Graph 33
5.23 Leaf Wetness Graph 33
5.24 RGB Graph 34
6 Results Page 35
iv
List of Tables
Table No. Table Title Page No.
7.1 Timeline 36
7.2 Task Distribution 37
v
Abbreviation
vi
1. Introduction
1.1 Introduction
India the ‘Land of spices’ is the largest producer, consumer and exporter of spices with
mammoth share in the world trade. India claims to have the spices production of 76 lakh MT,
consumption of 73 lakh MT and export of 3.8 lakh MT of spices in the world with 57 lakh
hectares of land under cultivation.
Chilli popularly known as 'wonder spice' is a major spice crop as well as vegetable crop
grown in many countries. India is the largest producer and consumer of chilli, and rich in
almost 50 varieties with contribution about 36% to the total world production. Chilli is an
indispensable condiment and used in the daily diet of every Indian household in one or the
other form. India is meeting approximately 25% of the world's chilli requirement and
considered to be leader in chilli exporting followed by China with 24%. Major importers of
Indian chillies are Sri-lanka, Bangladesh, U.K., Germany, France and U.S.A.Chilli crop is
essential to India and its economy. Therefore, producing a better yield of the crop is
considered as an important goal to be achieved. The crop is sensitive to environmental
conditions, for example, excess water, humidity, hot weather conditions. It is necessary to
Monitor the crop periodically to avoid such conditions which could lead the crop to attracting
diseases. Since the demand is so high and the supply is limited, measures need to be taken to
prevent diseases from attacking the crop and increasing the yield of the crop.
As chilli crops are sensitive to environmental conditions and highly susceptible to diseases,
our aim is to create a system that will perform stress analysis of the crop and calculate the
evapotranspiration rate. After which we can observe if the plant is under stress or not.
Following which we can detect which disease has occurred. Currently this is done using
satellites, what we aim to do is carry out stress analysis of the crop using proximity sensors.
This project will help in detecting whether the plant is under stress or not using a
thermographic camera. Which in turn will allow us to predict if the crop will get affected by
the disease and the extent to which it is affected by the disease. By predicting the disease, we
can increase the yield of chilli crop and ensure the proper growth of the plant. Chilli plant
disease detection through leaf image and data processing techniques is very useful especially
for assisting farmers in monitoring big plantation areas.
First chapter of the report contains Introduction to this project which explains why this
project is undertaken and the concepts associated with it. Second chapter of the report
consists of Literature survey where key for improvements in existing technologies is
determined. Chapter 3 explains problem statement, Chapter 4 deals with designing of the
system. Chapter 5 is divided into 5 phases. Chapter 6 discusses results in details. Rest of the
report deals with conclusion and future scope.
2
2. Literature Survey
2.1 Introduction
This project required extensive research to be undertaken in order to figure out all the diseases
that occur in chilli crops around the world. This research focused on the different types of
diseases that can occur in the crop and the conditions due to which they happen. IEEE papers
were used as source material for the research. This research also focused on the image
processing techniques that were to be used to get a detailed database the plants and their
leaves. The findings from the IEEE papers are summarised as follows.
2.1.1 Feasibility Study on Plant Chili Disease Detection Using Image Processing
Techniques
This paper discusses how an image is captured, resized and how image feature extraction and
image recognition take place. Thus, chili plant disease detection through leaf image and data
processing techniques is very useful and inexpensive system especially for assisting farmers in
monitoring big plantation areas.
Accurate detection of plant disease is very important for the successful cultivation of crop and
this can be done using image processing for detection of plant diseases. It discusses various
techniques to segment the disease part of the plant. We learnt about image acquisition, image
pre-processing, image segmentation, feature extraction, detection and classification of
diseases.
2.1.3 Agriculture field monitoring and analysis using wireless sensor networks for
improving crop production
The purpose of this project was to avoid the agricultural land from the unwanted weather
change, pests and so on, make great sense for farming production. Thus it designed and
developed an agricultural monitoring system using wireless sensor network to increase the
productivity and quality of farming without observing it for all the time manually.
Considering temperature, humidity and carbon dioxide levels as the most important factors
for the productivity, growth, and quality of plants in agriculture, this system periodically
measures these parameters inside the fields, thus the farmers or the agriculture experts can
observe the measurements from the web simultaneously. We have inferred the idea of this
project, various sensors used for monitoring many environmental parameters to achieve
3
maximum crop yield and better productivity. Also, we have learnt about the data transmission
techniques and a secured approach for Wireless Sensor Network.
2.1.4 Better crop management with decision support systems based on wireless sensor
networks
This paper focuses on adequate control of environmental parameters and makes efficient use
of the resources through the implementation of constant monitoring systems because the
environments of crop are highly dynamic; therefore systems that support the decision-taking
process constitute a very valuable tool. The prototype implemented includes tools that
provide real-time information about the crop status, surrounding environment and potential
risks such as pests and diseases. Thus, we’ve studied that the system shows different aspects
about a particular crop; the information provided by the monitoring system provides the crops
managers with valuable tools for supporting their decision-making processes. Also, the
project helped us understand to include metrics for the evaluation of parameters related to the
behaviour thresholds during the different stages and to utilize an experimental design
methodology that allows increasing efficiency, economy and scientific objectivity for the
resources.
This paper gathers information about the low-cost wireless monitoring system for agricultural
ecosystems. The prototype monitoring system consists of a number of intelligent wireless
sensor nodes, which are connected to an Internet-enabled computer system installed on site to
store and disseminate relevant soil information and to provide remote access to the
monitoring system. We have learned the concept of embedding mobile software agents into
wireless sensor nodes that can largely enhance the efficiency and the reliability of monitoring
systems deployed in agriculture. We have understood the concept of (i) autonomous
communications among the sensor nodes, (ii) cooperative decision making in real time, (iii)
dynamic adaptations to changing environmental conditions, and (iv) remote access for
relevant soil information.
2.1.6 Simultaneous usage of optic and thermal hyperspectral sensors for crop water
stress characterization
4
Visible-Near InfraRed (VNIR) and Thermal InfraRed (TIR) simultaneous information is
crucial in order to carry out a reliable description of crop water stress condition.
High-resolution hyperspectral data sets are required to characterize the energy flux exchange
between surface and atmosphere, and to estimate the crop daily evapotranspiration (ETd).
The conventional method for leaf disease detection consists of calling an expert person who
can identify the diseases based on his experience and that costs too much for an average
farmer in a developing country such as India as mentioned above. The conventional system
depends on human vision and tends to human error in some cases even with an expertise.
Hence an alternative is required for a country like India where a low cost but technology
dependent system is required. The best alternative is nothing but Image processing as it
provides promising results than any other sensor based techniques.
Referring to the above literature surveys, we understood the requirements of chili crops, also
the environment needed for its growth. The systems that are existing are WSN based Decision
Support Systems to monitor Chili Crops. Temperature and humidity levels are the most
important factors for the productivity, growth, and quality of chili plant in agriculture. So, the
system periodically measured these parameters inside the fields. Thus, the farmers or the
agriculture experts could observe the measurements from the website or an android app
simultaneously. Moreover, when a critical change in one of the measurements occurs, then the
farmer will be intimated about the possible disease range. However, the existing system could
not perform stress analysis and did not use image processing to identify leaf features.
5
3. Problem Statement
Chili crops are very sensitive to environmental conditions and easily susceptible to diseases.
The root cause of naturally occurring diseases (Ones that occur without any intervention) is
stress on the plant. These diseases can be prevented by performing stress analysis and
calculating the evapotranspiration rate of the plant. Using thermal imaging and developing a
prediction system which monitors the evapotranspiration rate of the crop and performs stress
analysis. Predicting if the plant is under stress or not and reporting it to the farmer with a
statistical as well as analytical report with the help of which he can make effective decisions
which will benefit the growth of the crop.
3.1 Scope
The scope of the project is to develop a system that will monitor the environmental conditions
of the farmland on which the crops are growing and provide a statistical report to the farmer.
It is a decision support making system which will allow the farmer to take quick decisions to
increase the yield of the crop. Predicting the possibility of a disease and reporting it to the
farmer at the earliest can help the farmer take essential measures to prevent the disease from
occurring.
6
4. System Analysis
The systems that are existing are WSN based Decision Support Systems to monitor Chilli
Crops. Temperature and humidity levels are the most important factors for the productivity,
growth, and quality of chili plant in agriculture. So, the system periodically measured these
parameters inside the fields. Thus, the farmers or the agriculture experts could observe the
measurements from the website or an android app simultaneously. Moreover, when a critical
change in one of the measurements occurs, then the farmer will be intimated about the
possible disease range. However, the existing system could not perform stress analysis and
did not use image processing to identify leaf features.
We intended to design an efficient system that captures and stores the stress levels of a chili
crop and analyses the data for better disease prediction using Image processing techniques.
The proposed system works in three stages, Capture plant stress levels using a thermographic
camera at regular intervals; store, analyse, and process said data using Image processing to
compose a data set; Using the composed data set that’s available to predict if the plant is under
stress. In stage one, we will capture thermographic images of the chili crop from a static place
at regular intervals and store the RGB values in a database. RGB (red, green, and blue) refers
to a system for representing the colors to be used on a computer display. Red, green, and blue
can be combined in various proportions to obtain any color in the visible spectrum. Levels of
R, G, and B can each range from 0 to 100 percent of full intensity. In stage two, RGB values
will be recorded and compared with the average RGB values that are calculated. If the
recorded RGB values have a higher percentage of Blues then the image is getting colder and
hence the water level in the plant is climbing. If on the other hand, the recorded RGB values
have a higher percentage of Reds then the image is getting hotter and hence the water level in
the plant is dropping. In stage three, with the help of the recorded values we can plot a graph
to analyse the stress pattern in the crop. If the graph plotted is linear in nature then the crop is
healthy and is getting the right amount of water: However, if the graph plotted is not linear the
plant is under duress. This system works along with an array of wireless sensor network to get
7
readings such as soil moisture, temperature, leaf wetness, and humidity; which continually
check for a disease pattern.
4.3 Feasibility of the Proposed System
The scope of the project is wide and better features can be implemented to improve the yield
of crop with each iteration. As the major focus of the project is to develop a cost efficient and
user-friendly yet a powerful system. The components that are being implemented in this
project is cost-efficient as these components are available in the market at a cheaper rate. As
proposed we will developing an Application which will run on Android Operating System
which is an open source operating system in which we can keep on adding more and more
features in the near-future. Hence, the project is economically feasible.
4.4 Analysis
The first phase of the system is to measure various parameters that affects the crop such as
temperature, humidity, soil moisture and water level using various sensors.
The second phase is to take thermal images using a camera at regular intervals of time of
leaves of the plant and create a data set.
The third phase of the system is where the transmission of data takes place.
The fourth phase of the system processes the collected and data and transmits to an online
database. Also in this phase, we use image processing algorithms like otsu and k-means
clustering on the images captured.
In the fifth phase, we perform data analysis and prediction using prediction algorithms like
KNN and make a data set with the values we get from images.
The basic hardware of the system consists of 4 sensors, namely temperature sensor, moisture
sensor, humidity sensor and the thermographic sensor. The first three sensors are a part of the
existing system and are connected to the Arduino Uno. To conduct stress analysis, it was
decided that the forth sensor would be a thermographic sensor, so as to map the temperature of
the chili plant that is directly proportional to its stress level. The Thermographic sensor is
connected directly to the Raspberry Pi. Once an hour the system will be powered on and the
data from all the 4 sensors is collected and send to the database via a sim module.
8
4.5 Software and Hardware Details
The Arduino Uno is a microcontroller board based on the ATmega328. 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 to be connected to a
computer with a USB cable and needs power supply.
The Soil Moisture Sensor (Y69) uses capacitance to measure the water content of soil by
measuring the dielectric permittivity of the soil, which is a function of the water content. The
sensor is inserted into the soil to be tested, and the volumetric water content of the soil is
reported in percent.
9
Fig 4.2 Soil Moisture Sensor
Temperature and Humidity sensor (DHT11) features a temperature and humidity sensor
complex with a calibrated digital signal output. By using the exclusive digital-signal
acquisition technique and temperature and humidity sensing technology, it ensures high
reliability and excellent long-term stability.
Raindrop detection sensor (YL83) module is an easy-to-use and low cost drop recognition
sensor. The sensor works through a series of exposed parallel traces on board which produces
electrical variations when drops or water volume changes. By using microcontrollers or ADC
10
ICs (Arduino and PIC) it’s fairly easy to convert the analogue output from the sensor to
digital values. This can be directly read by an Arduino or a comparator circuit if you wish to
use it as a rain detection alarm. I can be used to monitor a variety of weather conditions.
4.5.1.5 Raspberry Pi 2
The Raspberry Pi 2 is the replacement of the B+ and features a 900MHz quad core CPU and
1GB of ram. It has 40 pin extended GPI, 4x USB 2.0 ports, Stereo out and composite video
port, HDMI port, CSI and DSI ports, Micro SD card slot and a Micro USB power source.
11
4.5.2 Software Details
4.5.2.1 PHP
PHP is a open source, interpreted and object-oriented scripting language i.e. executed at
server side. It is used to develop web applications (an application i.e. executed at server side
and generates dynamic page).
4.5.2.2 DynamoDB
Amazon DynamoDB is a fast and flexible NoSQL database service for all applications that
need consistent, single-digit millisecond latency at any scale. It is a fully managed cloud
database and supports both document and key-value store models. Its flexible data model,
reliable performance, and automatic scaling of throughput capacity make it a great fit for
mobile, web, gaming, ad tech, IoT, and many other applications.
4.5.2.3 Python
An interpreted language, Python has a design philosophy which emphasizes code readability
(notably using whitespace indentation to delimit code blocks rather than curly braces or
keywords), and a syntax which allows programmers to express concepts in fewer lines of
code than possible in languages such as C++ or Java.
4.5.2.4 JavaScript
4.5.2.5 HTML
Hypertext Markup Language (HTML) is the standard markup language for creating web
pages and web applications. With Cascading Style Sheets (CSS) and JavaScript, it forms a
12
triad of cornerstone technologies for the World Wide Web.[4]
Web browsers receive HTML
documents from a web server or from local storage and render the documents into multimedia
web pages. HTML describes the structure of a web page semantically and originally included
cues for the appearance of the document.
4.5.2.6 PhoneGap
4.5.2.8 OpenCV
OpenCV (Open Source Computer Vision Library) is an open source computer vision and
machine learning software library. OpenCV was built to provide a common infrastructure for
computer vision applications and to accelerate the use of machine perception in the
commercial products. Being a BSD-licensed product, OpenCV makes it easy for businesses to
utilize and modify the code. The library has more than 2500 optimized algorithms, which
includes a comprehensive set of both classic and state-of-the-art computer vision and machine
learning algorithms. These algorithms can be used to detect and recognize faces, identify
objects, classify human actions in videos, track camera movements, track moving objects,
extract 3D models of objects, produce 3D point clouds from stereo cameras, stitch images
together to produce a high resolution image of an entire scene, find similar images from an
image database, remove red eyes from images taken using flash, follow eye movements,
recognize scenery and establish markers to overlay it with augmented reality, etc.
13
4.5.2.8 Amazon EC2
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure,
resizable compute capacity in the cloud. It is designed to make web-scale cloud computing
easier for developers. Amazon EC2’s simple web service interface allows you to obtain and
configure capacity with minimal friction. It provides you with complete control of your
computing resources and lets you run on Amazon’s proven computing environment. Amazon
EC2 reduces the time required to obtain and boot new server instances to minutes, allowing
you to quickly scale capacity, both up and down, as your computing requirements change.
Amazon EC2 changes the economics of computing by allowing you to pay only for capacity
that you actually use. Amazon EC2 provides developers the tools to build failure resilient
applications and isolate them from common failure scenarios.
4.5.2.9 CSS
Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of
a document written in a markup language.[1]
Although most often used to set the visual style
of web pages and user interfaces written in HTML and XHTML, the language can be applied
to any XML document, including plain XML, SVG and XUL, and is applicable to rendering
in speech, or on other media. Along with HTML and JavaScript, CSS is a cornerstone
technology used by most websites to create visually engaging web pages, user interfaces
for web applications, and user interfaces for many mobile applications
4.6 Methodology
Waterfall methodology was selected to be the methodology that was to be followed for the
project. Waterfall is a project management approach where a project is completed in distinct
stages and moved step by step until the product is ready. In our project the first stage was to
procure all the necessary resources that would be needed for the project. After which work
was started on the hardware implementation followed by the server architecture and then
Data collection.The next part of the system was to do the prediction and the analysis using the
sensor values. After the front end was made the entire system was integrated. The final stage
was to debug and test the system.
14
Fig 4.7 Methodology
The basic hardware of the system consists of 4 sensors, namely temperature sensor, moisture
sensor, humidity sensor and the thermographic sensor. These three sensors are connected to
the Raspberry Pi. To perform stress analysis, it was decided that a fourth sensor would be
added that is a thermographic sensor, so as to map the temperature of the chili plant that is
directly proportional to its stress level. The Thermographic sensor is connected directly to the
Raspberry Pi. Once an hour the system will be powered on and the data from all the 4 sensors
is collected and send to the database via a Sim module.
4.8 Architecture
The system consists of 10 major components: The solar panel, Lipo Battery, Arduino Nano,
Charging Module, Raspberry PI, leaf wetness sensor, temperature and humidity sensor, soil
moisture and Thermographic Sensor. The battery is charged using a charging module using
power from the solar panel and keeps it ready to use when needed. A buck converter converts
the erratic output voltage of the battery to a suitable voltage level. A low power
microcontroller (Arduino Nano) will have power all the time. At regular intervals the
microcontroller will send power to a Raspberry Pi. The raspberry Pi when boots starts
15
executing scripts to capture data values from the sensors and once done another script stores
them to a database that is created in DynamoDB. The machine learning algorithms are
deployed the Amazon EC2 server. These algorithms take input from the database and the
predict that if under the current conditions if the plant is that the risk of disease or not. These
results are the accessible to the user via the user interface that is a mobile phone application.
The solar panel charges the Li Po battery using the charging module. The battery powers the
arduino nano which powers the raspberry pi and the three sensors- YL 83 (Leaf Wetness
Sensor), YL 69 (Soil Moisture), DHT11 (Temperature and humidity Sensor) and Thermal
Camera. The Raspberry Pi collects data from these sensors and sends it to the DynamoDB
database using the Sim Module. The EC2 server collects data and computes all calculations
and sends required data on the User Interface (Android App)
16
4.9 System Flow
The solar panel charges the Li Po battery using the charging module. The battery powers
the arduino nano which powers the raspberry pi and the three sensors- YL 83 (Leaf
Wetness Sensor), YL 69 (Soil Moisture), DHT11 (Temperature and humidity Sensor) and
Thermal Camera. The Raspberry Pi collects data from these sensors and sends it to the
DynamoDB database using the Sim Module. The EC2 server collects data and computes
all calculations and sends required data on the User Interface (Android App)
17
5. Implementation
5.1 Module I – Experimental Setup
A test-bed has been chosen at Don Bosco Institute of Technology, Kurla (w), Mumbai. Long
term weather-based experiments will be carried out on 2 test-beds. One test-bed is of 10x10
square meter and the other one is of 5x5 square meter. Chilli seeds has been sowed in these
test beds.
18
5.2 Module 2 – Installation and Implementation of Hardware
In the above-mentioned field after the plant was grown upto a certain height we immediately
implemented our sensor circuit and fixed it in the field so that the data collection process
begins. The Arduino microcontroller was connected with all the circuits and it was
programmed to collect with and interval of 55 min. This data collected by the Arduino was
transmitted to the Raspberry Pi via serial input mode. The Raspberry Pi would collect this
data and during the initial stages would store it within the database that resided inside
raspberry pi. Later on after testing and fixing all the issues we connected a dongle and
programmed the pi to upload data to the online database directly.
19
Fig. 5.4 Installing the hardware
20
The solar-panel was mounted on top at an of 45 degree to utilise its maximum current
generating capacity. The box consisted of a Raspberry Pi, Battery and Arduino UNO. Rest of
the sensor circuits such as soil moisture and Leaf Wetness Sensor where placed on the
ground. The Temperature and Humidity Sensor was placed just below the box. This entire
circuit served us as the base station which would transmit data to our online database via
Airtel Dongle. The entire circuit was driven by its own current that is being generated by the
solar panel. During the day time the solar panel would charge the battery and the battery was
able to support the circuit and keep it running 24/7.
21
5.3 Module 3 – Storing Collected Data
Amazon DynamoDB is a fast and flexible NoSQL database service for all applications that
need consistent, single-digit millisecond latency at any scale. It is a fully managed cloud
database and supports both document and key-value store models. Its flexible data model,
reliable performance, and automatic scaling of throughput capacity make it a great fit for
mobile, web, gaming, ad tech, IoT, and many other applications.
A database instance named Chilli was created with two tables. This database instance is used
to store all the data collected from the sensors. The two table that were created were WSN, to
store data from the sensor network and, the other table was Cam, to store the pixel values of
the thermographic values of the plants.
22
Fig 5.8 Tables created in DynamoDB
A table named WSN was created with the following parameters in the given order srno,
humidity, leafWetness, soilMoisture, temp and time to store the details about the sensors.
23
Another table named Cam was created with the following parameters in the given order srno,
blue, green, red, status to store all the RGB values of the thermal images .
5.3.3 Server
We created an amazon EC2 instance which is used to connect to the database. This server was
used to run the prediction algorithms that would predict if the plant is healthy or at the risk of
a disease.
24
Fig 5.11 Amazon EC2 Server
25
The data collected by the raspberry pi is being uploaded to the server with a time interval of
55 min. In this way, we can collect 24 sensor readings each day. Raspberry pi can connect
with the database and upload its data by using the HTTP Request method.
The aim of this module was to predict if under the current conditions of temperature,
humidity and moisture, if the plant healthy or at the risk of a disease. To do so data was
collected from the sensors and stored in the table in DynamoDB. The data was collected
using the hardware setup that contained 4 sensors. They were the temperature sensor,
humidity sensor, leaf wetness sensor and the soil moisture sensor. These readings were taken
through a Raspberry Pi at intervals of 1 hour.
26
Fig 5.14 Leaf wetness data vs time
27
Fig 5.16 Temperature data vs time
At the same time when the data was being collected, images were taken from the infrared
camera as well. Once the images were taken from the infrared camera, we used OpenCV, a
python image processing library to obtain pixel values of each infrared image. We then took
the average of each of the red pixels, blue pixels and green pixels and stored these values in a
table on DynamoDB.
28
Fig 5.17 Infrared images of the chilli crop
After trying out a few algorithms for our prediction, we shortlisted K nearest neighbour
algorithm. K-Nearest Neighbours is one of the most basic yet essential classification
algorithms in Machine Learning. It belongs to the supervised learning domain and finds
intense application in pattern recognition, data mining and intrusion detection. It is widely
disposable in real-life scenarios since it is non-parametric, meaning, it does not make any
underlying assumptions about the distribution of data.
KNN falls in the supervised learning family of algorithms. Informally, this means that we are
given a labelled dataset consisting of training observations (x,y)(x,y) and would like to
capture the relationship between xx and yy. More formally, our goal is to learn a function
h:X→Yh:X→Y so that given an unseen observation xx, h(x)h(x) can confidently predict the
corresponding output yy.
29
The algorithm was coded in python and deployed on the AWS EC2 server. The algorithm
took various inputs like all the sensor data from the sensors and the pixel values from the
infrared camera. The algorithm then could predict that under the current conditions if the
plant is healthy or at the risk of a disease. This algorithm would run each time the predict
button was clicked on the android application.
The collected data can be viewed by the users by logging into the app and seeing statistical
data plotted in the form of graphs. The user interface of the app is very easy to use and can
allow the user to view all the data in the simplest form. When a user enters the app, he can see
the latest reading values the sensors have picked up. From there he can navigate to a page
which displays the various sensors. On clicking on any sensor icon,it takes you to a page of
that particular sensor, where a graph is displayed of all the reading values with the
maximum,minimum and average value displayed at the bottom. There is also a disease
prediction page which runs a machine learning algorithm on the data set and predicts if
currently the crop is stressed or not.
An android application was used to act as a user interface for the system. Whenever the user
opens this application, latest values from the sensors are seen. These values reflect the current
conditions of the plot of the chili crop plantation currently under observation.
30
Fig 5.18 Main Page
After clicking on the sensor button on the main page,it takes you to a page that displays all
the sensors. The options available are Humidity, Soil Moisture, Temperature, Leaf Wetness
and the vales from the IR camera.
31
5.5.1.2.1 Temperature
By clicking on the temperature icon, a graph is displayed of the sensor values over a period of
time with the minimum,average and maximum temperature displayed at the bottom.
5.5.1.2.2 Humidity
By clicking on the humidity icon, a graph is displayed of the sensor values over a period of
time with the minimum,average and maximum temperature displayed at the bottom.
32
5.5.1.2.3 Soil Moisture
By clicking on the soil moisture icon, a graph is displayed of the sensor values over a period
of time with the minimum,average and maximum temperature displayed at the bottom.
By clicking on the leaf icon, a graph is displayed of the sensor values over a period of time
with the minimum,average and maximum temperature displayed at the bottom.
33
5.5.1.2.5 Camera
By clicking on the camera icon, a graph is displayed of the red,blue and green over a period
of time.
34
6. Results
The system that is built is a remote sensor network that takes readings from the plot on
an hourly basis. It continuously monitors the plot for values of Temperature, Humidity,
Leaf Wetness and Soil Moisture to analysis the growth of the crop. At the same time
images are taken of the crops in an infrared spectrum. These values are stored in a comma
separated value format in the Raspberry Pi. The values are then uploaded to the database
that is created on Amazon DynamoDB. The machine learning algorithms that are
continuously running on the server that is created on Amazon EC2 service predicts that
under the current conditions if the crops are at the risk of a disease of are safe. These
results, along with the reading from the sensors are then displayed to the user through a
front end. The front end of choice was an android application that was made using
PhoneGap. The android application displays the reading of the sensor values in the form of
a graph to make it easier to access if there are any drastic changes or anomalies in the
patterns. The user can thus take the necessary steps needed to make sure the plants remain
healthy.
35
7.Project Timeline and Task Distribution
36
Table 7.1 Task Distribution
37
8. Conclusion
The main aim of our project is to increase the yield of chilli crops by creating a user friendly
and cost efficient sensing and prediction system with the help of which farmers can forsee the
future of their crops life and take any essential precautions required to stop the disease from
affecting the crop. While the currently available systems were designed to tackle any one
single disease, by comparing the values recorded by the various sensors that were employed to
collect data in the field, the chances of these diseases occurring in the plant were minimal and
so we decided to take a step back and focus on a single problem that is the root cause of many
diseases, stress level of the plant. Although, there are many diseases that are caused by insects
and pests; the root cause of naturally occurring diseases (Ones that occur without any
intervention) is stress on the plant. This can be calculated and quantified only using a
thermographic sensor. Our system tackles stress analysis using proximity sensors rather than
using GIS technologies that proves to be inconsistent at times. The sensing system will help
the farmer to monitor the environmental conditions around the field on which the crops are
growing. As by monitoring the crop and comparing their standard environmental requirements
with the gathered data value will help the system to make a precise and an accurate prediction
of any disease that might affect the crop in the near-future
38
References
[1] Zulkifli Bin Husin, Abdul Hallis Bin Abdul Aziz, Ali Yeon Bin Md Shakaff ,Rohani Binti
S Mohamed Farook “Feasibility study on plant Chili disease detection using image processing
techniques” 2012 Third International Conference on Intelligent Systems Modelling and
Simulation
[2] G.T. Hariharan, G.P.S Hariharan, R. Vijay Anandh, “Crop disease identification using
image processing” Vol 6. Issue 4 March 2016, International Journal of Latest Trends in
Engineering and Technology (IJLTET)
[3] Ms. P.R. Patil, Prof. N.B. Bhawarkar, “Crop diseases detection with preventive measures
using image processing” International Journal of Engineering Research and Applications
(IJERA) ISSN: 2248-9622
[4] B. Balaji Bhanu K. Raghava Rao Professor J.V.N. Ramesh Mohammed Ali hussain
“Agriculture field monitoring and analysis using wireless sensor networks for improving crop
production” 2014 Eleventh International Conference on Wireless and Optical
Communications Networks (WOCN)
[5] Luca Pipia, Fernando Pérez, Anna Tardà, Lucas Martínez, and Roman Arbiol
“Simultaneous usage of optic and thermal hyperspectral sensors for crop water stress
characterization” Institut Cartogràfic de Catalunya (ICC) Parc de Montjuïc s/n, 08038
Barcelona, Spain
[7] Sandesh Raut Kartik Ingole International Research Journal of Engineering and Technology
(IRJET)“Review On leaf disease detection using image processing techniques” April -2017
Volume: 04 Issue: 04
39
Appendix I: Code Sample
1. Program Embedded in Arduino UNO
#include <dht.h>
//#include <avr/wdt.h>
DHT11_PIN 7
void setup() {
Serial.begin(9600);
analogRead(A1); int
chk=DHT.read11(DHT11_PIN);
(Serial.available() == 0);
choice=Serial.parseInt();
if(choice=1) { delay(2000);
Serial.println(DHT.temperature); delay(1000);
Serial.println(DHT.humidity); delay(1000);
Serial.println(soil); delay(1000);
Serial.println(rain);
40
op=os.listdir("/dev")
for i in op:
if "ACM" in i:
return i
ser = serial.Serial('/dev/'+getPort(),9600)
f=open("readings.txt",'w')
x=ser.readline()
print "%s" % x
i=i+1;
f.write(x)
f.close() ser.flushInput()
ser.close()
setup() {
Serial.begin(9600);
} void loop() {
if(Serial.available()>0)
Serial.write(Serial.read());
import requests
41
f=open("readings.txt",'r')
temp=f.readline()
humidity=f.readline()
soilm=f.readline() water=f.readline()
f.close() url='http://chilicroptest.esy.es/upload_data.php'
payload={'temp':str(temp),'humidity':str(humidity),'soil':str(soilm),'water':str(water)}
cd chilli
# will read from folder and create new resized image in dest folder
import os
import cv2
import csv
import numpy as np
from tabulate import tabulate #can print a list in table format in terminal
file_name = './pics'
def image_mean():
all_means = [['pic_name','blue','green','red']] # just to make life easy for printing into csv
42
pic_num = 1
match = False
img = cv2.imread(current_image_path)
b,g,r = cv2.split(img) # split image into blue, green, and red arrays.
pic_means = [image_name,np.mean(b),np.mean(g),np.mean(r)]
all_means.append(pic_means)
print "blue_mean",np.mean(b)
print "green_mean",np.mean(g)
print "red_mean",np.mean(r)
print "-------------------------------------------"
pic_num += 1
print tabulate(all_means,headers="firstrow",tablefmt='orgtbl')
writer = csv.writer(f)
writer.writerows(all_means)
f.close()
43
image_mean()
var fs = require('fs');
accessKeyId: "AKIAJURP5BIQVXH4G3UQ",
secretAccessKey:
"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",
region: 'ap-south-1'
});
lr = new LineByLineReader('sd.csv');
});
lr.pause();
console.log(line);
setTimeout(function () {
var params = {
TableName: "WSN",
44
Item:{
"srno": parts[0],
"humidity": parts[6],
"leafWetness": parts[4],
"soilMoisture": parts[3],
"temp": parts[5],
};
if (err) {
console.log(err);
} else {
console.log("Done!");
});
lr.resume();
}, 00);
});
lr.on('end', function () {
});
/*
45
var params = {
TableName: "WSN",
Item:{
"srno": ,
"humidity": ,
"leafWetness": ,
"soilMoisture": ,
"temp": ,
"time":
};
if (err) {
} else {
});
*/
8. Program to send RGB values of thermal images from csv file to DynamoDb
var fs = require('fs');
accessKeyId: "AKIAJURP5BIQVXH4G3UQ",
46
secretAccessKey:
"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",
region: 'ap-south-1'
});
lr = new LineByLineReader('rgb.csv');
});
lr.pause();
console.log(line);
setTimeout(function () {
var params = {
TableName: "Cam",
Item:{
"srno": parts[0],
"blue": parts[1],
"green": parts[2],
"red": parts[3],
"status": parts[4],
47
};
if (err) {
console.log(err);
} else {
console.log("Done!");
});
lr.resume();
}, 00);
});
lr.on('end', function () {
});
var fs = require('fs');
48
var PythonShell = require('python-shell');
console.log(req);
var response;/*
var options = {
mode: 'text',
scriptPath: '.',
pythonPath: 'bin/python3',
args: ['test']
};
});
*/
var options = {
mode: 'text',
scriptPath: '.',
49
pythonPath: 'python',
args: ['test']
};
res.send(results);
/*
var params = {
Bucket: s3Object.Bucket,
res.send(filerdata);
else {
console.log(data);
res.send(filerdata);
50
});
});
*/ });
app.listen(port);
<!DOCTYPE html>
<html>
<head>
<title>Chilli Crop</title>
<meta charset="utf-8">
maximum-scale=1.0, user-scalable=no">
</head>
<body id="top">
<div class="bgded"
style="background-image:url('images/demo/backgrounds/chilli.jpg');">
<ul class="clear">
51
<ul>
<li><a href="pages/temp.html">Temperature</a></li>
<li><a href="pages/humidity.html">Humidity</a></li>
</ul>
</li>
<ul>
</ul>
</nav>
<div id="logo">
</div>
</header>
</div>
<article>
<div class="introtxt">
52
</div>
<footer>
</ul>
</footer>
</article>
</div>
</div>
<div class="clear"></div>
</main>
</div>
<script src="layout/scripts/jquery.min.js"></script>
<script src="layout/scripts/jquery.backtotop.js"></script>
<script src="layout/scripts/jquery.mobilemenu.js"></script>
<script src="layout/scripts/jquery.placeholder.min.js"></script>
53
<!-- / IE9 Placeholder Support -->
<script>
xhttp.onreadystatechange = function() {
console.log("here");
document.getElementById("leafwet").innerHTML = "Leaf
Wetness:"+data.Items[data.Items.length-1].leafWetness;
"+data.Items[data.Items.length-1].soilMoisture;
document.getElementById("temper").innerHTML = "Temperature:
"+data.Items[data.Items.length-1].temp;
document.getElementById("humid").innerHTML = "Humidity:
"+data.Items[data.Items.length-1].humidity;
// //console.log(data.Items[0])
// Itemdata[i] = {};
// }
// // console.log(data.Items[i].time);
54
// // var dataItem = {
// // label: data.Items[i].time,
// // y : data.Items[i].temp
// // }
// // Itemdata.push(dataItem);
// // console.log(dataItem)
// Itemdata[i].y = parseInt(data.Items[i].soilMoisture)
// }
// console.log(Itemdata)
// title:{
// },
// data: [
// {
// type: "column",
// dataPoints: Itemdata
// }
// ]
// });
55
// chart.render();
};
xhttp.send();
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Temperature</title>
<meta charset="utf-8">
maximum-scale=1.0, user-scalable=no">
<style type="text/css">
.floating-box {
display: inline-block;
width: 120px;
height: 150px;
margin: 10px:}
56
</style>
</head>
<body id="top">
<div class="bgded"
style="background-image:url('../images/demo/backgrounds/chilli.jpg');">
<ul class="clear">
<ul>
<li><a href="temp.html">Temperature</a></li>
<li><a href="humidity.html">Humidity</a></li>
</ul>
</li>
<ul>
</ul>
</nav>
<div id="logo">
57
<h2><a href="../index.html">Sensors</a></h2>
</div>
</header>
</div>
</div>
<div class="content">
<div id="gallery">
<figure>
<center>
<header class="heading"></header>
src="../images/demo/gallery/humidity.jpg" alt="Humidity"
style="width:30%;height:30%;"><figcaption><br>Humidity</figcaption></figure><
/a></li>
style="width:150px;height:150px;"><figcaption><br>Soil
Moisture</figcaption></figure></a></li>
58
<li class="one_quarter first"><a href="temp.html"><figure><img
src="../images/demo/gallery/temp.jpg" alt="Temperature"
style="width:190px;height:190px;"><figcaption><br><br>Temperature</figcaption
></figure></a></li>
style="width:190px;height:190px;"><figcaption><br><br>IR
Camera</figcaption></figure></a></li>
style="width:240px;height:240px;"><figcaption>Leaf
Wetness</figcaption></figure></a></li>
</ul-->
src="../images/demo/gallery/humidity.jpg" alt="Humidity"
style="width:80%;height:80%;"><figcaption><br>Humidity</figcaption></figure><
/a></div>
style="width:80%;height:80%;"><figcaption><br>Soil
Moisture</figcaption></figure></a></div>
src="../images/demo/gallery/temp.jpg" alt="Temperature"
59
style="width:80%;height:80%;"><figcaption><br>Temperature</figcaption></figur
e></a></div>
style="width:80%;height:80%;"><figcaption><br>IR
Camera</figcaption></figure></a></div>
style="width:100%;height:100%;"><figcaption>Leaf
Wetness</figcaption></figure></a></div>
</div>
</div>
<div class="clear"></div>
</main>
</div>
</div>
<script src="../layout/scripts/jquery.min.js"></script>
<script src="../layout/scripts/jquery.backtotop.js"></script>
<script src="../layout/scripts/jquery.mobilemenu.js"></script>
60
<script src="../layout/scripts/jquery.placeholder.min.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Temperature</title>
<meta charset="utf-8">
maximum-scale=1.0, user-scalable=no">
</head>
<body id="top">
<div class="bgded"
style="background-image:url('../images/demo/backgrounds/chilli.jpg');">
<ul class="clear">
61
<li><a class="drop" href="sensor.html">Sensors</a>
<ul>
<li><a href="humidity.html">Humidity</a></li>
</ul>
</li>
<ul>
</ul>
</nav>
<div id="logo">
<h2><a href="../index.html">Temperature</a></h2>
</div>
</header>
</div>
</div>
62
<!-- End Top Background Image Wrapper -->
<div class="content">
<div class="content">
</div>
<div class="clear"></div>
</main>
</div>
<script src="../layout/scripts/jquery.min.js"></script>
<script src="../layout/scripts/jquery.backtotop.js"></script>
<script src="../layout/scripts/jquery.mobilemenu.js"></script>
63
<!-- IE9 Placeholder Support -->
<script src="../layout/scripts/jquery.placeholder.min.js"></script>
<script>
var highestHumidity = 0;
var humiditySum = 0;
var humidityCount = 0;
xhttp.onreadystatechange = function() {
console.log("here");
//document.getElementById("demo").innerHTML = this.responseText;
//console.log(data.Items[0])
Itemdata[i] = {};
// console.log(data.Items[i].time);
64
// var dataItem = {
// label: data.Items[i].time,
// y : data.Items[i].temp
// }
// Itemdata.push(dataItem);
// console.log(dataItem)
Itemdata[i].label = data.Items[i].time.split("-")[0];
Itemdata[i].y = parseInt(data.Items[i].temp)
humiditySum += humidityThis;
console.log(humidityThis)
humidityCount++;
//Sort
document.getElementById('hh').innerHTML = highestHumidity;
document.getElementById('lh').innerHTML = lowestHumidity;
document.getElementById('ah').innerHTML =
((humiditySum/humidityCount).toFixed(2));
console.log(Itemdata)
65
var chart = new CanvasJS.Chart("chartContainer", {
title:{
text: "Temperature"
},
data: [
type: "column",
dataPoints: Itemdata
});
chart.render();
};
xhttp.send();
</script>
</body>
66
</html>
<html>
<head>
<title>Temperature</title>
<meta charset="utf-8">
maximum-scale=1.0, user-scalable=no">
</head>
<body id="top">
<div class="bgded"
style="background-image:url('../images/demo/backgrounds/chilli.jpg');">
<ul class="clear">
<ul>
<li><a href="temp.html">Temperature</a></li>
67
<li><a href="soil.html">Soil Moisture</a></li>
</ul>
</li>
<ul>
</ul>
</nav>
<div id="logo">
<h2><a href="../index.html">Humidity</a></h2>
</div>
</header>
</div>
</div>
<div class="content">
<div class="content">
68
<div id="chartContainer" style="height: 370px; width: 100%;"></div>
</div>
<div class="clear"></div>
</main>
</div>
</div>
<script src="../layout/scripts/jquery.min.js"></script>
<script src="../layout/scripts/jquery.backtotop.js"></script>
<script src="../layout/scripts/jquery.mobilemenu.js"></script>
<script src="../layout/scripts/jquery.placeholder.min.js"></script>
<script>
69
var highestHumidity = 0;
var humiditySum = 0;
var humidityCount = 0;
xhttp.onreadystatechange = function() {
console.log("here");
//document.getElementById("demo").innerHTML = this.responseText;
//console.log(data.Items[0])
Itemdata[i] = {};
// console.log(data.Items[i].time);
// var dataItem = {
// label: data.Items[i].time,
// y : data.Items[i].temp
// }
70
// Itemdata.push(dataItem);
// console.log(dataItem)
Itemdata[i].label = data.Items[i].time.split("-")[0];
Itemdata[i].y = parseInt(data.Items[i].humidity)
humiditySum += humidityThis;
console.log(humidityThis)
humidityCount++;
//Sort
document.getElementById('hh').innerHTML = highestHumidity;
document.getElementById('lh').innerHTML = lowestHumidity;
document.getElementById('ah').innerHTML =
((humiditySum/humidityCount).toFixed(2));
console.log(Itemdata)
71
var chart = new CanvasJS.Chart("chartContainer", {
title:{
text: "Humidity"
},
data: [
type: "column",
dataPoints: Itemdata
});
chart.render();
};
xhttp.send();
</script>
</body>
</html>
72
13. Android Application- soil.html
<!DOCTYPE html>
<html>
<head>
<title>Leaf Wetness</title>
<meta charset="utf-8">
maximum-scale=1.0, user-scalable=no">
</head>
<body id="top">
<div class="bgded"
style="background-image:url('../images/demo/backgrounds/chilli.jpg');">
<ul class="clear">
<ul>
<li><a href="humidity.html">Humidity</a></li>
73
<li><a href="temp.html">Temperature</a></li>
</ul>
</li>
<ul>
</ul>
</nav>
<div id="logo">
</div>
</header>
</div>
</div>
<div class="content">
74
<div class="content">
</div>
<div class="clear"></div>
</main>
</div>
<script src="../layout/scripts/jquery.min.js"></script>
<script src="../layout/scripts/jquery.backtotop.js"></script>
<script src="../layout/scripts/jquery.mobilemenu.js"></script>
<script src="../layout/scripts/jquery.placeholder.min.js"></script>
<script>
var highestHumidity = 0;
var humiditySum = 0;
var humidityCount = 0;
75
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
console.log("here");
//document.getElementById("demo").innerHTML = this.responseText;
//console.log(data.Items[0])
Itemdata[i] = {};
// console.log(data.Items[i].time);
// var dataItem = {
// label: data.Items[i].time,
// y : data.Items[i].temp
// }
// Itemdata.push(dataItem);
// console.log(dataItem)
Itemdata[i].label = data.Items[i].time.split("-")[0];
76
Itemdata[i].y = parseInt(data.Items[i].soilMoisture)
humiditySum += humidityThis;
console.log(humidityThis)
humidityCount++;
//Sort
document.getElementById('hh').innerHTML = highestHumidity;
document.getElementById('lh').innerHTML = lowestHumidity;
document.getElementById('ah').innerHTML =
((humiditySum/humidityCount).toFixed(2));
console.log(Itemdata)
title:{
77
text: "Soil Moisture"
},
data: [
type: "column",
dataPoints: Itemdata
});
chart.render();
};
xhttp.send();
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
78
<title>Leaf Wetness</title>
<meta charset="utf-8">
maximum-scale=1.0, user-scalable=no">
</head>
<body id="top">
<div class="bgded"
style="background-image:url('../images/demo/backgrounds/chilli.jpg');">
<ul class="clear">
<ul>
<li><a href="humidity.html">Humidity</a></li>
<li><a href="temp.html">Temperature</a></li>
</ul>
</li>
79
<li><a class="drop" href="#">Imaging</a>
<ul>
</ul>
</nav>
<div id="logo">
</div>
</header>
<div class="content">
<div class="clear"></div>
</main>
</div>
80
<!-- JAVASCRIPTS -->
<script src="../layout/scripts/jquery.min.js"></script>
<script src="../layout/scripts/jquery.backtotop.js"></script>
<script src="../layout/scripts/jquery.mobilemenu.js"></script>
<script src="../layout/scripts/jquery.placeholder.min.js"></script>
<script>
var highestHumidity = 0;
var humiditySum = 0;
var humidityCount = 0;
xhttp.onreadystatechange = function() {
console.log("here");
//document.getElementById("demo").innerHTML = this.responseText;
//console.log(data.Items[0])
81
for(var i=0; i<data.Items.length; i++){
Itemdata[i] = {};
// console.log(data.Items[i].time);
// var dataItem = {
// label: data.Items[i].time,
// y : data.Items[i].temp
// }
// Itemdata.push(dataItem);
// console.log(dataItem)
Itemdata[i].label = data.Items[i].time.split("-")[0];
Itemdata[i].y = parseInt(data.Items[i].leafWetness)
humiditySum += humidityThis;
console.log(humidityThis)
humidityCount++;
//Sort
82
Itemdata.sort((a, b) => parseInt(a.label) - parseInt(b.label));
document.getElementById('hh').innerHTML = highestHumidity;
document.getElementById('lh').innerHTML = lowestHumidity;
document.getElementById('ah').innerHTML =
((humiditySum/humidityCount).toFixed(2));
console.log(Itemdata)
title:{
},
data: [
type: "column",
dataPoints: Itemdata
});
chart.render();
83
}
};
xhttp.send();
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Leaf Wetness</title>
<meta charset="utf-8">
maximum-scale=1.0, user-scalable=no">
</head>
<body id="top">
<div class="bgded"
style="background-image:url('../images/demo/backgrounds/chilli.jpg');">
84
<header id="header" class="hoc clear">
<ul class="clear">
<ul>
<li><a href="humidity.html">Humidity</a></li>
<li><a href="temp.html">Temperature</a></li>
</ul>
</li>
<ul>
</ul>
</nav>
<div id="logo">
</div>
</header>
85
</div>
</div>
display:block;"></div>
display:block;"></div>
display:block;"></div>
<div >
</div>
<!--
<div class="clear"></div>
</main>
</div>
86
</div>
<script src="../layout/scripts/jquery.min.js"></script>
<script src="../layout/scripts/jquery.backtotop.js"></script>
<script src="../layout/scripts/jquery.mobilemenu.js"></script>
<script src="../layout/scripts/jquery.placeholder.min.js"></script>
<script>
var highestHumidity = 0;
var humiditySum = 0;
var humidityCount = 0;
xhttp.onreadystatechange = function() {
console.log("here");
//document.getElementById("demo").innerHTML = this.responseText;
console.log(data.Items[0])
87
var ItemdataR = [], ItemdataG = [], ItemdataB = [];
ItemdataR[i] = {};
ItemdataG[i] = {};
ItemdataB[i] = {};
ItemdataR[i].y = parseInt(data.Items[i].red)
ItemdataG[i].y = parseInt(data.Items[i].green)
ItemdataB[i].y = parseInt(data.Items[i].blue)
humiditySum += humidityThis;
console.log(humidityThis)
humidityCount++;
88
}
//document.getElementById('hh').innerHTML = highestHumidity;
//document.getElementById('lh').innerHTML = lowestHumidity;
//document.getElementById('ah').innerHTML =
((humiditySum/humidityCount).toFixed(2));
//console.log(Itemdata)
title:{
},
data: [
type: "column",
dataPoints: ItemdataR
});
89
animationEnabled: false, // change to true
title:{
},
data: [
type: "column",
dataPoints: ItemdataG
});
title:{
},
data: [
type: "column",
dataPoints: ItemdataB
90
]
});
chartR.render();
chartG.render();
chartB.render();
};
xhttp.send();
function red() {
function green() {
function blue() {
91
document.getElementById("chartContainerG").style = "display: none;";
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Leaf Wetness</title>
<meta charset="utf-8">
maximum-scale=1.0, user-scalable=no">
</head>
<body id="top">
<div class="bgded"
style="background-image:url('../images/demo/backgrounds/chilli.jpg');">
92
<nav id="mainav" class="clear">
<ul class="clear">
<ul>
<li><a href="humidity.html">Humidity</a></li>
<li><a href="temp.html">Temperature</a></li>
</ul>
</li>
<ul>
</ul>
</nav>
<div id="logo">
</div>
93
</header>
</div>
</div>
<div class="content">
<div class="content">
follows:</h1>
<div id="ans"></div>
<script>
xhttp.onreadystatechange = function() {
document.getElementById("ans").innerHTML = xhttp.responseText;
};
94
xhttp.open("GET", "http://13.127.253.158:8081/", true);
xhttp.send();
</script>
</div>
<div class="clear"></div>
</main>
</div>
</div>
<script src="../layout/scripts/jquery.min.js"></script>
<script src="../layout/scripts/jquery.backtotop.js"></script>
<script src="../layout/scripts/jquery.mobilemenu.js"></script>
<script src="../layout/scripts/jquery.placeholder.min.js"></script>
</body>
</html>
import csv
95
import random
import math
import operator
lines = csv.reader(csvfile)
dataset = list(lines)
for x in range(len(dataset)-1):
for y in range(4):
dataset[x][y] = float(dataset[x][y])
trainingSet.append(dataset[x])
else:
testSet.append(dataset[x])
distance = 0
for x in range(length):
return math.sqrt(distance)
96
distances = []
length = len(testInstance)-1
for x in range(len(trainingSet)):
distances.append((trainingSet[x], dist))
distances.sort(key=operator.itemgetter(1))
neighbors = []
for x in range(k):
neighbors.append(distances[x][0])
return neighbors
def getResponse(neighbors):
classVotes = {}
for x in range(len(neighbors)):
response = neighbors[x][-1]
if response in classVotes:
classVotes[response] += 1
else:
classVotes[response] = 1
reverse=True)
return sortedVotes[0][0]
97
correct = 0
for x in range(len(testSet)):
if testSet[x][-1] == predictions[x]:
correct += 1
def main():
print 'x'
# prepare data
trainingSet=[]
testSet=[]
split = 0.67
# generate predictions
predictions=[]
k=3
for x in range(len(testSet)):
result = getResponse(neighbors)
predictions.append(result)
98
print('Accuracy: ' + repr(accuracy) + '%')
main()
99
PUBLICATION PAPER
12345
Department of Computer Engineering, Don Bosco Institute of Technology, Mumbai, India.
1
[email protected], [email protected], [email protected], [email protected],
5
[email protected]
Abstract— Chilli crop is very essential to the Indian almost 50 varieties of chilli with contribution of about 36% to
economy since it is the largest producer and consumer of the total world production. Chili is an indispensable condiment
chilli. Since the crop is easily affected by environmental and used in the daily diet of every Indian household in one or
conditions like change in temperature, humidity and easily the other form. India is meeting approximately 25% of the
susceptible to diseases caused by bacteria or pests, the yield world's chilli requirement and is considered to be leader in chilli
of the crop is affected. The demand being so high and the exporting followed by China with 24%. [1] Major importers of
supply being limited, measures need to be taken to prevent Indian chillies are Sri-lanka, Bangladesh, U.K., Germany,
diseases from attacking the crop. This paper discusses about France and U.S.A. Since chilli crop is easily affected by
a methodology that proposes stress analysis as a measure to environmental conditions like change in temperature, humidity
predict diseases. This can be prevented by performing stress and easily susceptible to diseases caused by bacteria or pests,
analysis and calculating the evapotranspiration rate of the the yield of the crop is affected. Since the demand is so high and
plant. Using thermal imaging and a decision support system the supply is limited, measures need to be taken to prevent
which will continuously monitor the environmental changes, diseases from attacking the crop and increasing the yield of the
a statistical as well as an analytical report can be provided crop.
to the farmer with the help of which he can make effective
decisions which will benefit the growth of the crop. II. PROBLEM STATEMENT
Chili crops are very sensitive to environmental conditions and
Keywords— Evapotranspiration rate; Stress Analysis; easily susceptible to diseases. The root cause of naturally
Thermal Imaging; chilli crop; disease prediction occurring diseases (Ones that occur without any intervention)
is stress on the plant. These diseases can be prevented by
performing stress analysis and calculating the
evapotranspiration rate of the plant. Using thermal imaging
I. INTRODUCTION and a decision support system which will continuously
monitor the environmental changes, we can provide the
India is the largest producer, consumer and exporter of chilli.
farmer with a statistical as well as an analytical report with
It is one of the most important commercial crops of India. In
the help of which he can make effective decisions which will
India, chilli is grown in most states. [1] Red chillies are grown
benefit the growth of the crop.
across India on 792,000 hectares of land in Andhra Pradesh,
Karnataka, Madhya Pradesh and Maharashtra. The crop is
Thus, this can be prevented by using thermal imaging and
planted in the months of August and September, and harvested
developing a prediction system which monitors the
in March and April. 1,376,000 million tons of red chilli crops
evapotranspiration rate of the crop and performs stress
are produced in India every year, out of which 70% is consumed
analysis. Predicting if the plant is under stress or not and
domestically, and 30% of it is exported. [1] India is rich in
reporting it to the farmer with a statistical as well as analytical is nothing but Image processing as it provides promising
report with the help of which he can make effective decisions results than any other sensor based techniques.
which will benefit the growth of the crop.
Phase two: The second phase is to take thermal images using VI. SYSTEM ARCHITECTURE
a thermographic camera at regular intervals of time of healthy
and diseased leaves and create a data set.
The system consists of 8 major components: The solar panel,
Phase three: The third phase of the system is where the Rechargeable Battery, Buck Converter, Arduino Nano,
transmission of data takes place. Arduino Uno, Raspberry PI, XBee, and Thermographic
Sensor. The battery holds power from the solar panel and keep
Phase four: The fourth phase of the system processes the it ready to use when needed. A buck converter converts the
collected and data and transmits to an online database. Also erratic output voltage of the battery to a suitable voltage level.
in this phase, we use image processing algorithms like otsu A low power microcontroller (Arduino Nano) will have power
and k-means clustering on the images captured. all the time. At regular intervals the microcontroller will send
power to a Raspberry PI. The raspberry Pi when boots starts
Phase five: In the fifth phase, we perform data analysis and executing scripts to capture data values from the sensors (Or
prediction using prediction algorithms and make a data set cameras) and once done another script stores them to a
with the values we get from images. database. The raspberry PI is connected to 5 sensors and will
take sensor data and send them to the raspberry PI.
Phase six: The sixth phase is the user interface that is the
android application.
VII. CONCLUSION
While the previous system was designed to tackle any one single
Fig.1. System Flow disease, by comparing the values recorded by the various
sensors that were employed to collect data in the field, the
a. chances of these diseases occurring in the plant were minimal
and so we decided to take a step back and focus on a single
problem that is the root cause of many diseases, stress level of Production” 2014 Eleventh International Conference on
the plant. Although, there are many diseases that are caused by Wireless and Optical Communications Networks (WOCN)
insects and pests; the root cause of naturally occurring diseases
(Ones that occur without any intervention) is stress on the plant. [5] Luca Pipia, Fernando Pérez, Anna Tardà, Lucas Martínez,
This can be calculated and quantified only using a and Roman Arbiol “Simultaneous usage of optic and thermal
thermographic sensor. Our system tackles stress analysis using hyperspectral sensors for crop water stress characterization
proximity sensors (Thermographic Sensors) rather than using ” Institut Cartogràfic de Catalunya (ICC) Parc de Montjuïc s/n,
08038 Barcelona, Spain
GIS technologies that proves to be inconsistent at times.
REFERENCES
[1] Zulkifli Bin Husin, Abdul Hallis Bin Abdul Aziz, Ali Yeon
Bin Md Shakaff ,Rohani Binti S Mohamed Farook “Feasibility
Study on Plant Chili Disease Detection Using Image Processing
Techniques “ 2012 Third International Conference on
Intelligent Systems Modelling and Simulation
We take this opportunity to express our gratitude to the people who have been instrumental in
the successful completion of this project. We would like to show our greatest gratitude to Dr.
Amiya Kumar Tripathy for his tremendous support and help. Without his encouragement and
support this project would have been dangling in its midway.
We would also like to thank our project guides Ms. Shafaque Fatma Syed and Ms. Ditty
Varghese for being extremely helpful and considerate throughout the year and helping us
overcome all obstacles that came our way.
We would also like to thank our project coordinator Mrs. Sana Shaikh for providing us with
regular inputs about documentation and project timeline. She made sure that we were on time
always. We would also like to thank our classmates for their timely help without which our
project would not be completed.
1. Kevin Dias
---------------------------------------- ------------------------------------------------
2. Larissa Fernandes
---------------------------------------- ------------------------------------------------
(Name of Student, Roll No.) (Signature)
3. Agin Jose
---------------------------------------- ------------------------------------------------
105