0% found this document useful (0 votes)
234 views

BlackBook Report

The document describes a project report on using a remote sensor network and infrared image processing techniques to predict diseases in chili crops. The network monitors environmental conditions and uses thermal imaging to analyze plant stress. It proposes a methodology and system design to continuously monitor data and provide analytical reports to help farmers make effective decisions.

Uploaded by

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

BlackBook Report

The document describes a project report on using a remote sensor network and infrared image processing techniques to predict diseases in chili crops. The network monitors environmental conditions and uses thermal imaging to analyze plant stress. It proposes a methodology and system design to continuously monitor data and provide analytical reports to help farmers make effective decisions.

Uploaded by

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

PROJECT REPORT

ON

REMOTE SENSOR NETWORKS FOR PREDICTION OF CHILLI


CROP DISEASES USING INFRARED IMAGE PROCESSING
TECHNIQUES

SUBMITTED TO THE

UNIVERSITY OF MUMBAI

FOR THE DEGREE OF

BACHELOR OF ENGINEERING
IN
COMPUTER ENGINEERING 2017-2018

Submitted 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

DEPARTMENT OF COMPUTER ENGINEERING

DON BOSCO INSTITUTE OF TECHNOLOGY


(ENGINEERING COLLEGE)
PREMIER AUTOMOBILES ROAD, KURLA (W) – 400070
REMOTE SENSOR NETWORKS FOR PREDICTION OF
CHILLI CROP DISEASES USING INFRARED IMAGE
PROCESSING TECHNIQUES
Submitted in partial fulfilment of the requirement for the Degree of

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

DEPARTMENT OF COMPUTER ENGINEERING


DON BOSCO INSTITUTE OF TECHNOLOGY
(ENGINEERING COLLEGE) PREMIER AUTOMOBILES ROAD, KURLA (W)
400070

2017-2018
CERTIFICATE

This is to certify that the project report entitled “REMOTE


​ SENSOR
NETWORKS FOR PREDICTION OF CHILLI CROP DISEASES
USING INFRARED IMAGE PROCESSING TECHNIQUES”
is a bonafide work of

Kevin Dias Roll No.13


Larissa Fernandes Roll No.16
Agin Jose Roll No.71

​submitted to the University of Mumbai in partial fulfillment of the requirement


for the award of the Degree of Bachelor of Engineering in the Computer
Engineering

Ms. Shafaque Fatma Syed Ms. Ditty Varghese


​Supervisor ​Co-Supervisor

Ms. Nilakshi Joshi Dr. P. Nambiar


Head of Department ​Principal
Project Report Approval for B. E.

This project report entitled ​REMOTE SENSOR NETWORKS FOR PREDICTION OF


CHILLI CROP DISEASES USING INFRARED IMAGE PROCESSING TECHNIQUES

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.

​1​. ​Mr. Kevin Dias, 13

--------------------------------------------------

(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

1.2. Aim and Objectives 2

1.3. Organization of report 2

2. Literature Survey 3

2.1. Introduction 3

3. Problem Statement 6

3.1. Scope 6

4. System Analysis 7

4.1. Existing System 7

4.2. Proposed System 7

4.3. Feasibility of Proposed System 8

4.4. Analysis 8

4.5. Hardware and Software details 9

ii
4.6. Methodology 14

4.7. Design details 15

4.8. Architecture 15

4.9. System Flow 16

5. Implementation 18

5.1. Module I 18

5.2. Module II 19

5.3. Module III 22

5.4. Module IV 26
5.5. Module V 30

6. Results and Discussion 35

7. Project timeline and task distribution 36

8. Conclusion 38

9. References 39

10. Appendix 40

10.1 Code Samples 40

11. Publication Paper 100

12. Acknowledgement 105

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

Sr. No. Abbreviation Full Form


1 WSN Wireless sensor network
2 RPI Raspberry Pi
3 HTML Hyper Text Markup Language
4 PHP Hypertext preprocessor
5 SQL Structured Query language
6 IDE Integrated Development Environment
7 RGB Red, Green, Blue
8 SDK Software Development Kit
9 S1 Soil Moisture Sensor
10 S2 Leaf Wetness Sensor
11 S3 Temperature and Humidity Sensor
12 IR Infrared Sensor

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.

Fig 1.1 Country wise share in chili production

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.

1.2 Aim and Objectives

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.

1.3 Organization of Report

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

2.1.2 Crop Disease Identification using Image Processing

A​ccurate 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.

2.1.5 Implementing Intelligent Monitoring Techniques in Agriculture Using Wireless


Sensor Networks

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

2.1.7 Infrared Image Processing and Data Analysis

Infrared thermography in non-destructive testing provides images (thermograms) in which


zones of interest (defects) appear sometimes as subtle signatures. In Contrast raw images are
not often appropriate since most will be missed. We also learn various methods of data
analysis required either at pre-processing and/or processing images.

2.1.8 Review on Leaf Disease Detection Using Image Processing Techniques

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.

2.2 Conclusion of Literature Survey

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

4.1 Existing System

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.

4.2 Proposed System

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 sixth phase is the user interface that is an android application.

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

4.5.1 Hardware Details

4.5.1.1 Arduino UNO

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.

Fig 4.1 Arduino UNO

4.5.1.2 Soil Moisture Sensor

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

4.5.1.3 Temperature and Humidity 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.

Fig 4.3 Temperature and Humidity Sensor

4.5.1.4 Leaf Wetness Sensor

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.

Fig 4.4 Leaf Wetness Sensor

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.

Fig 4.6 Raspberry Pi 2

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

JavaScript often abbreviated as JS, is a ​high-level​, ​interpreted ​programming language​. It is a


language which is also characterized as ​dynamic​, ​weakly typed​, ​prototype-based and
multi-paradigm​.Alongside ​HTML and ​CSS​, JavaScript is one of the three core technologies of
the ​World Wide Web​.It is used to make dynamic web pages interactive and provide online
programs, including video games. The majority of ​websites employ it, and all modern ​web
browsers support it without the need for ​plug-ins by means of a built-in ​JavaScript engine​.
Each of the many JavaScript engines represent a different implementation of JavaScript, all
based on the ​ECMAScript specification, with some engines not supporting the spec fully, and
with many engines supporting additional features beyond ECMA.

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

PhoneGap​ is a mobile application development framework based on an open source project


(Apache Cordova). Using PhoneGap developers can write apps a single time in HTML, CSS
and JavaScript and deploy it across different mobile devices without losing the features of a
native app. PhoneGap is the cloud-based developer tool built on top of the framework, which
offers cloud-based mobile app development without the need for SDKs, compilers and
hardware.

4.5.2.7 Arduino IDE

The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a


text editor for writing code, a message area, a text console, a toolbar with buttons for
common functions and a series of menus. It connects to the Arduino and Genuino hardware to
upload programs and communicate with them.

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

4.7 Design Details

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.

Fig 4.8 System Arc​hi​tecture

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)

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)

Fig 4.9 System Flow

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.

Fig 5.1 Location

Fig 5.2 Sowing Seeds

18
5.2 Module 2 – Installation and Implementation of Hardware

5.2.1 Base Station

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.

Fig 5.3 Testing Sensor Circuit

19
Fig. 5.4 Installing the hardware

Fig 5.5 Installing the Sensor System

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.

Fig 5.6 Installed Sensor System

21
5.3 Module 3 – Storing Collected Data

5.3.1 DynamoDB Database

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.

Fig 5.7 DynamoDB on AWS

We have created an AWS account and created tables in DynamoDB

5.3.2 Database Details

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.

Fig 5.9 WSN Table in DynamoDB

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 .

Fig 5.10 Cam Table in DynamoDB

5.3.3 Server

Amazon EC2 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

Fig 5.12 EC2 Instance running

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.

5.4 Module 4 - Data Analysis and Prediction

5.4.1 - The Data Set

5.4.1.1 - Sensor Data

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.

The Samples of the datasets are as follows.

Fig 5.13 Humidity data vs time

26
Fig 5.14 Leaf wetness data vs time

Fig 5.15 Moisture data vs time

27
Fig 5.16 Temperature data vs time

5.4.1.2 - Camera Data

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.

The sample images taken by the infrared camera.

28
Fig 5.17 Infrared images of the chilli crop

5.4.2 Machine Learning Algorithm

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.

5.5 Module 5 - Accessing and Viewing Data

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.

5.5.1 Android Application

5.5.1.1 Main Screen

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

5.5.1.2 Sensor 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.

Fig 5.19 Sensor Selection Page

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.

Fig 5.20 Temperature Graph

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.

Fig 5.21 Humidity Graph

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.

Fig 5.22 Soil Moisture Graph

5.5.1.3.4 Leaf Wetness

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.

Fig 5.23 Leaf Wetness Graph

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.

Fig 5.24 RGB Graph

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.

The following are the results from the entire system.

Fig. 6 Result Page

35
7.Project Timeline and Task Distribution

Fig 7.1 Timeline

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

[6] C. Ibarra Castanedo, D. Gonzalez, M Klein, M Pilla, S Vallerand “Infrared image


processing and data analysis” C.Ibarra-Castanedo et al. / Infrared Physics & Technology
(2004)

[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>

dht DHT; #define

DHT11_PIN 7

void setup() {

Serial.begin(9600);

} void loop() { int soil =

analogRead(A0); int rain =

analogRead(A1); int

chk=DHT.read11(DHT11_PIN);

int choice; while

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

2. Program to read data sent by Arduino UNO

import serial import os def getPort():

40
op=os.listdir("/dev")

for i in op:

if "ACM" in i:

return i

ser = serial.Serial('/dev/'+getPort(),9600)

x=1 i=0 ser.write(str(x))

f=open("readings.txt",'w')

ser.flushInput() while i<4:

x=ser.readline()

print "%s" % x

i=i+1;

f.write(x)

f.close() ser.flushInput()

ser.close()

3. Program to send data to the Base Station ​void

setup() {

Serial.begin(9600);

} void loop() {

if(Serial.available()>0)

Serial.write(Serial.read());

4. Program to upload data online

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

r = requests.get(url,params=payload) print 'Data Uploaded'

5. Program to connect to database

ssh -i "server.pem" [email protected]

node index.js &

Inside chilli folder

cd chilli

node fetch.js &

6. Program to get RGB Values from the Thermal Image

# 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 = raw_input("enter file path: ")

file_name = './pics'

def image_mean():

# make list to hold the mean of all picture

all_means = [['pic_name','blue','green','red']] # just to make life easy for printing into csv

42
pic_num = 1

match = False

for file_type in [file_name]: #reading the folder

for image_name in os.listdir(file_type): # reading each file in folder

current_image_path = str(file_type)+'/'+str(image_name) # building the path so CV can


read the image

print current_image_path # printing the path

img = cv2.imread(current_image_path)

b,g,r = cv2.split(img) # split image into blue, green, and red arrays.

# insert the mean of b, g, r, in a list

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

with open("blue_green_read_data_means.csv", "wb") as f:

writer = csv.writer(f)

writer.writerows(all_means)

f.close()

print "\n---------------------------------------\n\tdata written to


blue_green_read_data_means.csv\n---------------------------------------"

print "Number of pics read: " + str(pic_num)

# call function image_mean()

43
image_mean()

7. Program to send sensor data from csv file to DynamoDb

var AWS = require('aws-sdk');

var fs = require('fs');

var LineByLineReader = require('line-by-line');

docClient = new AWS.DynamoDB.DocumentClient({

accessKeyId: "AKIAJURP5BIQVXH4G3UQ",

secretAccessKey:

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

region: 'ap-south-1'

});

lr = new LineByLineReader('sd.csv');

lr.on('error', function (err) {

// 'err' contains error object

});

lr.on('line', function (line) {

// pause emitting of lines...

lr.pause();

console.log(line);

var parts = line.split(",");

// ...do your asynchronous line processing..

setTimeout(function () {

var params = {

TableName: "WSN",

44
Item:{

"srno": parts[0],

"humidity": parts[6],

"leafWetness": parts[4],

"soilMoisture": parts[3],

"temp": parts[5],

"time": parts[1] + "T" + parts[2]

};

docClient.put(params, function(err, data) {

if (err) {

console.log(err);

} else {

console.log("Done!");

});

lr.resume();

}, 00);

});

lr.on('end', function () {

// All lines are read, file is closed now.

});

/*

45
var params = {

TableName: "WSN",

Item:{

"srno": ,

"humidity": ,

"leafWetness": ,

"soilMoisture": ,

"temp": ,

"time":

};

docClient.put(params, function(err, data) {

if (err) {

} else {

});

*/

8. Program to send RGB values of thermal images from csv file to DynamoDb

var AWS = require('aws-sdk');

var fs = require('fs');

var LineByLineReader = require('line-by-line');

docClient = new AWS.DynamoDB.DocumentClient({

accessKeyId: "AKIAJURP5BIQVXH4G3UQ",

46
secretAccessKey:

"sAtkBXVI6jevicu+PlFk3cvlxmNBSG53cYXen3Gl",

region: 'ap-south-1'

});

lr = new LineByLineReader('rgb.csv');

lr.on('error', function (err) {

// 'err' contains error object

});

lr.on('line', function (line) {

// pause emitting of lines...

lr.pause();

console.log(line);

var parts = line.split(",");

// ...do your asynchronous line processing..

setTimeout(function () {

var params = {

TableName: "Cam",

Item:{

"srno": parts[0],

"blue": parts[1],

"green": parts[2],

"red": parts[3],

"status": parts[4],

47
};

docClient.put(params, function(err, data) {

if (err) {

console.log(err);

} else {

console.log("Done!");

});

lr.resume();

}, 00);

});

lr.on('end', function () {

// All lines are read, file is closed now.

});

9. Program to run the KNN Machine Learning Algorithm on the Server

// grab the packages we need

var express = require('express');

var app = express();

var port = process.env.PORT || 8081;

var bodyParser = require('body-parser');

app.use(bodyParser.json()); // support json encoded bodies

app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies

var fs = require('fs');

48
var PythonShell = require('python-shell');

app.post('/get', function(req, res) {

console.log(req);

var response;/*

var options = {

mode: 'text',

pythonOptions: ['-u'], // get print results in real-time

scriptPath: '.',

pythonPath: 'bin/python3',

args: ['test']

};

PythonShell.run('do.py', options, function (err, results) {

if (err) throw err;

// results is an array consisting of messages collected during execution

console.log('results: %j', results);

});

*/

var options = {

mode: 'text',

pythonOptions: ['-u'], // get print results in real-time

scriptPath: '.',

49
pythonPath: 'python',

args: ['test']

};

PythonShell.run('knn.py', options, function (err, results) {

if (err) throw err;

// results is an array consisting of messages collected during execution

console.log('results: %j', results);

res.send(results);

/*

fs.readFile('transcriptsummary.txt', function(err, filerdata) {

var params = {

Body: "Test" + filerdata,

Bucket: s3Object.Bucket,

Key: s3Object.Key + "_summary"};

s3.putObject(params, function(err, data) {

if (err) {console.log(err, err.stack);

response = "{'status':'error', 'reason': 'writeError'}";

res.send(filerdata);

else {

console.log(data);

response = "{'status':'success', 'reason': 'none'}";

res.send(filerdata);

50
});

});

*/ });

});// routes will go here// start the server

app.listen(port);

10. Android Application- index.html

<!DOCTYPE html>

<html>

<head>

<title>Chilli Crop</title>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0,

maximum-scale=1.0, user-scalable=no">

<link href="layout/styles/layout.css" rel="stylesheet" type="text/css" media="all">

</head>

<body id="top">

<!-- Top Background Image Wrapper -->

<div class="bgded"

style="background-image:url('images/demo/backgrounds/chilli.jpg');">

<div class="wrapper overlay">

<header id="header" class="hoc clear">

<nav id="mainav" class="clear">

<ul class="clear">

<li><a class="drop" href="pages/sensor.html">Sensors</a>

51
<ul>

<li><a href="pages/temp.html">Temperature</a></li>

<li><a href="pages/humidity.html">Humidity</a></li>

<li><a href="pages/leaf.html">Leaf Wetness</a></li>

<li><a href="pages/soil.html">Soil Moisture</a></li>

</ul>

</li>

<li><a class="drop" href="#">Imaging</a>

<ul>

<li><a class="drop" href="pages/camera.html">Thermal Images</a></ul>

</ul>

</nav>

<div id="logo">

<h2><a href="index.html">CHILLI CROP</a></h2>

</div>

</header>

</div>

<div id="pageintro" class="hoc clear">

<article>

<div class="introtxt">

<p id="leafwet">Leaf Wetness:</p>

<p id="soilmois">Soil Moisture: </p>

<p id="temper">Temperature: </p>

<p id="humid">Humidity: </p>

52
</div>

<footer>

<ul class="nospace inline pushright">

<li><a class="btn inverse" href="pages/sensor.html" style="padding-left:

15px; padding-right: 15px; padding-bottom: 15px;">Sensors</a></li>

<li><a class="btn" href="pages/disease.html" style="padding-left: 15px;

padding-right: 15px; padding-bottom: 15px;">Disease Prediction</a></li>

</ul>

</footer>

</article>

</div>

</div>

<!-- End Top Background Image Wrapper -->

<!-- / main body -->

<div class="clear"></div>

</main>

</div>

<a id="backtotop" href="#top"><i class="fa fa-chevron-up"></i></a>

<!-- 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>

<!-- IE9 Placeholder Support -->

<script src="layout/scripts/jquery.placeholder.min.js"></script>

53
<!-- / IE9 Placeholder Support -->

<script>

var xhttp = new XMLHttpRequest();

xhttp.onreadystatechange = function() {

console.log("here");

if (this.readyState == 4 && this.status == 200) {

var data = JSON.parse(this.responseText);

document.getElementById("leafwet").innerHTML = "Leaf

Wetness:"+data.Items[data.Items.length-1].leafWetness;

document.getElementById("soilmois").innerHTML = "Soil Moisture:

"+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;

// var data = JSON.parse(this.responseText);

// //console.log(data.Items[0])

// var Itemdata = [];

// for(var i=0; i<data.Items.length; i++){

// Itemdata[i] = {};

// }

// for(var i=0; i<data.Items.length; 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].label = new Date(data.Items[i].time).getDate();

// Itemdata[i].y = parseInt(data.Items[i].soilMoisture)

// }

// console.log(Itemdata)

// var chart = new CanvasJS.Chart("chartContainer", {

// theme: "light1", // "light2", "dark1", "dark2"

// animationEnabled: false, // change to true

// title:{

// text: "Soil Moisture"

// },

// data: [

// {

// // Change type to "bar", "area", "spline", "pie",etc.

// type: "column",

// dataPoints: Itemdata

// }

// ]

// });

55
// chart.render();

};

xhttp.open("GET", "http://13.127.253.158:3000/getData", true);

xhttp.send();

</script>

</body>

</html>

10. Android Application- sensor.html

<!DOCTYPE html>

<html>

<head>

<title>Temperature</title>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0,

maximum-scale=1.0, user-scalable=no">

<link href="../layout/styles/layout.css" rel="stylesheet" type="text/css" media="all">

<style type="text/css">

.floating-box {

display: inline-block;

width: 120px;

height: 150px;

margin: 10px:}

56
</style>

</head>

<body id="top">

<!-- Top Background Image Wrapper -->

<div class="bgded"

style="background-image:url('../images/demo/backgrounds/chilli.jpg');">

<div class="wrapper overlay">

<header id="header" class="hoc clear">

<nav id="mainav" class="clear">

<ul class="clear">

<li><a class="drop" href="sensor.html">Sensors</a>

<ul>

<li><a href="temp.html">Temperature</a></li>

<li><a href="humidity.html">Humidity</a></li>

<li><a href="leaf.html">Leaf Wetness</a></li>

<li><a href="soil.html">Soil Moisture</a></li>

</ul>

</li>

<li><a class="drop" href="#">Imaging</a>

<ul>

<li><a class="drop" href="camera.html">Thermal Images</a>

</ul>

</nav>

<div id="logo">

57
<h2><a href="../index.html">Sensors</a></h2>

</div>

</header>

</div>

</div>

<!-- End Top Background Image Wrapper -->

<div class="wrapper row3">

<main class="hoc container clear">

<!-- main body -->

<div class="content">

<div id="gallery">

<figure>

<center>

<header class="heading"></header>

<!--ul class="nospace clear">

<li class="one_quarter first"><a href="humidity.html"><figure><img

src="../images/demo/gallery/humidity.jpg" alt="Humidity"

style="width:30%;height:30%;"><figcaption><br>Humidity</figcaption></figure><

/a></li>

<li class="one_quarter"><a href="soil.html"><figure><img

src="../images/demo/gallery/soilmoist.jpg" alt="Soil Moisture"

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>

<li class="one_quarter"><a href="camera.html"><figure><img

src="../images/demo/gallery/camera.png" alt="IR Camera"

style="width:190px;height:190px;"><figcaption><br><br>IR

Camera</figcaption></figure></a></li>

<li class="one_quarter first"><a href="leaf.html"><figure><img

src="../images/demo/gallery/leaf.jpg" alt="Leaf Wetness"

style="width:240px;height:240px;"><figcaption>Leaf

Wetness</figcaption></figure></a></li>

</ul-->

<div class="floating-box"><a href="humidity.html"><figure><img

src="../images/demo/gallery/humidity.jpg" alt="Humidity"

style="width:80%;height:80%;"><figcaption><br>Humidity</figcaption></figure><

/a></div>

<div class="floating-box"><a href="soil.html"><figure><img

src="../images/demo/gallery/soilmoist.jpg" alt="Soil Moisture"

style="width:80%;height:80%;"><figcaption><br>Soil

Moisture</figcaption></figure></a></div>

<div class="floating-box"><a href="temp.html"><figure><img

src="../images/demo/gallery/temp.jpg" alt="Temperature"

59
style="width:80%;height:80%;"><figcaption><br>Temperature</figcaption></figur

e></a></div>

<div class="floating-box"><a href="camera.html"><figure><img

src="../images/demo/gallery/camera.png" alt="IR Camera"

style="width:80%;height:80%;"><figcaption><br>IR

Camera</figcaption></figure></a></div>

<div class="floating-box"><a href="leaf.html"><figure><img

src="../images/demo/gallery/leaf.jpg" alt="Leaf Wetness"

style="width:100%;height:100%;"><figcaption>Leaf

Wetness</figcaption></figure></a></div>

</div>

</div>

<!-- / main body -->

<div class="clear"></div>

</main>

</div>

</div>

<a id="backtotop" href="#top"><i class="fa fa-chevron-up"></i></a>

<!-- 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>

<!-- IE9 Placeholder Support -->

60
<script src="../layout/scripts/jquery.placeholder.min.js"></script>

<!-- / IE9 Placeholder Support -->

</body>

</html>

11. Android Application- temp.html

<!DOCTYPE html>

<html>

<head>

<title>Temperature</title>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0,

maximum-scale=1.0, user-scalable=no">

<link href="../layout/styles/layout.css" rel="stylesheet" type="text/css" media="all">

</head>

<body id="top">

<!-- Top Background Image Wrapper -->

<div class="bgded"

style="background-image:url('../images/demo/backgrounds/chilli.jpg');">

<div class="wrapper overlay">

<header id="header" class="hoc clear">

<nav id="mainav" class="clear">

<ul class="clear">

61
<li><a class="drop" href="sensor.html">Sensors</a>

<ul>

<li><a href="humidity.html">Humidity</a></li>

<li><a href="leaf.html">Leaf Wetness</a></li>

<li><a href="soil.html">Soil Moisture</a></li>

</ul>

</li>

<li><a class="drop" href="#">Imaging</a>

<ul>

<li><a class="drop" href="camera.html">Thermal Images</a>

</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="wrapper row3">

<main class="hoc container clear">

<!-- main body -->

<div class="content">

<div class="content">

<div id="chartContainer" style="height: 370px; width: 100%;"></div>

<script src="https://canvasjs.com/assets/script/canvasjs.min.js"> </script>

<p>Highest Humidity: <span id="hh"></span> degrees <br>

Lowest Humidity: <span id="lh"></span> degrees<br>

Average Humidity: <span id="ah"></span> degress</p>

</div>

<!-- / main body -->

<div class="clear"></div>

</main>

</div>

<a id="backtotop" href="#top"><i class="fa fa-chevron-up"></i></a>

<!-- 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>

63
<!-- IE9 Placeholder Support -->

<script src="../layout/scripts/jquery.placeholder.min.js"></script>

<!-- / IE9 Placeholder Support -->

<script>

var lowestHumidity = 100;

var highestHumidity = 0;

var humiditySum = 0;

var humidityCount = 0;

var xhttp = new XMLHttpRequest();

xhttp.onreadystatechange = function() {

console.log("here");

if (this.readyState == 4 && this.status == 200) {

//document.getElementById("demo").innerHTML = this.responseText;

var data = JSON.parse(this.responseText);

//console.log(data.Items[0])

var Itemdata = [];

for(var i=0; i<data.Items.length; i++){

Itemdata[i] = {};

for(var i=0; i<data.Items.length; 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)

var humidityThis = parseInt(data.Items[i].temp);

if(humidityThis < lowestHumidity) lowestHumidity = humidityThis;

if(humidityThis > highestHumidity) highestHumidity = humidityThis;

humiditySum += humidityThis;

console.log(humidityThis)

humidityCount++;

//Sort

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)

65
var chart = new CanvasJS.Chart("chartContainer", {

theme: "light1", // "light2", "dark1", "dark2"

animationEnabled: false, // change to true

title:{

text: "Temperature"

},

data: [

// Change type to "bar", "area", "spline", "pie",etc.

type: "column",

dataPoints: Itemdata

});

chart.render();

};

xhttp.open("GET", "http://13.127.253.158:3000/getData", true);

xhttp.send();

</script>

</body>

66
</html>

12. Android Application- humidity.html

<html>

<head>

<title>Temperature</title>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0,

maximum-scale=1.0, user-scalable=no">

<link href="../layout/styles/layout.css" rel="stylesheet" type="text/css" media="all">

</head>

<body id="top">

<!-- Top Background Image Wrapper -->

<div class="bgded"

style="background-image:url('../images/demo/backgrounds/chilli.jpg');">

<div class="wrapper overlay">

<header id="header" class="hoc clear">

<nav id="mainav" class="clear">

<ul class="clear">

<li><a class="drop" href="sensor.html">Sensors</a>

<ul>

<li><a href="temp.html">Temperature</a></li>

<li><a href="leaf.html">Leaf Wetness</a></li>

67
<li><a href="soil.html">Soil Moisture</a></li>

</ul>

</li>

<li><a class="drop" href="#">Imaging</a>

<ul>

<li><a class="drop" href="camera.html">Thermal Images</a>

</ul>

</nav>

<div id="logo">

<h2><a href="../index.html">Humidity</a></h2>

</div>

</header>

</div>

</div>

<!-- End Top Background Image Wrapper -->

<div class="wrapper row3">

<main class="hoc container clear">

<!-- main body -->

<div class="content">

<div class="content">

68
<div id="chartContainer" style="height: 370px; width: 100%;"></div>

<script src="https://canvasjs.com/assets/script/canvasjs.min.js"> </script>

<p>Highest Humidity: <span id="hh"></span>% <br>

Lowest Humidity: <span id="lh"></span>%<br>

Average Humidity: <span id="ah"></span>% </p>

</div>

<!-- / main body -->

<div class="clear"></div>

</main>

</div>

</div>

<a id="backtotop" href="#top"><i class="fa fa-chevron-up"></i></a>

<!-- 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>

<!-- IE9 Placeholder Support -->

<script src="../layout/scripts/jquery.placeholder.min.js"></script>

<!-- / IE9 Placeholder Support -->

<script>

var lowestHumidity = 100;

69
var highestHumidity = 0;

var humiditySum = 0;

var humidityCount = 0;

var xhttp = new XMLHttpRequest();

xhttp.onreadystatechange = function() {

console.log("here");

if (this.readyState == 4 && this.status == 200) {

//document.getElementById("demo").innerHTML = this.responseText;

var data = JSON.parse(this.responseText);

//console.log(data.Items[0])

var Itemdata = [];

for(var i=0; i<data.Items.length; i++){

Itemdata[i] = {};

for(var i=0; i<data.Items.length; 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)

var humidityThis = parseInt(data.Items[i].humidity);

if(humidityThis < lowestHumidity) lowestHumidity = humidityThis;

if(humidityThis > highestHumidity) highestHumidity = humidityThis;

humiditySum += humidityThis;

console.log(humidityThis)

humidityCount++;

//Sort

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)

71
var chart = new CanvasJS.Chart("chartContainer", {

theme: "light1", // "light2", "dark1", "dark2"

animationEnabled: false, // change to true

title:{

text: "Humidity"

},

data: [

// Change type to "bar", "area", "spline", "pie",etc.

type: "column",

dataPoints: Itemdata

});

chart.render();

};

xhttp.open("GET", "http://13.127.253.158:3000/getData", true);

xhttp.send();

</script>

</body>

</html>

72
13. Android Application- soil.html

<!DOCTYPE html>

<html>

<head>

<title>Leaf Wetness</title>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0,

maximum-scale=1.0, user-scalable=no">

<link href="../layout/styles/layout.css" rel="stylesheet" type="text/css" media="all">

</head>

<body id="top">

<!-- Top Background Image Wrapper -->

<div class="bgded"

style="background-image:url('../images/demo/backgrounds/chilli.jpg');">

<div class="wrapper overlay">

<header id="header" class="hoc clear">

<nav id="mainav" class="clear">

<ul class="clear">

<li><a class="drop" href="sensor.html">Sensors</a>

<ul>

<li><a href="humidity.html">Humidity</a></li>

73
<li><a href="temp.html">Temperature</a></li>

<li><a href="leaf.html">Leaf Wetness</a></li>

</ul>

</li>

<li><a class="drop" href="#">Imaging</a>

<ul>

<li><a class="drop" href="camera.html">Thermal Images</a>

</ul>

</nav>

<div id="logo">

<h2><a href="../index.html">Soil Moisture</a></h2>

</div>

</header>

</div>

</div>

<!-- End Top Background Image Wrapper -->

<div class="wrapper row3">

<main class="hoc container clear">

<!-- main body -->

<div class="content">

74
<div class="content">

<div id="chartContainer" style="height: 370px; width: 100%;"></div>

<script src="https://canvasjs.com/assets/script/canvasjs.min.js"> </script>

<p>Highest soil moisture level: <span id="hh"></span> TWI <br>

Lowest soil moisture level: <span id="lh"></span> TWI<br>

Average soil moisture level: <span id="ah"></span> TWI</p>

</div>

<!-- / main body -->

<div class="clear"></div>

</main>

</div>

<a id="backtotop" href="#top"><i class="fa fa-chevron-up"></i></a>

<!-- 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>

<!-- IE9 Placeholder Support -->

<script src="../layout/scripts/jquery.placeholder.min.js"></script>

<!-- / IE9 Placeholder Support -->

<script>

var lowestHumidity = 100;

var highestHumidity = 0;

var humiditySum = 0;

var humidityCount = 0;

75
var xhttp = new XMLHttpRequest();

xhttp.onreadystatechange = function() {

console.log("here");

if (this.readyState == 4 && this.status == 200) {

//document.getElementById("demo").innerHTML = this.responseText;

var data = JSON.parse(this.responseText);

//console.log(data.Items[0])

var Itemdata = [];

for(var i=0; i<data.Items.length; i++){

Itemdata[i] = {};

for(var i=0; i<data.Items.length; 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)

var humidityThis = parseInt(data.Items[i].soilMoisture);

if(humidityThis < lowestHumidity) lowestHumidity = humidityThis;

if(humidityThis > highestHumidity) highestHumidity = humidityThis;

humiditySum += humidityThis;

console.log(humidityThis)

humidityCount++;

//Sort

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)

var chart = new CanvasJS.Chart("chartContainer", {

theme: "light1", // "light2", "dark1", "dark2"

animationEnabled: false, // change to true

title:{

77
text: "Soil Moisture"

},

data: [

// Change type to "bar", "area", "spline", "pie",etc.

type: "column",

dataPoints: Itemdata

});

chart.render();

};

xhttp.open("GET", "http://13.127.253.158:3000/getData", true);

xhttp.send();

</script>

</body>

</html>

14. Android Application- leaf.html

<!DOCTYPE html>

<html>

<head>

78
<title>Leaf Wetness</title>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0,

maximum-scale=1.0, user-scalable=no">

<link href="../layout/styles/layout.css" rel="stylesheet" type="text/css" media="all">

</head>

<body id="top">

<!-- Top Background Image Wrapper -->

<div class="bgded"

style="background-image:url('../images/demo/backgrounds/chilli.jpg');">

<div class="wrapper overlay">

<header id="header" class="hoc clear">

<nav id="mainav" class="clear">

<ul class="clear">

<li><a class="drop" href="sensor.html">Sensors</a>

<ul>

<li><a href="humidity.html">Humidity</a></li>

<li><a href="temp.html">Temperature</a></li>

<li><a href="soil.html">Soil Moisture</a></li>

</ul>

</li>

79
<li><a class="drop" href="#">Imaging</a>

<ul>

<li><a class="drop" href="camera.html">Thermal Images</a>

</ul>

</nav>

<div id="logo">

<h2><a href="../index.html">Leaf Wetness</a></h2>

</div>

</header>

<!-- End Top Background Image Wrapper -->

<div class="wrapper row3">

<main class="hoc container clear">

<!-- main body -->

<div class="content">

<div id="chartContainer" style="height: 370px; width: 100%;"></div>

<script src="https://canvasjs.com/assets/script/canvasjs.min.js"> </script>

<p>Highest Value: <span id="hh"></span> TWI<br>

Lowest Value: <span id="lh"></span> TWI<br>

Average Value: <span id="ah"></span> TWI</p>

<!-- / main body -->

<div class="clear"></div>

</main>

</div>

<a id="backtotop" href="#top"><i class="fa fa-chevron-up"></i></a>

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>

<!-- IE9 Placeholder Support -->

<script src="../layout/scripts/jquery.placeholder.min.js"></script>

<!-- / IE9 Placeholder Support -->

<script>

var lowestHumidity = 100;

var highestHumidity = 0;

var humiditySum = 0;

var humidityCount = 0;

var xhttp = new XMLHttpRequest();

xhttp.onreadystatechange = function() {

console.log("here");

if (this.readyState == 4 && this.status == 200) {

//document.getElementById("demo").innerHTML = this.responseText;

var data = JSON.parse(this.responseText);

//console.log(data.Items[0])

var Itemdata = [];

81
for(var i=0; i<data.Items.length; i++){

Itemdata[i] = {};

for(var i=0; i<data.Items.length; 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)

var humidityThis = parseInt(data.Items[i].leafWetness);

if(humidityThis < lowestHumidity) lowestHumidity = humidityThis;

if(humidityThis > highestHumidity) highestHumidity = humidityThis;

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)

var chart = new CanvasJS.Chart("chartContainer", {

theme: "light1", // "light2", "dark1", "dark2"

animationEnabled: false, // change to true

title:{

text: "Leaf Wetness"

},

data: [

// Change type to "bar", "area", "spline", "pie",etc.

type: "column",

dataPoints: Itemdata

});

chart.render();

83
}

};

xhttp.open("GET", "http://13.127.253.158:3000/getData", true);

xhttp.send();

</script>

</body>

</html>

15. Android Application- camera.html

<!DOCTYPE html>

<html>

<head>

<title>Leaf Wetness</title>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0,

maximum-scale=1.0, user-scalable=no">

<link href="../layout/styles/layout.css" rel="stylesheet" type="text/css" media="all">

</head>

<body id="top">

<!-- Top Background Image Wrapper -->

<div class="bgded"

style="background-image:url('../images/demo/backgrounds/chilli.jpg');">

<div class="wrapper overlay">

84
<header id="header" class="hoc clear">

<nav id="mainav" class="clear">

<ul class="clear">

<li><a class="drop" href="sensor.html">Sensors</a>

<ul>

<li><a href="humidity.html">Humidity</a></li>

<li><a href="temp.html">Temperature</a></li>

<li><a href="soil.html">Soil Moisture</a></li>

<li><a href="leaf.html">Leaf Wetness</a></li>

</ul>

</li>

<li><a class="drop" href="#">Imaging</a>

<ul>

<li><a class="drop" href="camera.html">Thermal Images</a>

</ul>

</nav>

<div id="logo">

<h2><a href="../index.html">Thermal Imaging</a></h2>

</div>

</header>

85
</div>

</div>

<!-- End Top Background Image Wrapper -->

<div class="wrapper row3">

<main class="hoc container clear">

<div id="chartContainerR" style="height: 370px; width: 100%;

display:block;"></div>

<div id="chartContainerG" style="height: 370px; width: 100%;

display:block;"></div>

<div id="chartContainerB" style="height: 370px; width: 100%;

display:block;"></div>

<script src="https://canvasjs.com/assets/script/canvasjs.min.js"> </script>

<div >

</div>

<!--

<p>Red Value: <span id="hh"></span> <br>

Green Value: <span id="lh"></span> <br>

Blue Value: <span id="ah"></span> </p>

<!-- / main body -->

<div class="clear"></div>

</main>

</div>

86
</div>

<a id="backtotop" href="#top"><i class="fa fa-chevron-up"></i></a>

<!-- 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>

<!-- IE9 Placeholder Support -->

<script src="../layout/scripts/jquery.placeholder.min.js"></script>

<!-- / IE9 Placeholder Support -->

<script>

var chartR, chartG, chartB;

var lowestHumidity = 100;

var highestHumidity = 0;

var humiditySum = 0;

var humidityCount = 0;

var xhttp = new XMLHttpRequest();

xhttp.onreadystatechange = function() {

console.log("here");

if (this.readyState == 4 && this.status == 200) {

//document.getElementById("demo").innerHTML = this.responseText;

var data = JSON.parse(this.responseText);

console.log(data.Items[0])

87
var ItemdataR = [], ItemdataG = [], ItemdataB = [];

for(var i=0; i<data.Items.length; i++){

ItemdataR[i] = {};

ItemdataG[i] = {};

ItemdataB[i] = {};

for(var i=0; i<data.Items.length; i++) {

ItemdataR[i].label = new Date(data.Items[i].time).getDate();

ItemdataR[i].y = parseInt(data.Items[i].red)

ItemdataG[i].label = new Date(data.Items[i].time).getDate();

ItemdataG[i].y = parseInt(data.Items[i].green)

ItemdataB[i].label = new Date(data.Items[i].time).getDate();

ItemdataB[i].y = parseInt(data.Items[i].blue)

var humidityThis = parseInt(data.Items[i].red);

if(humidityThis < lowestHumidity) lowestHumidity = humidityThis;

if(humidityThis > highestHumidity) highestHumidity = humidityThis;

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)

chartR = new CanvasJS.Chart("chartContainerR", {

theme: "light1", // "light2", "dark1", "dark2"

animationEnabled: false, // change to true

title:{

text: "Red Values"

},

data: [

// Change type to "bar", "area", "spline", "pie",etc.

type: "column",

dataPoints: ItemdataR

});

chartG = new CanvasJS.Chart("chartContainerG", {

theme: "light1", // "light2", "dark1", "dark2"

89
animationEnabled: false, // change to true

title:{

text: "Green Values"

},

data: [

// Change type to "bar", "area", "spline", "pie",etc.

type: "column",

dataPoints: ItemdataG

});

chartB = new CanvasJS.Chart("chartContainerB", {

theme: "light1", // "light2", "dark1", "dark2"

animationEnabled: false, // change to true

title:{

text: "Blue Values"

},

data: [

// Change type to "bar", "area", "spline", "pie",etc.

type: "column",

dataPoints: ItemdataB

90
]

});

chartR.render();

chartG.render();

chartB.render();

};

xhttp.open("GET", "http://13.127.253.158:3000/getCam", true);

xhttp.send();

function red() {

document.getElementById("chartContainerR").style = "display: block;";

document.getElementById("chartContainerG").style = "display: none;";

document.getElementById("chartContainerB").style = "display: none;";

function green() {

document.getElementById("chartContainerR").style = "display: none;";

document.getElementById("chartContainerG").style = "display: block;";

document.getElementById("chartContainerB").style = "display: none;";

function blue() {

document.getElementById("chartContainerR").style = "display: none;";

91
document.getElementById("chartContainerG").style = "display: none;";

document.getElementById("chartContainerB").style = "display: block;";

</script>

</body>

</html>

16. Android Application- disease.html

<!DOCTYPE html>

<html>

<head>

<title>Leaf Wetness</title>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0,

maximum-scale=1.0, user-scalable=no">

<link href="../layout/styles/layout.css" rel="stylesheet" type="text/css" media="all">

</head>

<body id="top">

<!-- Top Background Image Wrapper -->

<div class="bgded"

style="background-image:url('../images/demo/backgrounds/chilli.jpg');">

<div class="wrapper overlay">

<header id="header" class="hoc clear">

92
<nav id="mainav" class="clear">

<ul class="clear">

<li><a class="drop" href="#">Sensors</a>

<ul>

<li><a href="humidity.html">Humidity</a></li>

<li><a href="temp.html">Temperature</a></li>

<li><a href="soil.html">Leaf Wetness</a></li>

</ul>

</li>

<li><a class="drop" href="#">Imaging</a>

<ul>

<li><a class="drop" href="camera.html">Thermal Images</a>

</ul>

</nav>

<div id="logo">

<h2><a href="../index.html">Disease Prediction</a></h2>

</div>

93
</header>

</div>

</div>

<!-- End Top Background Image Wrapper -->

<div class="wrapper row3">

<main class="hoc container clear">

<!-- main body -->

<div class="content">

<div class="content">

<h1><br>Based on the current sensor values,the status of the plant is as

follows:</h1>

<div id="ans"></div>

<script>

var xhttp = new XMLHttpRequest();

xhttp.onreadystatechange = function() {

if (this.readyState == 4 && this.status == 200) {

// Typical action to be performed when the document is ready:

document.getElementById("ans").innerHTML = xhttp.responseText;

};

94
xhttp.open("GET", "http://13.127.253.158:8081/", true);

xhttp.send();

</script>

</div>

<!-- / main body -->

<div class="clear"></div>

</main>

</div>

</div>

<a id="backtotop" href="#top"><i class="fa fa-chevron-up"></i></a>

<!-- 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>

<!-- IE9 Placeholder Support -->

<script src="../layout/scripts/jquery.placeholder.min.js"></script>

<!-- / IE9 Placeholder Support -->

</body>

</html>

17. Machine Learning code- knn.py

import csv

95
import random

import math

import operator

def loadDataset(filename, split, trainingSet=[] , testSet=[]):

with open(filename, 'rb') as csvfile:

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

if random.random() < split:

trainingSet.append(dataset[x])

else:

testSet.append(dataset[x])

def euclideanDistance(instance1, instance2, length):

distance = 0

for x in range(length):

distance += pow((instance1[x] - instance2[x]), 2)

return math.sqrt(distance)

def getNeighbors(trainingSet, testInstance, k):

96
distances = []

length = len(testInstance)-1

for x in range(len(trainingSet)):

dist = euclideanDistance(testInstance, trainingSet[x], length)

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

sortedVotes = sorted(classVotes.iteritems(), key=operator.itemgetter(1),

reverse=True)

return sortedVotes[0][0]

def getAccuracy(testSet, predictions):

97
correct = 0

for x in range(len(testSet)):

if testSet[x][-1] == predictions[x]:

correct += 1

return (correct/float(len(testSet))) * 100.0

def main():

print 'x'

# prepare data

trainingSet=[]

testSet=[]

split = 0.67

loadDataset('Sensordata.csv', split, trainingSet, testSet)

print 'Train set: ' + repr(len(trainingSet))

print 'Test set: ' + repr(len(testSet))

# generate predictions

predictions=[]

k=3

for x in range(len(testSet)):

neighbors = getNeighbors(trainingSet, testSet[x], k)

result = getResponse(neighbors)

predictions.append(result)

print('> predicted=' + repr(result) + ', actual=' + repr(testSet[x][-1]))

accuracy = getAccuracy(testSet, predictions)

98
print('Accuracy: ' + repr(accuracy) + '%')

main()

99
PUBLICATION PAPER

Chili Plant Disease Detection Using Thermal


Imaging Techniques
Shafaque Fatma Syed1, Ditty Varghese2, Larissa Fernandes3, Kevin Dias4, Agin Jose5

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.

The systems that are existing are WSN based Decision


Support Systems to monitor Chili Crops. Temperature and
III. LITERATURE SURVEY humidity levels are the most important factors for the
productivity, growth, and quality of chilli plant in agriculture.
For our work we reviewed papers based on image processing,
So, the system periodically measured these parameters inside
wireless sensor networks, and disease prediction systems.
the fields. Thus, the farmers or the agriculture experts could
Zulkifli Bin Husin, et. al [1] “Feasibility Study on Plant Chili observe the measurements from the website or an android app
Disease Detection Using Image Processing Techniques “This simultaneously. Moreover, when a critical change in one of
paper discusses how an image is captured, resized and how the measurements occurs, then the farmer will be intimated
image feature extraction and image recognition takes place. about the possible disease range. However, the existing
Thus, chilli plant disease detection through leaf image and system could not perform stress analysis and did not use
data processing techniques is very useful and inexpensive image processing to identify leaf features.
system especially for assisting farmers in monitoring big
plantation areas.
R. Vijay Anandh et. al [2] “Crop Disease Identification using
Image Processing” 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 IV. PROPOSED SYSTEM
diseases. It discusses various techniques to segment the We intend to design an efficient system that captures and stores
disease part of the plant. We learnt about image acquisition, the stress levels of a chilli crop and analyses the data for better
image pre-processing, image segmentation, feature disease prediction using Image processing techniques.
extraction, detection and classification of diseases. The proposed system works in three stages, Capture plant stress
Mohammed Ali hussain et.al [4] “Agriculture Field levels using a thermographic camera at regular intervals; store,
Monitoring and Analysis using Wireless Sensor Networks for analyse, and process said data using Image processing to
improving Crop Production” how to design and develop an compose a data set; Using the composed data set that’s available
agricultural monitoring system using wireless sensor network to predict if the plant is under stress.
to increase the productivity and quality of farming without  In stage one, we will capture thermographic images of
observing it for all the time manually.
the chilli crop from a static place at regular intervals
Roman Arbiol et.al [5] “Simultaneous usage of optic and
and store the RGB values in a database. RGB (red,
thermal hyperspectral sensors for crop water stress
characterization” Visible-Near InfraRed (VNIR) and Thermal green, and blue) refers to a system for representing the
InfraRed (TIR) simultaneous information is crucial in order colors to be used on a computer display. Red, green,
to carry out a reliable description of crop water stress and blue can be combined in various proportions to
condition. High-resolution hyper spectral data sets are obtain any color in the visible spectrum. Levels of R,
required to characterize the energy flux exchange between G, and B can each range from 0 to 100 percent of full
surface and atmosphere, and to estimate the crop daily intensity.
evapotranspiration (ETd).  In stage two, RGB values will be recorded and
S Vallerand et.al [6] “Infrared Image Processing and Data compared with the average RGB values that are
Analysis” Infrared thermography in non-destructive testing calculated. If the recorded RGB values have a higher
provides images (thermograms) in which zones of interest percentage of Blues then the image is getting colder
(defects) appear sometimes as subtle signatures. In Contrast and hence the water level in the plant is climbing. If on
raw images are not often appropriate since most will be the other hand, the recorded RGB values have a higher
missed. We also learn various methods of data analysis percentage of Reds then the image is getting hotter and
required either at pre-processing and/or processing images. hence the water level in the plant is dropping.
Sandesh Raut et.al [7] “Review on Leaf Disease Detection  In stage three, with the help of the recorded values we
Using Image Processing Techniques” The conventional
can plot a graph to analyse the stress pattern in the crop.
method for leaf disease detection consists of calling an expert
If the graph plotted is linear in nature then the crop is
person who can identify the diseases based on his experience
and that costs too much for an average farmer in a developing healthy and is getting the right amount of water:
country such as India as mentioned above. The conventional However, if the graph plotted is not linear the plant is
system depends on human vision and tends to human error in under duress.
some cases even with an expertise. Hence an alternative is
required for a country like India where a low cost but This system works along with an array of wireless sensor
technology dependent system is required. The best alternative network to get readings such as soil moisture, temperature, leaf
wetness, and humidity; which continually check for a disease The basic hardware of the system consists of 4 sensors, names
pattern. the temperature sensor, moister sensor, humidity sensor and the
thermo-graphic sensor. The first three sensors are a part of the
V. SYSTEM FLOW existing system and are connected to the Arduino Uno. To
conduct stress analysis it was decided that the forth sensor
The working of the system is divided into 6 parts. As the would be a thermographic sensor, so as to map the temperature
requirements of the system is well defined and test and of the chilli plant that is directly proportional to its stress level.
debugging can be done at various iterations. The incremental The Thermographic sensor is connected directly to the
development model is chosen as a model for the project. 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
Phase one: The first phase of the system is to measure database via a Xbee.
parameters such as temperature, humidity, soil moisture and
water level using various sensors.

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.

Fig.2. System Architecture

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.

[6] C. Ibarra Castanedo, D. Gonzalez, M Klein, M Pilla, S


Vallerand “Infrared Image Processing and Data Analysis”C.
Ibarra-Castanedo et al. / Infrared Physics & Technology (2004)

VIII.ACKNOWLEDGEMENT [7] Sandesh Raut Kartik Ingole International Research Journal


of Engineering and Technology (IRJET) Volume: 04 Issue: 04
The department of computer engineering of our college has “Review On Leaf Disease Detection Using Image Processing
been very supportive and has guided us in many ways while Techniques” | Apr -2017
working on this system. We would like to take this opportunity
to express our gratitude to the people who have been
instrumental in our research. We would like to extend our
sincere thanks to our project guides Ms. Ditty Varghese and Ms.
Shafaque Fatma Syed for their guidance and constant
supervision in providing necessary information regarding the
research. We would like to thank the Dean of Research and
Development of our college Dr. Amiya Tripathy for his valuable
insight. We would also like to thank our H.O.D Mrs. Nilakshi
Joshi, project co-coordinator Mrs. Sana Shaikh for providing us
with regular inputs and valuable suggestions

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
Acknowledgement
Success of a project like this, which involves high technical expertise, patience beyond limits
to sit and keep watching black and white terminal screen popping messages after messages,
collecting data and finding better ways to implement the project so that it is feasible, and
impeccable support of guides, is only possible with every team member working together. So
big congratulations to my team-mates.

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

---------------------------------------- ------------------------------------------------

(Name of Student, Roll No.) (Signature)

2. Larissa Fernandes

---------------------------------------- ------------------------------------------------
(Name of Student, Roll No.) (Signature)
3. Agin Jose

---------------------------------------- ------------------------------------------------

(Name of Student, Roll No.) (Signature)

105

You might also like