[go: up one dir, main page]

0% found this document useful (0 votes)
26 views64 pages

Crop Yield Prediction Report ML

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

Crop Yield Prediction Report ML

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

ABSTRACT

Crops are always in demand in the country, not only for the lives of the people, but also for
economic growth, so growing crops is of utmost importance. Using standard technology also
increases efficiency and lessens the workload of the farmers. Therefore, in order to increase
productivity, it is important to know about soil moisture and types of crops. Each variety of
crop and the associated soil requires a particular amount of water, so the project need to make
the most of what is available. In order to achieve this, it must utilize modern technology and
tools. This paper focuses on an automated irrigation system, i.e., irrigating fields only when
they need to be watered, by utilizing machine learning algorithms. Real-time readings of soil
moisture, fertility, and pH are sensed through sensors and are available on the system. This
method of irrigation helps to conserve water and the system provides low-cost model which
will give optimal as well as accurate results.
Chapter 1
INTRODUCTION

Agriculture is the pillar of any industrialized country's economy. consumes 85% of the
available fresh. Water utilization can be optimized by observing soil humidity, which is
useful for crop production. These days, automation manages the world. It is a method of
observing and controlling basic tasks of everyday life. Automation decreases human
effort and makes everyday action easier and more efficient. The irrigation system, or
automated irrigation system, must be able to understand the unique requirements of each
crop in the agricultural field.
This data can be leads to the irrigation system framework using machine learning
(ML). que of data analysis which allows data to learn on its own and then applies that
learning without the requirement for human interference.
One of the most captivating parts of automation is the Internet of Things. IoT makes use of
several sensors that connect with one another and provide data accuracy. IoT gives
answers for various issues and permits things to be detected or controlled from a distance.
The significant part of IoT is that it saves money and guarantees security. Smart irrigation
uses soil moisture sensors and soil pH sensors, which require some real-time information
about soil moisture in the field.

Need of Python in ML

Python is the recommended language for machine learning because of its extensive
library support. The key reason why people use Python for machine learning is that it
has access to a large number of libraries. A library is a collection of procedures and
functions that can be used by a computer language. Developers can execute complex
tasks without having to rewrite a huge number of lines of code if they have access to a
range of libraries. Machine learning is strongly reliant on statistics, mathematical
optimization, and probability, as well as Python tools that assist data scientists in
efficiently conducting various studies. Python is without a doubt one of the most
prevalent machine learning programming languages. Developers can do complex jobs
with ease if they have access to a well-developed library environment.

1
Introduction to Machine Learning

Machine learning is a sort of data analysis that mechanically builds models. Artificial
intelligence is perceived as a subset of it. Machine learning algorithms form a model
from trial data, sometimes acknowledged as "training data." from which the model can
make predictions or judgments without having to be clearly programmed to do so.
Algorithms for machine learning are utilized in a diverse range of applications. Image
identification, computer vision, speech recognition, and traffic prediction are examples
of tasks where traditional algorithms fall short. The project trains the system using
Kaggle open-source datasets to determine the quantity of irrigation required based on
crop type and fertilizer type as part of our project.

Introduction of Machine Learning Libraries


• KNN: K-nearest Neighbor Algorithm supports Supervised Learning technique, which
assumes the similarity between the new data and existing cases, and which allocates the new
case to the group that most closely resembles the current cases.

• Python: The Python programming language is used to stock data in an Excel spreadsheet,
permitting for easy access to the data from a remote location.

• Cloud Application: Data can be accessed remotely through Dropbox through the cloud
application. Farmers can monitor the state of their fields at any time using the drop box
application.

• Support Vector Classification: Support vector machine is a projecting Supervised


Learning procedure that may be used to crack both classification and regression problems. It
is to find the ideal line or decision boundary for dividing n-dimensional space into modules
so that fresh data points can be located in the appropriate classification in the future.

• Multiple linear regression: MLR, or multiple regression, is a method of foreseeing a


response variable using numerous independent factors.

2
Project Introduction

The approach of building an automated irrigation system is to ensure proper water


supply to the plants based on various requirements needed by the plants in agricultural
land, and also to help farmers to know the soil parameters in order to provide proper
irrigation as the system is designed to be accessed remotely. A sensor senses the
information in the soil, and an Arduino transmits the data to the computer, which
displays the pH value, temperature, and moisture in the soil. Using this information, we
can determine the amount of water required by the soil and which crop to cultivate in
that specific soil.
The top soil quality metrics and the programmed irrigation system are the emphasis of
our project.

Soil quality parameters:

• Soil quality factors label the state of soil ecosystem properties such as buffering,
production, filtering, and other soil processes.

The following are the soil quality parameters: stability, such as the penetration of the
soil or the granularity of the soil, generally stable (salt content, biological mass content
in soil, hefty metal contamination), fairly dynamic (pH, nutrient content), and active
(pH, nutrient content) (top soil moistness and heat).

• Soil moisture sensor: Sensors that measure the volumetric content of water are ordinarily
referred to as soil moisture sensors. It contains 2 components a probe with two exposed
conductors that inserts into the soil and a module that connects the probe to the Arduino.

• Soil pH sensor: Soil pH meters are devices that measures a soil's acidity or alkalinity. They
can estimate hydrogen potential or pH by measuring hydrogen ion activity. The pH ruler
ranges from O to 14, with O signifying extreme acidity, 7 signifying neutrality, and 14
signifying alkalinity.
• Soil temperature sensor: A soil temperature sensor is a expedient that detects and records
the heat in the soil. Different types of soil temperature sensors, including thermocouples,

3
Prediction of soil quality parameter and smart irrigation using ML Algorithm

thermistors, thermocouple wires, and averaging thermocouples, are obtainable in a


range of designs. We can convert the electrical impulses sent from soil sensors to data
loggers to multiple units of measurement, such as degrees Celsius, degrees Fahrenheit,
and degrees Kelvin.

Automated irrigation system:

The automatic irrigation procedure entails the employment of a gadget to control


irrigation structures, allowing water to flow from bays without the need for an irrigator.
There are a variety of ways to use it, such as to start and stop irrigation.

The Arduino transports the signal to the computer after sensing the data from the
sensors. As a result, the water pump is turned on and off in response to the soil's needs.
If the soil needs water, then the pump is turned on and only required amount of water is
sprinkled an automatically turned on.

PROBLEM STATEMENT

Farmers must concentrate on the rate of output in the current circumstances, due to
considerable changes in weather and population expansion. Water is wasted a lot m
traditional irrigation systems because water is irrigated directly without inspecting soil
moisture. In order to anticipate the rate of production, it is also essential to examine the
soil type.
As a result, the project physiques a smart irrigation system that monitors soil moisture
and fertility in order to lessen water waste and boost agricultural production. Using real-
time data received from the sensors, the research forecasts soil type, crop type, and
fertilizer type.
Prediction of soil quality parameter and smart irrigation using ML Algorithm

OBJECTIVES:

The major aim of our project is to generate an automatic irrigation system that resolves
the majority of irrigation and agriculture troubles, such as water control and
conservation, rising agricultural manufacture with little quantity of water, decreasing
physical involvement in watering procedures by rising the speed of watering, caring
plant life from fungi, and so on. All of these characteristics build the automatic system a
practical alternative for improving farming and irrigation effectiveness.

The following are some of the goals to keep in mind:


• Making simpler the irrigation structure by planning and
installing the entire irrigationsystem.
• This saves power and licenses for the use of automatic irrigation systems in a variety
of other
applications.
• Reduce the amount of water used.
•The entire process is automated.
• Lower your operating costs.
• Create it simple for farmers to use the system.
The goal is to create a wirelessly controlled smart irrigation system that will give an
autonomous
irrigation system that saves water, money, and time. The project employs a multi-sensor
irrigation system that monitors soil moisture and fertility while also predicting soil type,
crop type, and fertilizer type based on real-time sensor data. As a result, water waste will
be reduced, and agricultural production will improve. Farmers will discover the method to
be both economical and feasible. This irrigation technology is beneficial in areas where
water is scarce and upsurges the region's sustainability. It can also be altered to meet
the needs of diverse crop kinds that need to
be irrigated.
Chapter 2 :
Literature Survey:
In India ‗Agriculture‘ has its own history. If we check the statistics of world‘s country we can say that India
ranks second in farm output. 13.7% of the GDP (Gross Domestic Product) was accounted for agriculture and
allied sectors in 2013; about 50% of the workforce depends on farming. The contribution of agriculture to
India‘s GDP is steadily decreasing with the countries less attention over farmers. Still agriculture is the
broadest sector and plays a significant role in the overall social fabric of India.
Today automobile industries, mills and factories are expanding their areas in India. One side these are
beneficial for us as it provides job and products and at the other side these are polluting our environment. And
have become a serious challenge for global warming. Global warming is affecting our climate and we face
uncertain change in our environment which damages our agricultural crop. As told in above passage, In India
about 50% of people depends on agriculture. And global warming is one of the major problems for them.
Recently India faced a big drought in Vidarbha area of Maharashtra. The announced by government after one
year was gone. Some of the farmers were suffered too much by this drought even some did suicide.
Some of the crops of specific season are not able to get required climatic conditions due to uncertain change in
our environment due to greenhouse effect. Some of the Industries are polluting rivers by ejecting harmful
chemicals in it. Some horticultural plants don‘t grow due to insufficient watering and some due to insufficient
temperature and etc. Green house is one and only solution against uncertain climate change or global
warming. Green house helps our farmers to create an artificial environment for maintaining required
temperature, humidity and light. Today Green house systems are available in market as user desires it to work
like. But the problem is user has to observe it continuously to check whether it is working properly or not.
There is no effective monitoring of green house systems to monitor the green house climate conditions at
unbounded distance.
Weather condition may vary from place to place whereas water requirement may vary for crop to crop while
water retaining capacity from soil to soil. Excessive rainfall or scarcity of water, both can damage the crops.
Water deficiency may lead to wilting of the crops thus affecting size and weight of it. While excessive
water or rainfall may lead to leaching effect and thus wash down the nitrogen and phosphorus content of the
soil.
This system involves the use of three input transducers. The temperature, humidity and rain
sensor continuously measure the levels and transmit it to the controller via the circuitry to carry out further
processing and necessary steps.
To make the system more effective drip lines can be laid down so that water directly reaches the roots or
else a sprinkler can be used which involves the use of a simple rotor. This system can not only improve the
work efficiency, net yield but also can save human and material resources.

6
1. Rice yield estimation at pixel scale using relative vegetation indices from unmanned aerial
systems

Timely and accurate prediction of rice yield information is closely related to the people's
livelihood, which has been attached great importance by all levels of government. Satellite
remote sensing provides the possibility for large-scale crop yield estimation, but they are
usually limited by spatial and spectral resolution. Unmanned Aerial Vehicles (UAV) remote
sensing with hyperspectral sensors can obtain high spatial temporal resolution and
hyperspectral images on demand. Generally, time-series Vegetation Indices (VIs) are used for
estimating grain yield. But multi-day vegetation indices may be affected by different
background and illumination condition, so the differences between vegetation indices may
include the effects induced from external condition, which will pose a negative effect on the
accuracy of crop yield estimation. Therefore, in this study, the relative vegetation index and
relative yield were proposed and used to estimate rice yield at pixel scale. And the optimal
growth stages for crop yield estimation would also be determined. Hyperspectral images of
critical rice growth stages at tillering stage, jointing stage, booting stage, heading stage,
filling stage, ripening stage were obtained from July 28 to November 24 in 2017.Firstly, all
possible two-band combinations of discrete channels from 500nm to 900nm was used to
create Relative Normalized Difference Vegetation Index (RNDVI). Then the best RNDVI at
different growth stages were determined for rice yield estimation. Finally, different
combinations of growth stages were tested to obtain the optimal combinations for yield
estimation. These models were validated at pixel scale using the measured yields. The result
shows that four-growth-stage model with RNDVI[635, 784] at tillering stage, RNDVI[744,
807] at jointing stage, RNDVI[712,784] a booting stage, RNDVI[736, 816] at heading stage
with the multiple linear regression function gain a higher R2 (0.74) and lower
RMSE(248.97kg/ha). The mean absolute percentage error of estimated rice yield of 4.31%.
Results shows that the yield estimations at pixel scale with relative vegetation indices were
acceptable. In the study, a yield estimation method with relative vegetation indices is
proposed and the optimal growth stage combinations for rice yield estimation were
determined. This study explores the possibility of yield estimation at pixel scale using hyper
spectral images fromUAV platform, which will further improve the method system for
remote sensing of yield estimation.

7
2. Use of Deep Neural Networks for Crop Yield Prediction: A Case Study of Soybean Yield
in Lauderdale County, Alabama, USA

World population is constantly increasing, and it is necessary to have sufficient crop


production. Monitoring crop growth and yield estimation are very important for the economic
development of a nation. The prediction of crop yield has direct impact on national and
international economies and play important role in the food management and food security.
Deep learning gains importance on crop monitoring, crop type classification and crop yield
estimation applications with the recent advances in image classification using deep
Convolutional Neural Networks. Traditional crop yield prediction approaches based on
remote sensing consist of classical Machine Learning methods such as Support Vector
Machines and Decision Trees. Convolutional Neural Network (CNN] and Long-Short Term
Memory Network (LSTM] are deep neural network models that are proposed for crop yield
prediction recently. This study focused on soybean yield prediction of Lauderdale County,
Alabama, USA using 3D CNN model that leverages the spatiotemporal features. The yield is
provided from USDA NASS Quick Stat tool for years 2003-2016.The satellite data used is
collected from NASA’s MODIS land products surface reflectance, land surface temperature
and land surface temperature via Google Earth Engine. The root mean squared error (RMSE]
is used as the evaluation metric in order to be able to compare the results with other methods
that

generally, uses RMSE as the evaluation metric.

3.Crop Yield Prediction and Efficient use of Fertilizers.

India being an agriculture country, its economy predominantly depends on agriculture


yield growth and agroindustry products. Data Mining is an emerging research field in crop
yield analysis. Yield prediction is a very important issue in agricultural. Any farmer is
interested in knowing how much yield he is about to expect. Analyze the various related
attributes like location, pH value from which alkalinity of the soil is determined. Along with
it, percentage of nutrients like Nitrogen(N), Phosphorous (P), and Potassium (K) Location is
used along with the use of third-party applications like APIs for weather and temperature,
type of soil, nutrient value of the soil in that region,

amount of rainfall in the region, soil composition can be determined. All these
attributes of data will be analyzed, train the data with various suitable machine learning

8
algorithms for creating a model. The system comes with a model to be precise and accurate in
predicting crop

9
yield and deliver the end user with proper recommendations about required fertilizer ratio
based on atmospheric and soil parameters of the land which

enhance to increase the crop yield and increase farmer revenue.

4.Prediction of major crop yields of Tamilnadu using K-means and Modified KNN

Agriculture is the principal source of livelihood for more than 40 percent of the
population of this state. According to Food and Agricultural Organization (FAO)researchers,
between 2010 and 2050 the world population will increase by one third. The demand for crop
production will increase by 60% higher than the current production. Hence prediction plays a
major role to find out the demand of crop production for maximizing the yield. For that in
this paper we propose a prediction method for the major crops of Tamilnadu using K-means
and Modified K Nearest Neighbor (KNN). MATLAB and WEKA are used as the tool for
clustering and classification

respectively. The number result shows that our method is better than traditional data mining
approach.

5.Rice crop yield prediction in India using support vector machines

Food production in India is largely dependent on cereal crops including rice, wheat and
various pulses. The sustainability and productivity of rice growing areas is dependent on
suitable climatic conditions. Variability in seasonal climate conditions can have detrimental
effect, with incidents of drought reducing production. Developing better techniques to predict
crop productivity in different climatic conditions can assist farmer and other stakeholders in
better decision making in terms of agronomy and crop choice. Machine learning techniques
can be used to improve prediction of crop yield under different climatic scenarios. This paper
presents the review on use of such machine learning technique for Indian rice cropping areas.
This paper discusses the experimental results obtained by applying SMO classifier using the
WEKA tool on the dataset of 27 districts of Maharashtra state, India. The dataset considered
for the rice crop yield prediction was sourced from publicly available Indian Government
records. The parameters considered for the study were precipitation, minimum temperature,
average temperature, maximum temperature and reference crop evapotranspiration, area,
production and yield for the Kharif season (June to November) for the years 1998 to 2002.
For the present study the mean absolute error (MAE), root mean squared error (RMSE),
relative

1
absolute error (RAE) and root relative squared error (RRSE) were calculated. The
experimental results showed that the performance of other techniques on the same dataset
was much better compared to SMO.

6. Regional Winter Wheat Maturity Date Prediction Using Remote Sensing-Crop Model Data
Assimilation and Numerical Weather Prediction

Optimizing harvesting schedules requires a method for maturity date prediction, to avoid
the influence of adverse weather and prevent the decline of crop yield or quality due to
inappropriate harvest schedule. However, most prediction models are statistical-based thus
are not suitable for regional application, and remote sensing-based models lacked
predictability. We presented a framework that assimilated leaf area index (LAI) derived from
Moderate Resolution Imaging Spectro radiometer (MODIS) into World Food Studies
(WOFOST) crop growth model, and forecast meteorological data from THORPEX
Interactive Grand Global Ensemble (TIGGE) was used as weather data input for the future
periods. We selected the winter wheat planting area in Henan Province as study area and
recalibrated WOFOST model based on observation data from agrometeorological sites. A
cost function based on normalization was constructed to quantify the difference between
simulated LAI and MODIS LAI products. First the MODIS LAI profile was smoothed by
Savitzky-Golay (S-G) filter, and then these two LAI profiles were normalized to keep their
trend information. Then we selected parameters in WOFOST model that are sensitive to
maturity date as optimization parameters, such as emergence date (IDEM), effective
temperature sum from emergence to anthesis (TSUM1) and effective temperature sum from
anthesis to maturity (TSUM2). These parameters have significant differences between years
and no obvious spatial and temporal patterns. By means of Shuffled Complex Evolution
method developed at the University of Arizona (SCE-UA) algorithm, we simulated in each
pixel in the study area and retrieved the optimal parameters set of this pixel. Then we run
WOFOST by this optimal parameter set to simulate the growth and development of winter
wheat. Moreover, we transformed TIGGE data into the CABO-format weather file to drive
WOFOST simulating winter wheat growth in the next 16 d and obtained a spatial distribution
of winter wheat. Moreover, we transformed TIGGE data into the CABO-format weather file
to drive WOFOST simulating winter wheat growth in the next 16 d and obtained a spatial
distribution of winter wheat maturity date in the study area. Comparing the forecasting date
with the observed date from agrometeorological sites, it demonstrated that this method had
substantial accuracy in predicting regional maturity

1
date with correlation coefficient (R2) of 0.90 and the root mean square error (RMSE) was 1.93
d. Besides that, the distribution map of maturity prediction showed obvious spatial
variability. This method can remedy the shortages of poor predictability and lacking regional
differences in most previous methods, and it provides a reference for the future study of crop
maturity prediction at a regional scale with longer forecast period.

7.Multiple Crop Yield prediction using dual-polarimetricTerraSAR-X stripmap imagery


This paper presents the results of an experiment carried out to relate the yield from
various crops to TerraSAR-X dual polarimetric imagery. X-band wavelength has higher
sensitivity to smaller crop structures, especially stem and head density making it suitable for
relating yield to backscatter. The coherent dual-polarimetric mode of TerraSAR-X was also
used to emphasize the volume scattering through dual-polarimetric entropy/alpha
decomposition. Good correlations to yield data as gathered by harvester telemetry were
obtained.

8.Remote sensing indicators for crop growth monitoring at different scales

Crop growth monitoring is critical in yield estimation and prediction. In this paper, the
authors investigated several indicators for crop growth monitoring by remote sensing at
different scales. The experiments were conducted in a study area in Hebei province in North
China Plain. The target crop in this research is winter wheat, which is one of the important
grain crops in China. The study at canopy scale is based on field experiment with different
fertilizer supply treatments to winter wheat to get different crop growth gradients. The
canopy spectra and LAI data of different crop growth situation were collected and analyzed.
The correlation coefficients between vegetation indices and LAI were calculated. The best
growth monitoring indicators at canopy scale for each phenological stage were determined by
the correlation coefficients. The best indicator in early elongation stage is SAVI (L=0.3).
While in jointing stage, the best indicator is SAVI (L=0.2). In the heading and milk stages,
the best indicator is NDVI. At the regional scales, the multi-spectral remote sensing data from
HJ-IA satellite were used to study the crop growth monitoring indicators. The performances
of the vegetation indices at different spatial scales for crop growth monitoring were studied in
different phenological stages by comparing the correlation coefficients of vegetation indices
and LAI data. The result shows that the vegetation indices which have a function to decrease
soil-effect are suitable for the region in different crop coverage in early elongation stage and

1
for the region in low crop coverage, but they have limitations in dense crop coverage while in
booting and heading stages.

9.Assessing relevant climate data for agricultural applications

Climate change is expected to substantially reduce agricultural yields, as reported in


the by the Intergovernmental Panel on Climate Change (IPCC). In Sub-Saharan Africa and
(to a lesser extent) in South Asia, limited data availability and institutional networking
constrain agricultural research and development. Here we performed a review of relevant
aspects in relation to coupling agriculture–climate predictions, and a three-step analysis of the
importance of climate data for agricultural impact assessment. First, using meta-data from the
scientific literature we examined trends in the use of climate and weather data in agricultural
research, and we found that despite agricultural researchers’ preference for field-scale
weather data (50.4% of cases in the assembled literature), large-scale datasets coupled with
weather generators can be useful in the agricultural context. Using well-known interpolation
techniques, we then assessed the sensitivities of the weather station network to the lack of
data and found high sensitivities to data loss only over mountainous areas in Nepal and
Ethiopia (random removal of data impacted precipitation estimates by ±1300 mm/year and
temperature estimates by ±3 ◦C). Finally, we numerically compared IPCC Fourth Assessment
Report (4AR) climate models’ representation of mean climates and interannual variability
with different observational datasets. Climate models were found inadequate for field-scale
agricultural studies in West Africa and South Asia, as their ability to represent mean climates
and climate variability was limited: more than 50% of the country-model combinations
showed.

1
10.Crop Syst , a Cropping Systems Simulation Model: Water/Nitrogen Budgets and Crop
Yield

In agriculture, water and nitrogen are two critical resources for growing a crop.
However, their management cannot be analyzed independently of weather, soil
characteristics, field hydrology, crop characteristics, crop rotation, and management factors.
This paper describes the water, nitrogen, and crop growth components of CropSyst, a
comprehensive cropping systems simulation model, and provides preliminary verification of
these components. The water budget of the model properly describes crop water use.
Predicted nitrogen contents throughout the soil profile did not exactly match the measured
values from leaching experiments, but they did follow the general trends of the data. The
agreement between simulated and observed biomass and yield of corn, winter wheat and
spring wheat grown in two locations with a total of 77 data points was good as shown by
several statistical indicators. Based on this preliminary validation, CropSyst appears
promising as a tool to analyze management practices for water and nitrogen. Additional
validation of model components, including a wide range of crops and conditions, should be
conducted in the future

1
Chapter 3
System Requirement Specification

A software requirements specification (SRS) – a requirements specification for a


software system – is a complete description of the behavior of a system to be developed. In
addition to a description of the software functions, the SRS also contains non-functional
requirements. Software requirements are a sub-field of software engineering that deals with
the elicitation, analysis, specification, and validation of requirements for software.

INTRODUCTION

Software requirements are a sub-field of software engineering that deals with the elicitation,
analysis, specification, and validation of requirements for software.

GENERAL DESCRIPTION PRODUCT

PERSPECTIVE

 Python is an interpreted, high-level, general-purpose programming language.

 Its language constructs and object-oriented approach aim to help programmers write
clear, logical code for small and large-scale projects.

 Python is dynamically typed and garbage collected. It supports multiple programming


paradigms, including procedural, object-oriented, and functional programming.
Python is often described as a "batteries included" language due to its comprehensive
standard library.

 Multi-platform: Python is available for all major operating systems, Windows,


Linux/Unix, MacOS X, most likely your mobile phone OS, etc.
 The Jupyter Notebook is an interactive computing environment that enables users to
author notebook documents that include: - Live code - Interactive widgets - Plots -
Narrative text - Equations - Images – Video
 These documents provide a complete and self-contained record of a computation
that can be converted to various formats and shared with others using email, Dropbox,
version control systems

1
REQUIREMENTS

FUNCTIONAL REQUIREMENTS

• Identify the effect of various factors such as temperature and humidity and, Moisture
Sensor.

• System should automatically pump the motor in case of low Moisture Level.

• System Should automatically detect plant growth through machine learning models.

• To integrate this with a user interface and for real-time data.

NON-FUNCTIONAL REQUIREMENTS

• Usability: The application is required to be easily usable.

• Reliability: The system is expected to make reliable prediction of plant growth.

• Compatibility: The system is required to be compatible on various platforms.

• Performance: The model is required to make prediction with minimum response time
and minimum percentage error.

• Scalability: The system is required to be flexible and adaptive to growing and


changing datasets.

SOFTWARE REQUIREMENTS

Operating System Windows XP or above

Programming language Python

Development environment Anaconda-jupyter

1
HARDWARE REQUIREMENTS

Processor Intel Core i5 or AMD FX 8 core series


with clock speed of 2.4 GHz or above
and Arduino Uno
RAM 2GB or above

Hard disk 40 GB or above

Input device Keyboard, mouse

Sensors Moisture, Humidity and Temperature


Sensor, Ph Sensor , NPK Sensor ,
Other hardware LCD Display , Pump

1
System Design:
Analysis is the process of breaking a complex topic or substance into smaller parts to
gain a better understanding of it. Analysts in the field of engineering look at requirements,
structures, mechanisms, and systems dimensions. Analysis is an exploratory activity. The
Analysis Phase is where the project lifecycle begins. The Analysis Phase is where you break
down the deliverables in the high-level Project Charter into the more detailed business
requirements. The Analysis Phase is also the part of the project where you identify the overall
direction that the project will take through the creation of the project strategy documents.

INTRODUCTION

Gathering requirements is the main attraction of the Analysis Phase. The process of gathering
requirements is usually more than simply asking the users what they need and writing their
answers down. Depending on the complexity of the application, the process for gathering
requirements has a clearly defined process of its own. This process consists of a group of
repeatable processes that utilize certain techniques to capture, document, communicate, and
manage requirements.

Systems design is the process of defining the architecture, components, modules, interfaces,
and data for a system to satisfy specified requirements. Systems design could see it as the
application of systems theory to product development. There is some overlap with the
disciplines of systems analysis, systems architecture and systems engineering.

If the broader topic of product development "blends the perspective of marketing, design,
and manufacturing into a single approach to product development," then design is the act of
taking the marketing information and creating the design of the product to be manufactured.
Systems design is therefore the process of defining and developing systems to satisfy
specified requirements of the user.

Until the 1990s systems design had a crucial and respected role in the data processing
industry. In the 1990s standardization of hardware and software resulted in the ability to build
modular systems. The increasing importance of software running on generic platforms has
enhanced the discipline of software engineering.

1
Object-oriented analysis and design methods are becoming the most widely used methods
for computer systems design. The UML has become the standard language in object-oriented
analysis and design. It is widely used for modelling software systems and is increasingly used
for high designing non-software systems and organizations.

System design is one of the most important phases of software development process. The
purpose of the design is to plan the solution of a problem specified by the requirement
documentation. In other words, the first step in the solution to the problem is the design of the
project.

The design of the system is perhaps the most critical factor affecting the quality of the
software. The objective of the design phase is to produce overall design of the software. It
aims to figure out the modules that should be in the system to fulfil all the system
requirements in an efficient manner.

The design will contain the specification of all these modules, their interaction with other
modules and the desired output from each module. The output of the design process is a
description of the software architecture.

The design phase is followed by two sub phases

• High Level Design

• Low Level Design.

1
SYSTEM ARCHITECTURE

HIGH LEVEL DESIGN

In the high-level design, the proposed functional and non-functional requirements of the
software are depicted. Overall solution to the architecture is developed which can handle
those needs. This chapter involves the following consideration.

• Design consideration

• Data flow diagram

4.3.1 DESIGN CONSIDERATION

There are several design considerations issues that need to be addressed or resolved before
getting down designing a complete solution for the system.

DATA FLOW DIAGRAM

A data flow diagram is the graphical representation of the flow of data through an
information system. DFD is very useful in understanding a system and can be efficiently used
during analysis. A DFD shows the flow of data through a system. It views a system as a
function that transforms the inputs into desired outputs. Any complex systems will not

2
perform this transformation in a single step and a data will typically undergo a series of
transformations before it becomes the output.

With a data flow diagram, users are able to visualize how the system will operate that the
system will accomplish and how the system will be implemented, old system data flow
diagrams can be drawn up and compared with a new systems data flow diagram to draw
comparisons to implement a more efficient system.

Data flow diagrams can be used to provide the end user with a physical idea of where the data
they input, ultimately as an effect upon the structure of the whole system.

Below section explains the module wise data flow diagram.

DATA COLLECTION

In this module datasets are collected from various sources like GKVK, DES,
agmarknet.gov.in and krishimaratavahini. The datasets include information like temperature,
rainfall, price, area, production and yield of the previous 5 years (2013- 2018).

2
DATA PRE-PROCESSING: Data pre-processing includes removing of the unwanted
attributes from our datasets. Feature extraction is done in order to extract only the attributes
that affect the growth of the plant.

2
Dataflow Diagram Level 2:

2
Low Level Design:

During the detailed phase, the view of the application developed during the high-level design
is broken down into modules and programs.

INTRODUCTION

During the detailed phase, the view of the application developed during the high-level design
is broken down into modules and programs. Logic design is done for every program and then
documented as program specifications. For every program, a unit test plan is created. The
entry criteria for this will be the HLD document. And the exit criteria will the program
specification and unit test plan (LLD).

USE CASE DIAGRAM

A use case diagram at its simplest is a representation of a user's interaction with the system
that shows the relationship between the user and the different use cases in which the user is
involved. A use case diagram can identify the different types of users of a system and the
different use cases and will often be accompanied by other types of diagrams as well. While
a use case itself might drill into a lot of detail about every possibility, a use case diagram
can help provide a higher-level view of the system. It has been said before that "Use case
diagrams are the blueprints for your system". They provide the simplified and graphical
representation of what the system must do.

2
2
SEQUENCE DIAGRAM

A sequence diagram in a Unified Modeling Language (UML) is a kind of interaction diagram


that shows how processes operate with one another and in what order. It shows the
participants in an interaction and the sequence of messages among them; each participant is
assigned a column in a table.

Below section shows the sequence diagram in this application.

2
CHAPTER 5

IMPLEMENTATION

Implementation is the carrying out, execution or practice of a plan, a method, or any design,
idea, model, specification, standard or policy for doing something. As such, implementation
is the action that must follow any preliminary thinking in the order for something to actually
happen. Implementations allow the users to take over its operation for use and evaluation. It
involves training the users to handles the system and plan for a smooth conversion.

Implementation is a process of ensuring that the information system is

 Constructing a new system from scratch.


 Constructing a new system from the existing system.

HARDWARE IMPLEMENTATION

2
Arduino Uno:

Arduino is an open source computer hardware and software that designs single-board
microcontrollers and microcontroller kits for building digital devices and interactive objects that can sense and
control objects in the physical and digital world. The project's products are distributed as open-source
hardware and software, which are licensed under the GNU Lesser General Public License (LGPL). Arduino
boards are available commercially in preassembled form or by designing the kits with respect to different
application.Figure 3.2 and 3.3 shows the Arduino Uno board and pin diagram respectively.
The different types of Arduino Uno are Arduino Nano,Arduino Pro Mini,Arduino Mega, Arduino Due,
and Arduino Leonardo.

Fig 4.2:Arduino Uno board

Fig 4.3:Arduino Uno board pin diagram

PIN DESCRIPTION
Table 3.1 explains the pin descriptionArduino Uno board.
Table : The pin descriptionArduino Uno board.

2
Pin Category Pin Name Details
Vin: Input voltage to Arduino when
using an external power source.
5V: Regulated power supply used to
Power Vin, 3.3V, 5V, GND
power microcontroller and other
components on the board.
3.3V: 3.3V supply generated by on-
board voltage regulator. Maximum
current draw is 50mA.
GND: ground pins.
Reset Reset Resets the microcontroller.

Used to provide analog input in the


Analog Pins A0 – A5
range of 0-5V

Input/output Pins Digital Pins 0 - 13 Can be used as input or output pins.

Used to receive and transmit TTL


Serial 0(Rx), 1(Tx)
serial data.

External Interrupts 2, 3 To trigger an interrupt.

PWM 3, 5, 6, 9, 11 Provides 8-bit PWM output.

10 (SS), 11 (MOSI), 12
SPI Used for SPI communication.
(MISO) and 13 (SCK)

10 (SS), 11 (MOSI), 12
SPI Used for SPI communication.
(MISO) and 13 (SCK)

Inbuilt LED 13 To turn on the inbuilt LED.

TWI A4 (SDA), A5 (SCA) Used for TWI communication.

To provide reference voltage for


AREF AREF
input voltage.

ARDUINO UNO TECHNICAL SPECIFICATION


Table 3.2 explains the Arduino Uno technical specification.
Table 3.2: Arduino Uno technical specification

2
Microcontroller ATmega328P – 8 bit AVR family microcontroller

Operating Voltage 5V

Recommended Input
7-12V
Voltage

Input Voltage Limits 6-20V

Analog Input Pins 6 (A0 – A5)

Digital I/O Pins 14 (Out of which 6 provide PWM output)

DC Current on I/O Pins 40 mA

DC Current on 3.3V Pin 50 mA

Flash Memory 32 KB (0.5 KB is used for Bootloader)

SRAM 2 KB

EEPROM 1 KB

Frequency (Clock
16 MHz
Speed)

OVERVIEW
Arduino Uno is a microcontroller board based on 8-bit ATmega328P microcontroller. Along with
ATmega328P, it consists other components such as crystal oscillator, serial communication, voltage regulator,
etc. to support the microcontroller. Arduino Uno has 14 digital input/output pins (out of which 6 can be used
as PWM outputs), 6 analog input pins, a USB connection, A Power barrel jack, an ICSP header and a reset
button.

HOW TO USE AURDINO BOARD


The 14-digital input/output pins can be used as input or output pins by using pin Mode (), digital Read () and
digital Write () functions in Arduino programming. Each pin operates at 5V and can provide or receive a
maximum of 40mA current and has an internal pull-up resistor of 20-50 K Ohms which are disconnected by
default. Out of these 14 pins, some pins have specific functions as listed below:

1. Serial Pins 0 (Rx) and 1 (Tx): Rx and Tx pins are used to receive and transmit TTL serial data. They
are connected with the corresponding ATmega328P USB to TTL serial chip.
2. External Interrupt Pins 2 and 3: These pins can be configured to trigger an interrupt on a low value,
a rising or falling edge, or a change in value.

3
3. PWM Pins 3, 5, 6, 9 and 11: These pins provide an 8-bit PWM output by using analog Write ()
function.
4. SPI Pins 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK): These pins are used for SPI
communication.
5. In-built LED Pin 13: This pin is connected with built-in LED.When pin 13 is high, then LED willON
and when 13 pin is low, it represent led is OFF.

There are 14digital pins and 6 analog input pins, each of which provides 10 bits of resolution, i.e. 1024
different values. They measure from 0 to 5 volts but this limit can be increased by using AREF pin with
analog reference () function.
Analog pin 4 Serial Data Access(SDA) and pin 5 scratch controlling aurduino(SCA) also used for TWI
communication using wire library.Arduino Uno has a couple of other pins as explained below:

1. AREF: Used to provide reference voltage for analog inputs with analog Reference () function.
2. Reset Pin: Making this pin LOW, resets the microcontroller.

COMMUNICATION
Arduino can be used to communicate with a computer, another Arduino board or other
microcontrollers. The ATmega328P microcontroller provides UART TTL (5V) serial communication which
can be done using digital pin 0 (Rx) and digital pin 1 (Tx). An ATmega16U2 on the board channels this serial
communication over USB and appears as a virtual com port to software on the computer. The ATmega16U2
firmware uses the standard USB COM drivers, and no external driver is needed. However, on Windows, a in
file is required.

The Arduino software includes a serial monitor which allows simple textual data to be sent to and
from the Arduino board. There are two RX and TX LEDs on the Arduino board which will flash when data is
being transmitted via the USB-to-serial chip and USB connection to the computer (not for serial
communication on pins 0 and 1). A Software Serial library allows for serial communication on any of the
Uno's digital pins. The ATmega328P also supports I2C (TWI) and SPI communication. The Arduino software
includes a Wire library to simplify use of the I2C bus.

ARDUINO UNO TO ATMEGA328 PIN MAPPING


When ATmega328 chip is used in place of Arduino Uno, or vice versa, the image below shows the pin
mapping between the two.

3
SOFTWARE
Arduino IDE (Integrated Development Environment) is required to program the Arduino Uno board.

ARDUINO PROGRAMMING
Once Arduino IDE is installed on the computer, connect the board with computer using USB cable.
Now open the Arduino IDE and choose the correct board by selecting Tools>Boards>Arduino/Genuine Uno
and choose the correct Port by selecting Tools>Port. Arduino Uno is programmed using Arduino
programming language based on Wiring. To get it started with Arduino Uno board and blink the built-in LED,
load the example code by selecting Files>Examples>Basics>Blink. Once the example code (also shown
below) is loaded into the IDE, click on the ‘upload’ button given on the top bar. Once the upload is finished, it
should see the Arduino’s built-in LED blinking. Below is the example code for blinking.

// the setup function runs once it press reset or power the board

void setup () {

// initialize digital pin LED_BUILTIN as an output.

pin Mode (LED_BUILTIN, OUTPUT);

// the loop function runs over and over again forever

void loop () {

digital Write (LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)

delay (1000); // wait for a second

digital Write (LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW

delay(1000); // wait for a second

3.3.1.9APPLICATIONS

1. Prototyping of Electronics Products and Systems


2. Multiple DIY Projects.
3. Easy to use for beginner level DIY and makers.
4. Projects requiring Multiple I/O interfaces and communications.

3
3.3.1.10 ARDUINO UNO 2D MODEL

Fig 3.4:Arduino Uno 2D Model

Moisture Sensor SA SM01


In this sensor we are using 2 Probes to be dipped into the Soil As per Moisture We will get
Analogue Output variations from 0.60volts - 12volts. Soil moisture sensors measure the water
content in soil. A soil moisture probe is made up of multiple soil moisture sensors. One
common type of soil moisture sensors in commercial use is a Frequency domain sensor such
as a capacitance sensor. Another sensor, the neutron moisture gauge, utilizes the moderator
properties of water for neutrons.

3
Fig: 5.2 Moisture Sensor SA SM01

3
Advantages
 Very Sensitive
 Very efficient and accurate
 Analogue and Digital Output

Applications

 Irrigation Applications
 Small- and Large-Scale Industries
 Green House

Humidity sensor
A humidity sensor (or hygrometer) senses, measures and reports both moisture and air
temperature. The ratio of moisture in the air to the highest amount of moisture at a particular air
temperature is called relative humidity. Relative humidity becomes an important factor when
looking for comfort.

Fig: 5.3 Humidity Sensor


Soil Ph / NPK Sensor:

With Three-Way Soil Meter For Moisture, Light Intensity and pH Testing Meter, you can easily check on the
condition of your plants. The moisture meter will quickly tell whether your plants are doing well. Firstly, let you
know that dry and needs water or wet and could use a day to dry out, you will never over/under water your plants
again. Secondly, it helps you to control pH level in soil, acidic or alkaline is suitable for your plants. Thirdly, testing
whether plants getting adequate sunlight. Above all, equipped with this meter, you can give the best care to your
plants and keep the soil and lawn healthy and happy. Note: Please remove probes from soil and wipe clean after
each use.
Soil pH is one of the most important factors that can be overlooked in the garden. pH has impacts on the availability
of nutrients and of the plants ability to take them up. If the pH of your garden soil is not in the optimal range for the
plants you are trying to grow you may end up having issues. Often plants grown in a soil that does not have the
optimal pH dont produce or if they do their harvests are low while the plant may look stressed. On todays joint
episode between the Testing Garden Assumptions and Urban Garden Series, I am going to take a look at soil pH,
how to easily measure it and how you can adjust the pH over time if need be. pH is measured on a 14 point scale
with 0 being the most acidic 7 neutral and 14 the most basic.
Three Way Soil Meter With PH Detector is a Perfect tool to test the soil conditions (Moisture/Light/ PH) of
fruits, flowers, vegetables, shrubs, etc. Its an Ideal and necessary tool for gardeners, vegetable and fruit growers, and
all those who plant trees and grass. The meter can be Simply inserted into the soil and switch to the setting you want
to measure and read the scale.

Features:

1. Three different soil test meters in one device; Measures moisture, pH/Acidity, and light.
2. 100% Accuracy; Easy to read moisture, pH and light levels; Perfect monitor for growing healthy plants.
3. Takes the guesswork out of gardening; Know exactly when to water, amend your soil or adjust lighting.
4. Compact, portable & easy to use, just plug and use; Compact soil meter works indoor/outdoors.
5. Save water, energy and keep your plants, lawn, flower in top condition.
6. Measures moisture at root level.
7. No battery required, simple and convenient to use.
8. Multifunctional : Can test Moisture / Light / pH.
9. Scientifically accurate
Wi-Fi Module

The ESP8266 Wi-Fi Module is a self contained SOC with integrated TCP/IP protocol stack that can give
Arduino microcontroller access to your Wi-Fi network. ESP8266 is Wi-Fi enabled system on chip (SoC)
module developed by Espress if system. It is mostly used for development of IoT (Internet of Things) embedded
applications. It employs a 32-bit RISC CPU based on the Tensilica Xtensa L106 running at 80 MHz (or
overclocked to 160 MHz). It has a 64 KB boot ROM, 64 KB instruction RAM and 96 KB data RAM. External
flash memory can be accessed through SPI. ESP8266 module is low cost standalone wireless transceiver that
can be used for end-point IoT developments. To communicate with the ESP8266 module, microcontroller needs
to use set of AT commands. Microcontroller communicates with ESP8266-01 module using UART having
specified Baud rate.

Pin description:

3V3: - 3.3 V Power Pin.

GND: - Ground Pin.

RST: - Active Low Reset Pin.

EN: - Active High Enable Pin.

TX: - Serial Transmit Pin of UART.

RX: - Serial Receive Pin of UART.

The ESP8266 WiFi Module (figure 4.9) is a self-contained SoC with integrated TCP/IP protocol stack that can
give access to your WiFi network (or the device can act as an access point). One useful feature of Uno WiFi is
support for OTA (over-the-air) programming, either for transfer of Arduino sketches or WiFi firmware.

Fig 4.5.5 Wi-Fi Module


SOFTWARE IMPLEMENTATION

The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on
the board channels this serial communication over USB and appears as a virtual com port to
software on the computer. The '16U2 firmware uses the standard USB COM drivers, and no
external driver is needed. However, on Windows, a .inf file is required. The Arduino software
includes a serial monitor which allows simple textual data to be sent to and from the Arduino
board. The RX and TX LEDs on the board will flash when data is being transmitted via the
USB-to-serial chip and USB connection to the computer (but not for serial communication on
pins 0 and 1).
A Software Serial library allows for serial communication on any of the Uno's digital
pins.

The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software
includes a Wire library to simplify use of the I2C bus; see the documentation for details. For
SPI communication, use the SPI library.
The Arduino Uno can be programmed with the Arduino software. The ATmega328 on the
Arduino Uno comes pre burned with a bootloader that allows you to upload new code to it
without the use of an external hardware programmer. It communicates using the original
STK500 protocol (reference, C header files).

3
Liquid Crystal Display[5]

Figure 2.7:16x2 LCD display [5]

Liquid crystal display is very important device in embedded system. It offers high flexibility to
user as he can display the required data on it. But due to lack of proper approach to LCD interfacing
many of them fail. LCD driver/controller is used in LCD. It is dumb it does not know to talk with
microcontroller. LCD driver is a link between the microcontroller and LCD. LCD driver finds whether
hardware reset is required at start up, the time of reset pulse, is it active low and which pins of LCD are
to be toggled.

Major task in LCD interfacing is the initialization sequence. In LCD initialization command
bytes must be sent to LCD and set the interface mode, display mode, address counter increment
direction, set contrast of LCD, horizontal or vertical addressing mode, colour format. Next step after
initialization is to send data bytes to required display data RAM memory location. Firstly set the address
location using address set command byte and then send data bytes using the DDRAM write command.
To address specific location in display data RAM one must have the knowledge of how the address
counter is incremented. Incorporation of a refreshing controller in to LCD, there by relieving the CPU of
the task of refreshing the LCD. In contrast LCD must be refreshed by CPU to keep displaying the data.

Interfacing LCD with microcontroller

Interfacing LCD with microcontroller is very easy task if the proper LCD programming
algorithm is known.

LCD used here has HD44780u dot matrix LCD controller. LCD module has 8-bit data interface
and control pins. One can send data as 8-bit or in pair of two 4-bit nibbles.

To display any character on LCD micro controller has to send its ASCII value to the data bus of
LCD. For e.g. to display 'AB' microcontroller has to send two hex bytes 41h and 42h respectively. LCD
display used here is having 16x2 size. It means 2 lines each with 16 characters.

Algorithm to send data to LCD

3
 Make R/W low
 Make RS=0 ;if data byte is command
 RS=1 ; if data byte is data (ASCII value)
 Place data byte on data register
 Pulse E (HIGH to LOW)
 Repeat the steps to send another data byte

LCD Initialization

Steps to initialize the LCD

1. Specify function set: Send 38H for 8-bit, double line and 5x7 dot character format.

2. Display On-Off control: Send 0FH for display and blink cursor on.

3. Entry mode set: Send 06H for cursor in increment position and shift is invisible.

4. Clear display: Send 01H to clear display and return cursor to home position

Next step after initialization is to send data bytes to required display data RAM memory
location. Firstly set the address location using address set command byte and then send data bytes using
the DDRAM write command. To address specific location in display data RAM one must have the
knowledge of how the address counter is incremented.

16X2 LCD

16X2 LCD can be used to display 16 characters in 2 rows. It has the ability to display numbers,
characters and graphics. It has an inbuilt refreshing circuit, thereby relieving the CPU from the task of
refreshing. LCD discussed has total of 14 pins.

Table2.1 LCD pin Description

Pin Symbol I/O Description

1 Vss - Ground

2 Vcc - +5V Power Supply

3 Vee - Power Supply to contrast

4
4 RS I RS = 0 to select command register

5 R/W I RS = 1 to select data register

6 EN I/O Enable

7 to 14 D0 to D8 I/O 8 bit data bus

Table2.2 LCD Command Codes

Code(HEX) Command to LCD Instruction Register

1 Clear display screen

2 Return home

4 Decrement cursor (shift cursor to left)

6 Increment cursor (shift cursor to right)

80 Force cursor to the beginning of first line

C0 Force cursor to the beginning of second line

38 2 lines and 5x7 matrix

4
Internal structure of LCD module

Figure2.8 : Internal structure of LCD module[5]

LCD is connected to the microcontroller through the controller interface. LCD has an internal
memory which stores the lookup table for all the characters. Any ASCII value of a character that is
passed to the LCD module is compared with the lookup table in the memory and that value is displayed.

Relay:
This is a small and easy to use 1 channel relay board that operates on 12V. Use it to control one 240V power
appliance directly from Arduino, Raspberry Pi, and other microcontrollers or low voltage circuits. Perfect for
switching 240V appliances lights, fans, etc, and even high power motors at lower voltages.
The board uses a high-quality relay, which can handle a maximum of 10A/250 V AC or 15A/125V AC. Each
relay has all three connections Common, Normally Open, Normally Closed brought out to 3 pin screw
terminals which make it easy to make and remove connections. The board has a power indication and a relay
status LED to ease debugging. The board can accept control inputs within a wide range of voltages from 4V to
12V.
Power input and relay control signals are brought to header pins on the board. Hence, the board can be easily
interfaced with our development boards using our female to female jumper wires.

Features:

1. Brand new and high quality.


2. 1-Channel Relay interface board,
3. Equipped with high-current relay : 15A @ 125V AC or 10A @ 250V AC
4. Standard interface that can be controlled directly by microcontroller (Arduino, 8051, AVR, PIC, DSP,
ARM)

4
Water Pump:

Micro DC 3-6V Micro Submersible Pump Mini water pump For Fountain Garden Mini water circulation
System DIY project. This is a low cost, small size Submersible Pump Motor which can be operated from a 3 ~
6V power supply. It can take up to 120 liters per hour with very low current consumption of 220mA. Just
connect tube pipe to the motor outlet, submerge it in water and power it. Make sure that the water level is
always higher than the motor. Dry run may damage the motor due to heating and it will also produce noise.

Specifications:-

 Operating Voltage : 3 ~ 6V

 Operating Current : 130 ~ 220mA

 Flow Rate : 80 ~ 120 L/H

 Maximum Lift : 40 ~ 110 mm

 Continuous Working Life : 500 hours

 Driving Mode : DC, Magnetic Driving

 Material : Engineering Plastic

 Outlet Outside Diameter : 7.5 mm

 Outlet Inside Diameter : 5 mm

4
Software Implementation:

Python IDE

Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a
simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing,
together with its interpreted nature, make it an ideal language for scripting and rapid application development
in many areas on most platforms. The Python interpreter is easily extended with new functions and data types
implemented in C or C++ (or other languages callable from C). Python is also suitable as an extension
language for customizable applications.

OpenCV

OpenCV is a library of programming functions mainly aimed at real-time computer vision. It has a modular
structure, which means that the package includes several shared or static libraries. We are using image
processing module that includes linear and non-linear image filtering, geometrical image transformations
(resize, affine and perspective warping, and generic table-based remapping), color space conversion,
histograms, and so on. Our project includes libraries such as Viola-Jones or Haar classifier, LBPH (Lower
Binary Pattern histogram) face recognizer, Histogram of oriented gradients (HOG).

5.3 OpenCV-Python
Python is a general purpose programming language started by Guido van Rossum, which became very popular
in short time mainly because of its simplicity and code readability. It enables the programmer to express his
ideas in fewer lines of code without reducing any readability.

Compared to other languages like C/C++, Python is slower. But another important feature of Python is that it
can be easily extended with C/C++. This feature helps us to write computationally intensive codes in C/C++
and create a Python wrapper for it so that we can use these wrappers as Python modules. This gives us two
advantages: first, our code is as fast as original C/C++ code (since it is the actual C++ code working in
background) and second, it is very easy to code in Python. This is how OpenCV-Python works, it is a Python
wrapper around original C++ implementation. And the support of Numpy makes the task more
easier. Numpy is a highly optimized library for numerical operations. It gives a MATLAB-style syntax. All
the OpenCV array structures are converted to-and-from Numpy arrays. So whatever operations you can do in
Numpy, you can combine it with OpenCV, which increases number of weapons in your arsenal. Besides that,
several other libraries like SciPy, Matplotlib which supports Numpy can be used with this. So OpenCV-
Python is an appropriate tool for fast prototyping of computer vision problems.

4
OpenCV-Python working
OpenCV introduces a new set of tutorials which will guide you through various functions available in
OpenCV-Python. This guide is mainly focused on OpenCV 3.x version (although most of the tutorials will
work with OpenCV 2.x also).

A prior knowledge on Python and Numpy is required before starting because they won’t be covered in
this guide. Especially, a good knowledge on Numpy is must to write optimized codes in OpenCV-Python.

This tutorial has been started by Abid Rahman K. as part of Google Summer of Code 2013 program, under the
guidance of Alexander Mordvintsev.

OpenCV Needs us..


Since OpenCV is an open source initiative, all are welcome to make contributions to this library. And
it is same for this tutorial also. So, if you find any mistake in this tutorial (whether it be a small spelling
mistake or a big error in code or concepts, whatever), feel free to correct it. And that will be a good task for
freshers who begin to contribute to open source projects. Just fork the OpenCV in github, make necessary
corrections and send a pull request to OpenCV. OpenCV developers will check your pull request, give you
important feedback and once it passes the approval of the reviewer, it will be merged to OpenCV. Then you
become a open source contributor. Similar is the case with other tutorials, documentation etc.

As new modules are added to OpenCV-Python, this tutorial will have to be expanded. So those who knows
about particular algorithm can write up a tutorial which includes a basic theory of the algorithm and a code
showing basic usage of the algorithm and submit it to OpenCV.

Getting Started with Images


Goals

 Here, you will learn how to read an image, how to display it and how to save it back
 You will learn these functions : cv2.imread(), cv2.imshow() , cv2.imwrite()
 Optionally, you will learn how to display images with Matplotlib

Using OpenCV
Read an image
Use the function cv2.imread() to read an image. The image should be in the working directory or a full path of
image should be given.

Second argument is a flag which specifies the way image should be read.

 cv2.IMREAD_COLOR : Loads a color image. Any transparency of image will be neglected. It is the
default flag.

4
 cv2.IMREAD_GRAYSCALE : Loads image in grayscale mode
 cv2.IMREAD_UNCHANGED : Loads image as such including alpha channel

Display an image
Use the function cv2.imshow() to display an image in a window. The window automatically fits to the image
size.

First argument is a window name which is a string. second argument is our image. You can create as many
windows as you wish, but with different window ncv2.waitKey() is a keyboard binding function. Its argument
is the time in milliseconds. The function waits for specified milliseconds for any keyboard event. If you press
any key in that time, the program continues. If 0 is passed, it waits indefinitely for a key stroke. It can also be
set to detect specific key strokes like, if key a is pressed etc which we will discuss below.

cv2.destroyAllWindows() simply destroys all the windows we created. If you want to destroy any specific
window, use the function cv2.destroyWindow() where you pass the exact window name as the argument.

5.4 Image processing module

Purpose of Image processing

The purpose of image processing is divided into 5 groups. They are:


1. Visualization- Observe the objects that are not visible.
2. Image sharpening and restoration- To create a better image.
3. Image retrieval- Seek for the image of interest.
4. Measurement of pattern– Measures various objects in an image.
5. Image Recognition– Distinguish the objects in an image.

4
 CROP YEILD PREDICTION

The outcome of crop yield primarily depends on parameters such as variety of crop, seed
type and environmental parameters such as sunlight (Temperature), soil (ph), water (ph),
rainfall and humidity. By analyzing the soil and atmosphere at particular region best crop in
order to have more crop yield and the net crop yield can be predicted. This prediction will
help the farmers. To choose appropriate crops for their farm according to the soil type,
temperature, humidity, water level, spacing depth, soil PH, season, fertilizer and months.

 FERTILIZER PREDICTION

India is a highly populated country and randomly change in the climatic conditions need to
secure the world food resources. Framers face serious problems in drought conditions. Type
of soil plays a major role in the crop yield. Suggesting the use of fertilizers may help the
farmers to make the best decision for their cropping situation.

4
Based on soil type and soil PH we suggest what kind of fertilizer should be used for
particular crop.

 RANDOM FOREST

Random Forest algorithm is a supervised classification algorithm. We can see it from its
name, which is to create a forest by some way and make it random. There is a direct
relationship between the number of trees in the forest and the results it can get: the larger the
number of trees, the more accurate the result. But one thing to note is that creating the forest
is not the same as constructing the decision with information gain or gain index approach.

How Random Forest Algorithm Works?

There are two stages in Random Forest algorithm, one is random forest creation, the
other is to make a prediction from the random forest classifier created in the first stage. The
whole process is shown below, and it’s easy to understand using the figure.

firstly, shows the Random Forest creation pseudocode:

1. Randomly select “K” features from total “m” features where k << m

2. Among the “K” features, calculate the node “d” using the best split point

3. Split the node into daughter nodes using the best split

4. Repeat the a to c steps until “l” number of nodes has been reached

5. Build forest by repeating steps a to d for “n” number times to create “n” number of trees

F11 F12 F13 F14 F15 T1 F11 F12 F13 F14 F15 T1

F21 F22 F23 F24 F25 T2 F81 F82 F83 F84 F85 T8

: : : : : : : : : : : :

: : : : : : : : : : : :

Fm1 Fm2 Fm3 Fm4 Fm5 Tm Fj1 Fj2 Fj3 Fj4 Fj5 Tj

4
F21 F22 F23 F24 F25 T2 F31 F32 F33 F34 F35 T3

F51 F52 F53 F54 F55 T5 F61 F62 F63 F64 F65 T6

: : : : : : : : : : : :

: : : : : : : : : : : :

Fm1 Fm2 Fm3 Fm4 Fm5 Tm Fk1 Fk2 Fk3 Fk4 Fk5 Tk

Fig: 1.1 Different random forest trees dataset

In the next stage, with the random forest classifier created, we will make the prediction. The
random forest prediction pseudocode is shown below:

1. Takes the test features and use the rules of each randomly created decision tree to
predict the outcome and stores the predicted outcome (target)

2. Calculate the votes for each predicted target

3. Consider the high voted predicted target as the final prediction from the random forest
algorithm

4
Fig: 1.2 Random Forest Tree

5
Applications of Random Forest

 Banking Random forest algorithm is used to find loyal customers, which means
customers who can take out plenty of loans and pay interest to the bank properly, and
fraud customers, which means customers who have bad records like failure to pay back
a loan on time or have dangerous actions.

 Medicine Random forest algorithm can be used to both identify the correct
combination of components in medicine, and to identify diseases by analyzing the
patient’s medical records.

 Stock Market Random forest algorithm can be used to identify a stock’s behaviour and
the expected loss or profit.

 E-Commerce Random forest algorithm can be used for predicting whether the
customer will like the recommend products, based on the experience of similar
customers.

Advantages of Random Forest Algorithm

1. For applications in classification problems, Random Forest algorithm will avoid the
overfitting problem

2. For both classification and regression task, the same random forest algorithm can
be used

3. The Random Forest algorithm can be used for identifying the most important
features from the training dataset, in other words, feature engineering.

5
Chapter 6:

Testing
Testing is the process of evaluating a system or its component(s) with the intent to find whether it satisfies the
specified requirements or not. Testing is executing a system in order to identify any gaps, errors, or missing
requirements in contrary to the actual requirements.

Testing Principle

Before applying methods to design effective test cases, a software engineer must understand the basic principle
that guides software testing. All the tests should be traceable to customer requirements.

Testing Methods

There are different methods that can be used for software testing. They are,

1. Black-Box Testing

The technique of testing without having any knowledge of the interior workings of the application is
called black-box testing. The tester is oblivious to the system architecture and does not have access to
the source code. Typically, while performing a black-box test, a tester will interact with the system's user
interface by providing inputs and examining outputs without knowing how and where the inputs are
worked upon.

2. White-Box Testing

White-box testing is the detailed investigation of internal logic and structure of the code. White-box
testing is also called glass testing or open-box testing. In order to perform white-box testing on an
application, a tester needs to know the internal workings of the code. The tester needs to have a look
inside the source code and find out which unit/chunk of the code is behaving inappropriately.
Levels of Testing

There are different levels during the process of testing. Levels of testing include different methodologies that
can be used while conducting software testing. The main levels of software testing are:

 Functional Testing:

This is a type of black-box testing that is based on the specifications of the software that is to be tested.
The application is tested by providing input and then the results are examined that need to conform to
the functionality it was intended for. Functional testing of software is conducted on a complete,
integrated system to evaluate the system's compliance with its specified requirements. There are five
steps that are involved while testing an application for functionality.

 The determination of the functionality that the intended application is meant to perform.

 The creation of test data based on the specifications of the application.

 The output based on the test data and the specifications of the application.

 The writing of test scenarios and the execution of test cases.

 The comparison of actual and expected results based on the executed test cases.

 Non-functional Testing

This section is based upon testing an application from its non-functional attributes. Non-functional
testing involves testing software from the requirements which are non-functional in nature but important
such as performance, security, user interface, etc. Testing can be done in different levels of SDLC. Few
of them are

Unit Testing

Unit testing is a software development process in which the smallest testable parts of an application, called
units, are individually and independently scrutinized for proper operation. Unit testing is often automated but it
can also be done manually. The goal of unit testing is to isolate each part of the program and show that
individual parts are correct in terms of requirements and functionality. Test cases and results are shown in the
Tables.
Unit Testing Benefits

 Unit testing increases confidence in changing/ maintaining code.


 Codes are more reusable.
 Development is faster.
 The cost of fixing a defect detected during unit testing is lesser in comparison to that of defects detected
at higher levels.
 Debugging is easy.
 Codes are more reliable.

Sl # Test Case : - UTC-1

Name of Test: - LCD Testing


Items being tested: - LCD
Sample Input: - Power supply
Expected output: - LCD should display “ Sensor values ” message.

Actual output: - LCD displays “Temperature , Humidity values”.

Remarks: - Pass

Table : Unit test case for LCD

Sl # Test Case : - UTC-2

Name of Test: - DHT11 Sensor Reading


Items being tested: - DHT 11 Sensor
Sample Input: - Input to Temperature and humidity Sensor
Expected output: - Should Read all Temperature , humidity Conditions

Actual output: - Temperature and humidity Values Read

Remarks: - Pass

Table : Unit test case for Temperature


Sensor
Sl # Test Case : - UTC-3

Name of Test: - Soil Moisture Reading


Items being tested: - Moisture Values
Sample Input: - Power supply, Input to Sensors
Expected output: - Moisture values should be displayed

Actual output: - Moisture values read successfully

Remarks: - Pass

Table 8.3.1.3: Unit test case for Cloud


Upload

Sl # Test Case : - UTC-3

Name of Test: - NPK Reading


Items being tested: - Soil Fertility Values
Sample Input: - Power supply, Input to Sensors
Expected output: - NPK values should be displayed

Actual output: - NPK values read successfully

Remarks: - Pass

Table 8.3.1.3: Unit test case for NPK


Values
Integration Testing

Integration testing is a level of software testing where individual units are combined and tested as a group. The
purpose of this level of testing is to expose faults in the interaction between integrated units. Test drivers and
test stubs are used to assist in Integration Testing. Integration testing is defined as the testing of combined parts
of an application to determine if they function correctly. It occurs after unit testing and before validation testing.
Integration testing can be done in two ways: Bottom-up integration testing and Top-down integration testing.

1. Bottom-up Integration

This testing begins with unit testing, followed by tests of progressively higher-level combinations of
units called modules or builds.

2. Top-down Integration
In this testing, the highest-level modules are tested first and progressively, lower-level modules are
tested thereafter.

In a comprehensive software development environment, bottom-up testing is usually done first, followed
by top-down testing. The process concludes with multiple tests of the complete application, preferably in
scenarios designed to mimic actual situations. Table 8.3.2 shows the test cases for integration testing and their
results.
Sl # Test Case : - ITC-1

Name of Test: - Working of Arduino With Sensors


Items being tested: - Arduino and Sensor Values
Sample Input: - Input to Sensors

Expected output: - LCD should display all sensor details.

Actual output: - Values Displayed

Remarks: - Pass

Table : Integration test case for Arduino and Sensors

Sl # Test Case : - ITC-2

Name of Test: - Reading From Cloud


Items being tested: - Crop Yield
Sample Input: - Sensors Input

Expected output: - Crop Yield should be calculated

Actual output: - Yield Calculated and Crop Recommended

Remarks: - Pass

Table : Integration test case for Yield Prediction


System Testing

System testing of software or hardware is testing conducted on a complete, integrated system to evaluate
the system's compliance with its specified requirements. System testing falls within the scope of black-box
testing, and as such, should require no knowledge of the inner design of the code or logic. System testing
is important because of the following reasons:

 System testing is the first step in the Software Development Life Cycle, where the application is
tested as a whole.

 The application is tested thoroughly to verify that it meets the functional and technical
specifications.

 The application is tested in an environment that is very close to the production environment where
the application will be deployed.

 System testing enables us to test, verify, and validate both the business requirements as well as the
application architecture.

System Testing is shown in below tables

Sl # Test Case : - STC-1

Name of Test: - Synchronization Testing


Items being tested: - Hardware Input and ML Model
Sample Input: - Input taken from Sensors
Expected output: - Growth Monitoring and automated watering

Actual output: - ML Model Predicted the results by taking input from sensors

Remarks: - Pass

Table 8.3.3: System test case

5
Chapter 7:

Conclusion
Agriculture is the backbone of counties like India. However, the usage of technology towards
agriculture is to be given paramount importance towards preclusion agriculture. This paper
proposes a system which will help farmers to have an idea of yield estimates based on
weather parameters and area under cultivation Using this farmer can make decisions on
whether to grow that particular crop or go for alternate crop in case yield predictions are
unfavorable. This research work can be enhancing to the next level. We can build a
recommender system of agriculture production and distribution for farmer. By which farmers
can make decision in which season which crop should sow so that they can get more benefit.
This system is work for structured dataset. In future we can implement data independent
system also. It means format of data whatever, our system should work with same efficiency.

In future developing the web application based on this ideology and make the user use this
easily and help the user to understand the yield of the crop, he is going to crop in that season.

5
Future Enhancement:

The program is unquestionably better to the manual system. There might be no


prejudice in the areas covered, and the delay will be kept as short as possible.
• Due to its user friendliness, the operator do not require any previous training.
• There will be no technical concerns with the operator. The circuit's very easy design makes
it clear-cut to build and maintain. If the working method alters in the future, modifications to
the structure will be simple.
•To match the necessities of the user, it can be altered in the future.
•Smart WIFI Irrigation controllers will be the next generation of irrigation controllers that
mechanically amend your irrigation system on actual weather data. You can also run it from
anytime, at anywhere.

28
References:
[1] Ponce-Guevara, K. L., Palacios-Echeverria, J. A., Maya-Olalla, E.,DominguezLimaico,
H. M., Suarez-Zambrano, L. E., Rosero-Montalvo, P.D., Alvarado-Perez, J. C. (2017).
GreenFarm-DM: A tool for analyzing vegetable crops data from a greenhouse using data
mining techniques (First trial). 2017 IEEE Second Ecuador Technical Chapters Meeting
(ETCM).

[2] Jheng, T.-Z., Li, T.-H., Lee, C.-P. (2018). Using hybrid support vector regression to
predict agricultural output. 2018 27th Wireless and Optical Communication Conference
(WOCC).

[3] Manjunatha, M., Parkavi, A. (2018). Estimation of Arecanut Yield in Various Climatic
Zones of Karnataka using Data Mining Technique: A Survey. 2018 International Conference
on Current Trends Towards Con- verging Technologies (ICCTCT).

[4] Shakoor, M. T., Rahman, K., Rayta, S. N., Chakrabarty, A. (2017). Agricultural
production output prediction using Supervised Machine Learning techniques.2017 1st
International Conference on Next Generation Computing Applications (NextComp).

[5] Grajales, D. F. P., Mejia, F., Mosquera, G. J. A., Piedrahita, L. C.,Basurto,C. (2015).
Crop- planning, making smarter agriculture with climate data. 2015 Fourth International
Conference on Agro-Geoinformatics (Agro-Geoinformatics).

[6] Shah, P., Hiremath, D., Chaudhary, S. (2017). Towards development of spark based
agricultural information system including geo-spatial data. 2017 IEEE International
Conference on Big Data (Big Data).

[7] Afrin, S., Khan, A. T., Mahia, M., Ahsan, R., Mishal, M. R., Ahmed, W.,Rahman, R. M.
(2018). Analysis of Soil Properties and Climatic Data to Predict Crop Yields and Cluster
Di_erent Agricultural Regions of Bangladesh.2018 IEEE/ACIS 17th International
Conference on Computer and Information Science (ICIS).

[8] Sekhar, C. C., Sekhar, C. (2017). Productivity improvement in agriculture sector using big
data tools. 2017 International Conference on Big Data Analytics and Computational
Intelligence (ICBDAC).

29
[9] Sahu, S., Chawla, M., Khare, N. (2017). An ancient analysis of crop yield prediction
using Hadoop framework based on random forest approach. 2017 International Conference
on Computing, Communication and Automation (ICCCA).

[10] Garg, A., Garg, B. (2017). A robust and novel regression based fuzzy time series
algorithm for prediction of rice yield. 2017 International Conference on Intelligent
Communication and Computational Techniques (ICCT).

[11] Raja, S. K. S., Rishi, R., Sundaresan, E., Srijit, V. (2017). Demand based crop
recommender system for farmers. 2017 IEEE Technological Innovations in ICT for
Agriculture and Rural Development (TIAR).

[12] Dey, U. K., Masud, A. H., Uddin, M. N. (2017). Rice yield prediction model using data

30
31

You might also like