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

ASR Project Report Updated 4

Uploaded by

kshamakbhat
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)
19 views

ASR Project Report Updated 4

Uploaded by

kshamakbhat
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/ 80

TABLE OF CONTENTS

ABSTRACT i
LIST OF FIGURES iv
LIST OF TABLES vi
SL NO. TOPIC PAGE
NO.
CHAPTER 1 INTRODUCTION 1-6
1.1 MOTIVATION 1
1.2 EXISTING SYSTEM 2
1.3 PROPOSED SYSTEM 2-3
1.4 OBJECTIVES 4
1.5 FEATURES WITH SCOPE 5
1.6 LIMITATIONS 6
CHAPTER 2 LITERATURE REVIEW 7-9
CHAPTER 3 SYSTEM REQUIREMENT 10-12
3.1 FUNCTIONAL REQUIREMENTS 11
3.2 NON-FUNCTIONAL REQUIREMENTS 11
3.3 HARDWARE REQUIREMENTS 11
3.4 SOFTWARE REQUIREMENTS 12
CHAPTER 4 SYSTEM DESIGN 12-19
4.1 METHODOLOGY 13
4.2 USE CASE DIAGRAM 15
4.3 DATA FLOW DIAGRAM 16
4.4 DATA COLLECTION 16
4.5 SEQUENCE DIAGRAM 18
4.6 CLASS DIAGRAM 19
CHAPTER 5 SYSTEM IMPLEMENTATION 20-54

5.1 IMPLEMENTATION 20
5.2 ALGORITHM 22

5.3 EMBEDDED C PROGRAMMING 23-31


5.3.1 HISTORY OF EMBEDDED C 24-26
5.3.2 DEVELOPMENT OF EMBEDDED C 26
5.3.3 SYNTAX AND SEMANTICS 27-28
5.3.4 USES 28-29
5.3.5 EXAMPLES OF EMBEDDED C 29-30
5.3.6 FEATURES OF PHILOSOPHY 30-31
5.4 CODE SNIPPET 31-32

5.5 MACHINE LAERNING ALGORITHMS 32-36


5.6 CLOUD SERVER 36-38
5.7 SOFTWARE MODULES 39-45
5.8 ARDUINO PROGRAMMING 46
5.9 ESP 32 2D MODEL 47-65
5.10 TESTING 66-71
CHAPTER 6 RESULTS AND DISCUSSIONS 72-78

CHAPTER 7 CONCLUSION 79

REFERENCES 80

LIST OF FIGURES
FIGURE TOPIC PAGE
NO.
4.1.1 MACHINE LEARNING BASED MODEL 13
4.1 MACHINE LEARNING METHODOLOGY 14
4.2 USECASE DIAGRAM 15
4.4 DATA FLOW DIAGRAM OF DATA 16
COLLECTION
4.4.1 DATA FLOW DIAGRAM OF PRE- 17
PROCESSING
4.5 SEQUENCE DIAGRAM OF DATA SETS 18

4.6 CLASS DIAGRAM 19


5.5 DIAGRAM OF AN ANN 33
5.5.1 PRINCIPLES OF SVM OPERATIONS 36
5.6.1 DATA FLOW DIAGRAM OF CLOUD 38
SERVER
5.7 ESP 32 BOARD 39

5.7.1 ESP 32 BOARD PIN DIAGRAM 39

5.9.1 ESP 32 2D MODEL 47


5.9.2 LCD DISPLAY 48
5.9.3 SOIL MOISTURE SENSOR 50

5.9.4 WI-FI MODULE 61

5.9.5 LM35 TEMPERATURE SENSOR PINOUT 63

6.1 ASSEMBLED CIRCUIT BOARD 74


6.2 SENSORS CONNECTED 74
6.3 LED LIGHT MONITORING 75
6.4 MOISTURE SENSOR 75
6.5 HUMIDITY AND TEMPERATURE 76
SENSOR
6.6 MONITORING PLANTS 76
6.7 BLYNK IOT 77
6.8 PREDICTION SYSTEM 77
6.9 MSG ALERT NOTIFICATION TO USER 78
6.10 BLYNK IOT TIMELINE NOTIFICATION 78
6.11 BLYNK IOT DEVELOPER MODE 79
6.12 BLYNK IOT PROTOTYPE 79
LIST OF TABLES

INDEX TOPIC PAGE


NO.
5.7.1 PIN DESCRIPTION OF ESP 32 BOARD 42
5.7.2 ESP 32 TECHNICAL SPECIFICATION 43
5.10.1 UNIT TEST CASE FOR LCD 68
5.10.2 UNIT TEST CASE FOR TEMPERATURE 68
SENSOR
5.10.3 UNIT TEST CASE FOR CLOUD UPLOAD 69
5.10.4 INTEGRATION TEST CASE FOR ARDUINO 70
AND
SENSORS
5.10.5 INTEGRATION TEST CASE FOR ARDUINO 70
AND
CLOUD UPDATE
5.10.6 SYSTEM TEST CASE 70
Intelligent System for Vertical Farming using IoT

CHAPTER 1

INTRODUCTION

Agriculture is considered as the vital piece of life for the human species as it is the
fundamental wellspring of sustenance grains what's more, other crude materials required for
person. It plays important part in the development of nation's economy and improvement. It
additionally gives huge business openings to the general population. Development in agrarian
segment is fundamental for the improvement of financial state of the nation. Tragically, numerous
agriculturists still utilize the conventional strategies of cultivating which brings about low
yielding of harvests and natural products. Be that as it may, wherever robotization had been
actualized and human creatures had been supplanted via programmed apparatuses, the yield has
been enhanced and less diligent work required. Consequently, there is need to actualize and utilize
present day innovation in the agribusiness part to increase the yield of harvest.

1.1 Motivation

The greater part of the project means the utilization of remote sensor organize which gathers
the information from various sorts of sensors and after that send it to principle server utilizing
remote convention. The gathered information gives the data about various ecological elements
which in swings screens the framework. Observing natural components are insufficient and
finishes answer for enhance the yield of the harvests. Require robotization to make strides the
yield of the harvests.
There are number of different components that influence the efficiency to awesome degree.
These components incorporate assault of bugs when product is at the phase of gathering. Indeed,
even after gathering, ranchers likewise confront issues away of collected trim and some more. In
this way, so as to give answers for all such issues, it is important to create coordinated framework
which will deal with all components influencing the efficiency in each stage. In this particular
project automation of vertical farming is to be done completely.

Department of ISE, AIT 2022- 1 Pa


Intelligent System for Vertical Farming using IoT

In which, Automation of water supply, maintenance of farms temperature at required level,


maintenance of nutrients and EC (Electrical conductivity) at required level, automation in
required sunlight for farm along with that alarms and indicators for unusual conditions for farms.
Also related all information is to be displays on display panel and related info will be send to
owner of that particular farm.

1.2 Existing System


New Jersey Agricultural Experiment Station improved the existing way sand makings and soil
hydroponics capable enough for large-scale crop production. According to NASA space mission
reports, space hydroponics has been initiated since 2002. They have replicated the environmental
ambience by implementing powerful LED lighting system, a greenhouse that will control these
moisture, humidity and temperature automatically. Growing crops in low latitude areas of Mars,
where the sunlight acquired is adequate, have successfully conducted series of experiments.

1.3 Proposed System


The temperature and humidity sensors sense the surrounding environment, In addition
to this, based on Humidity adjustment unit will enable the soil sprinklers to cool down the
temperature and humidity sensors sense the surrounding environment, while the pH level sensor
provides us with the pH value of the nutrient solution and the Electrical conductivity will check the
nutrient value.

Department of ISE, AIT 2022- 2 Pa


Intelligent System for Vertical Farming using IoT

The temperature and humidity sensors sense the surrounding environment, while the pH
level sensor provides us with the pH value of the nutrient solution and the Electrical conductivity
will check the nutrient value. In addition to this, based on Humidity adjustment unit will enable
the soil sprinklers to cool down the temperature and humidity sensors sense the surrounding
environment, while the pH level sensor provides us with the pH value of the nutrient solution and
the Electrical conductivity will check the nutrient value.

In addition to this, based on Humidity adjustment unit will enable the soil sprinklers to
cool down and control humidity within the vertical farm.The pH pump will help in feeding the pH
solution to the plant.LED Grow lights are used to produce light (red and blue) at two distinct
spectrum simultaneously without bleeding into other wavelengths and minimal heat production.
The pH value should be between 5-6.5 so that the plant will remain unaffected. LED Grow lights
are used to produce lights (red and blue) at two distinct spectrum simultaneously without bleeding
into other wavelengths and minimal heat production. In addition, pest detection unit will detect
pest on plants and sprinklers will be activated to sprinkle organic pesticides. The output data is
interfaced with ESP8266 Wi-Fi module so that the data can be stored on cloud and monitored
remotely and conveniently.

Fig 1.3.: Vertical Farm Environment

Department of ISE, AIT 2022- 3 Pa


Intelligent System for Vertical Farming using IoT

1.4 Objectives

To evaluate the scope of the Vertical Farming concept in the building levels of the cities. And
thereby to analyze how well this concept can integrated be into the urban to sow seeds for the future
and to resolve the long-standing paradox of humanity’s inclination towards exponential
demographic and economic growth while inhabiting a planet of limited resource material means.

The main objective of this project is to produce a higher amount of foods for every square meter,
which is the physical layout of the vertical farm. In order to make good use of space, crops must be
placed in stacked layers.Vertical farming is the urban farming of fruits, vegetables, and grains,
inside a building in a city or Urban Centre, in which floors are designed to accommodate certain
crops.

The purpose is to determine ways to supply food to cities in an energy efficient and sustainable
manner from both a quantitative and qualitative approach One of the basic principles for vegetable
production, both in soil and in hydroponic systems, is to provide all the nutrients the plant needs.
Several chemical elements are essential for growth and production of plants, in sixteen elements:
carbon, hydrogen, oxygen, nitrogen, phosphorus, potassium, Sulphur, calcium, magnesium,
manganese, iron, zinc, boron, copper, molybdenum and chlorine. Among the elements mention ed
above, there is a division according to the ir origin: organic, C, H, O and minerals; broken down into
macro nutrients, N, P, K, Ca, Mg, S, and micro nutrients, Mn, Fe, B, Zn, Cu, Mo, Ni, Cl (Malavolta,
2006).

Department of ISE, AIT 2022- 4 Pa


Intelligent System for Vertical Farming using IoT

1.5 Features with Scope

Integrated 520 KB SRAM

This feature can be used to store and process data from various sensors and devices used in vertical
farming, such as temperature and humidity sensors, light sensors, and irrigation systems.

Hybrid Wi-FI & Bluetooth

This feature can be used for wireless communication between devices and sensors used in vertical
farming, enabling remote monitoring and control of the farm. This can be particularly useful for larger
farms, where it may not be possible to physically monitor all aspects of the farm.

High level of integration

This feature allows for the integration of various devices and sensors used in vertical farming,
reducing the need for multiple components and simplifying the overall system design.

Ultra-low-power management

This feature can be used to optimize power consumption in the farm, reducing energy costs and
increasing the overall efficiency of the system.

4 MB Flash

This feature can be used to store data and firmware updates for the devices and sensors used in vertical
farming, allowing for easy maintenance and updates.

On-board PCB antenna

This feature can be used to improve wireless communication between devices and sensors in the farm,
particularly in areas where there may be interference or signal loss.

Department of ISE, AIT 2022- 5 Pa


Intelligent System for Vertical Farming using IoT

1.6 Limitations

 Limited viewing angle, causing color, saturation, contrast and brightness to vary, even within the
intended viewing angle, by variations in posture.
 Uneven back lighting in some (mostly older) monitors, causing brightness distortion, especially toward
the edges.
 Only one native resolution. Displaying any other resolution either requires a video scaler, causing
blurriness and jagged edges; or running the display at native resolution using1:1 pixel mapping, causing the
image either not to fill the screen (letterboxed display), or to run off the lower right edge of the screen.
 In a constant-on situation, thermalization may occur, in which part of the screen has overheated and
looks discolored compared to the rest of the screen.
 Loss of brightness and much slower response times in low temperature environments. In sub-zero
environments, LCD screens may cease to function without the use of supplemental heating.
 Loss of contrast in high temperature environments.
 Not usually designed to allow easy replacement of the backlight.
 Poor display in direct sunlight, often completely unviewable. Transflective LCDs provide a large
improvement by reflecting natural light, but are dimmer when relying on the backlight and so they have
only been adopted for specific outdoor uses Cannot be used with light guns/pens.

Department of ISE, AIT 2022- 6 Pa


Intelligent System for Vertical Farming using IoT

CHAPTER 2
LITERATURE REVIEW

1. Agricultural internet of things using machine learning Authors: J.SasiBhanu, Sunitha Devi Bigul, and
Prakash Published On:30July2021

Abstract: In the present scenario, the farmers are losing their effort, money, and life because they are
unable to adapt with the latest technologies of agriculture. As the farmer is illiterate it is very difficult
to give training. The farmers need an automated system which can guide and monitor the field. The
automated system must give solution to the various problems such as soiling the field, handling the
environmental hazards and selection of fertilizers and their usage. To such types of problems one of
optimal solution can be drawn from Internet of Things (IoT). IoT is an exceptionally encouraging
innovation that is offering numerous imaginative answers for modernize the farming area.

2.A Remote Monitoring System for Greenhouse Based on the Internet of Thing Authors: Zhenfeng Xu,
JunjieChen, Yahui WangandZhenFan
Published On: ICMMR2016

Abstract: The Internet of Things (IOT) is considered as a great opportunity for the development in the
information field nowadays, and has been applied widely in many fields. The IOT can be applied to
monitor and control the microclimate factors of greenhouse remotely. In this paper, a wireless
monitoring network is design ed in the perception layer of the IOT. The nodes are developed based on
the Mica2 hardware and the Tiny OS software. The LPL (low power listening) technology is adopted to
reduce the energy consumption of the relay node which is powered by a solar panel. The ACK
(Acknowledgement) mechanism is used in the software to improve the quality of wireless
communications. A remote monitoring terminal is developed by using Java technology.

Department of ISE, AIT 2022- 7 Pa


Intelligent System for Vertical Farming using IoT

3.Machine learning methods for crop yield prediction and climate change impact assessment in
agriculture
Authors: Crane-Droesch, Andrew
Published On: Environmental Research Letters, Volume 13, Issue 11, article id.114003(2018).
Abstract: Crop yields are critically dependent on weather. A growing empirical literature models this
relationship in order to project climate change impacts on the sector. We describe an approach to yield
modeling that uses a semiparametric variant of a deep neural network, which can simultaneously account
for complex nonlinear relationships in high-dimensional datasets, as well as known parametric structure
and unobserved cross-sectional heterogeneity. Using data on corn yield from the US Midwest, we show
that this approach outperforms both classical statistical methods and fully-nonparametric neural
networks in predicting yields of years with held during model training.

4.Deep Neural Networks Based Recognition of Plant Diseases by Leaf Image Classification
Authors: Srdjan Sladojevic, Marko Arsenovic
Published On:22Jun2016

Abstract: This paper is concerned with a new approach to the development of plant disease recognition
model, based on leaf image classification, by the use of deep convolutional networks. Novel way of
training and the methodology used facilitate a quick and easy system implementation in practice. The
developed model is able to recognize 13 different types of plant diseases out of healthy leaves, with the
ability to distinguish plant leaves from their surroundings. According to our knowledge, this method for
plant disease recognition has been proposed for the first time. All essential steps required for
implementing this disease recognition model are fully described throughout the paper, starting from
gathering images in order to create a database, assessed by agricultural experts.

Department of ISE, AIT 2022- 8 Pa


Intelligent System for Vertical Farming using IoT

5.IoT-Based Smart Irrigation Systems: An Overview on the Recent Trends on Sensors and IoT
Systems for Irrigation in Precision Agriculture
Authors: Laura García, Lorena Parra, Jose M Jmenez
Published On:2020 Feb;20(4):1042. Published online2020Feb14.doi:10.3390/s20041042

Abstract: Soil management is paramount in countries with soil scarcity. This also affects agriculture, as
a large amount of soil is dedicated to that use. The possible consequences of global warming led to the
consideration of creating soil adaptation measures to ensure the availability of soil for food production
and consumption. Thus, studies aimed at saving soil usage in the irrigation process have increased over
the years. Typical commercial sensors for agriculture irrigation systems are very expensive, making it
impossible for smaller farmers to implement this type of system.

6.Role of IoT in Agriculture


Authors: Vinayak N. Malavade, Pooja K. Akulwar
Published On: National Conference On "Changing Technology and Rural Development" CTRD2k16

Abstract: Now a days there is vast enhancement in technologies, different tools and techniques are
available in agriculture sector. To improve efficiency, productivity, global market and to reduce human
intervention, time and cost there is a need to divert towards new technology named Internet of Things.
IoT is the network of devices to transfer the information without human involvement. Hence, to gain
high productivity, IoT works in synergy with agriculture to obtain smart farming. This paper focuses on
role of IoT in agriculture that leads to smart framing.

Department of ISE, AIT 2022- 9 Pa


Intelligent System for Vertical Farming using IoT

CHAPTER 3
SYSTEM REQUIREMENT
System requirements are a broad and also narrow subject that could be implemented to many
items. It specifies the hardware and software requirement that are in order to run the system
properly. Often manufacturers of games will provide the consumer with a set of requirements that
are different from those that are needed to run a software. These requirements are usually called
the recommended requirements. These requirements are almost always of a significantly higher
level than the minimum requirements, and represent the ideal situation in which to run the
software.

3.1 Functional Requirements


• ESP 32 is used with open cv and python necessary libraries are installed.
• Soil moisture sensor is used to measure the volumetric content in soil.

3.2 Non-Functional Requirements

• The sensors should be placed in such that it will not dislocate from particular area.
• There should be active internet connection to send Telegram to concerned person.

3.3 Hardware Components Required

• ESP 32: It is an opensource computer hardware and software that designs single-board
microcontrollers and microcontroller kits for building digital devices
• Moisture Sensor: soil moisture sensor is a simple breakout for measuring the moisture in a soil
and similar materials.
• Wi-Fi Module: The ESP8266 Wi-Fi Module is a self-contained SOC with integrated TCP/IP
protocol stack that can give Arduino micro controller access to your Wi-Fi network.
• LED: A light-emitting diode (LED) is a semiconductor device that emits light when an
electric current flows through it.

Department of ISE, AIT 2022- 10 Pa


Intelligent System for Vertical Farming using IoT

• Relay: A relay is an electrically operated switch. It consists of a set of input terminals for a
single or multiple control signals.

• Power Supply: A power supply is an electrical device that supplies electric power to an electrical load.

3.4 Software Requirements

• Arduino IDE: The open-source Arduino Software (IDE) makes it easy to write code and upload it to the
board.

• Embedded C: It is simply an extension C language and it is used to develop micro-controller based


applications.

Department of ISE, AIT 2022- 11 Pa


Intelligent System for Vertical Farming using IoT

CHAPTER 4
SYSTEM DESIGN

Figure 4.1.1: A Machine Learning based Model

4.1 METHODOLOGY

Smart agriculture is the new emerging trend that uses the data intense approach which supports the
farmer up-to greater extent in increasing the productivity with optimum resources with minimum
environmental impact. The smart agriculture technology possesses a better understanding about all the
operational parameters which hinders or accelerate the crop growth.

The modern agriculture system equipped with machine learning operational unit, which gathers the real-
time data sets from the variety of sensors installed on the farm field, and process it by the operational
unit (machine Learning) with the help of previous historic (Big Data)data and performs the operation
itself which are essential and more accurate.

Department of ISE, AIT, Bangalore 2021- 12 Pa


Page
Intelligent System for Vertical Farming using IoT

A machine learning enabled system has the ability to learn from the training data sets and takes its
own decision based on the past experience (training data) over the test data. The ability of the system
improvises over time and the size of training data. The ML model is classified based on the type of
algorithm adopted to train the system. Machine learning is the ability of a system which enables the
system to learn itself with the use of big data without a rigid programming and train the system to
perform better in every outcome. A fusion technique which will assist a rancher in doing every task
important on the field in a required time period with 100 % accuracy. In Section II, the background for
the current strategy have been covered.

The area of machine learning has acquired a sustainable growth, because of the accuracy it offered in
the different fields of application. Agriculture is one of the fields of application ML. The agriculture is a
segment which confronts various challenges every day and hence prevent to be the most discouraging
business into days’ time. The most common challenges which are faced by the farmers on following the
process of sowing the seed of a crop till its harvesting phase is reached are as follows:

Fig 4.1: Machine Learning Methodology

Department of ISE, AIT, Bangalore 2021- 13


Intelligent System for Vertical Farming using IoT

4.2 Use Case Diagram:

Figure 4.2 : 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.

Department of ISE, AIT, Bangalore 2021- 14


Intelligent System for Vertical Farming using IoT

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

4.4 Data Collection

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

Figure 4.4: Data Flow Diagram of Data Collection

Department of ISE, AIT, Bangalore 2021- 15


Intelligent System for Vertical Farming using IoT

Data PreProcessing:
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 price and yield of a crop like
rainfall, temperature, location, area, production and yield.

Figure 4.4.1: Dataflow Diagram of Pre-Processing

Department of ISE, AIT, Bangalore 2021- 16


Intelligent System for Vertical Farming using IoT

4.5 Sequence Diagram

A sequence diagram in a Unified Modeling Language (UML) is a kind of interaction diagram that
show 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.

Figure 4.5: Sequence Diagram for Data sets

Department of ISE, AIT, Bangalore 2022-23 17


Intelligent System for Vertical Farming using IoT

4.6 CLASS DIAGRAM

The class diagram is the main building block of object-oriented modeling. It is used for general conceptual
modeling of the structure of the application, and for detailed modeling, translating the models into
programming code. Class diagrams can also be used for data modeling. The classes in a class diagram
represent both the main elements, interactions in the application, and the classes to be programmed.

Figure 4.6: Class Diagram

Department of ISE, AIT, Bangalore 2022-23 18


Intelligent System for Vertical Farming using IoT

CHAPTER 5

Implementation and Testing

5.1.Implementation

It shows the block diagram of the IoT Based Automated vertical farming System. The system is
divided into the following monitoring (consisting of various sensors), controlling, automating and storing
data sections. ESP 32 is used to suffice the requirement of interfacing all these parameters together to
perform in synchronization. The temperature and humidity sensors sense the surrounding environment,
while the Electrical conductivity will check the nutrient value. In addition to this, based on Humidity
adjustment unit will enable the water sprinklers to cool down and control humidity within the planting
house. Sprinklers are needed for sprinkling the water in response to the humidity,. LED Grow lights are
used to produce lights (red and blue) at two distinct spectrums simultaneously without bleeding into
other wavelengths and minimal heat production. In addition, pest detection unit will detect pest on plants
and sprinklers will be activated to sprinkle organic pesticides. The output data is interfaced with ESP32
Wi-Fi module so that the data can be stored on cloud and monitored remotely and conveniently.
Temperature and Humidity sensor:

DHT11 performs this task. For temperatures up to 80 degree Celsius, they provide an accuracy of
0.1% and a fair response speed of 2 seconds. Their humidity measuring range is 0 to 100%, which is
sufficient for this system. The plants are very sensitive to fluctuating tem-perature and humidity, if both
of these parameters are high; the plants lack their ability to transpire. Thus, it has an adverse effect on
their growth. However, they adapt to a higher humidity range once their roots have matured. An RTC
(Timer circuit) can be implemented in order to keep track of the time, such that the sys-tem will detect
whether it is day or night.

Department of ISE, AIT, Bangalore 2022-23 19


Intelligent System for Vertical Farming using IoT

c) Real Time clock (RTC):

DS3234 RTC can be used via SPI interface. It comes with in-built power sense to detect power fails and
set battery automatically. The clock being the centre of the controller used to power up at certain intervals.
The accuracy of the timer is ±2ppm between 0 to 40 degree per C. it can sup-port alarms giving flexibility
for future uses.

e) EC level and circuit: Nutrients are made of mineral salts, which are then dissolved into water. The
strength of the nutrient solution can be detected by an electrical conductivity meter. As each nutrient has
different salt content, it may lack some nutrient or have abundance of one of the nutrients, etc. This makes
EC measured at constant pH.

f) Air temperature:

The controller reports air temperature on real time basis to the screen. In case if the level falls out of range,
a red light is indicated. However air temperature can be controlled, possibly a fan can be used for
extensions.

g) Light level:
Light level can be a problem for the growth of plants in Hydroponics. LEDs can be controlled and
customized to any desired color temperature for nurturing the vertical hydro-ponics garden. Environmental
ambience can be replicated by the use of a LED grow light system. According to a journal report "Growth
and photosynthesis of Chinese cabbage plants grown under light-emitting diode-based light source"
conducted in 2009, LEDs can be scientifically used and implemented to grow crops.[10]
Fig.2 Proposed Block diagram
Fig. 1. Types of vertical farming (Image source: Google)

Department of ISE, AIT, Bangalore 2022-23 20


Intelligent System for Vertical Farming using IoT

5.2.Algorithm

Decision tree algorithm

A decision tree algorithm can be used to classify the crops based on their growth characteristics and
nutrient requirements. The algorithm can use sensor data and historical data to determine the optimal
growing conditions for each crop.

Decision tree algorithm is a supervised machine learning algorithm used for classification and
regression analysis. It works by recursively partitioning the input data into subsets based on the values
of the input features, creating a tree-like structure of decision nodes and leaf nodes.

In the context of an intelligent system for vertical farming, decision tree algorithm can be used to
classify crops based on their growth characteristics and nutrient requirements. The algorithm can use
sensor data such as temperature, humidity, light intensity, and pH to determine the optimal growing
conditions for each crop.

The algorithm starts with a dataset consisting of input features (sensor data) and corresponding
output labels (crop type, nutrient requirements, etc.).The algorithm selects the input feature that best
separates the dataset into subsets with different output labels. This is done using a metric such as
information gain or Gini impurity.The algorithm creates a decision node based on the selected feature
and splits the dataset into subsets based on the feature value.The algorithm repeats the process
recursively on each subset, selecting the best feature to split on and creating decision nodes until a
stopping criterion is met.

The algorithm assigns an output label (crop type, nutrient requirements, etc.) to each leaf node
based on the majority class in the corresponding subset.In the context of vertical farming, the decision
tree algorithm can be used to classify crops based on their characteristics and nutrient requirements,
and the results can be used to adjust the growing conditions for each crop. For example, the algorithm
can classify crops as high-nutrient or low-nutrient and adjust the nutrient delivery accordingly, or
classify crops as high-light or low-light and adjust the light intensity accordingly.

Department of ISE, AIT, Bangalore 2022-23 21


Intelligent System for Vertical Farming using IoT

5.3. Embedded ‘C’ Programming


Embedded C is one of the most popular and most commonly used Programming Languages in the
development of Embedded Systems. So, in this article, we will see some of the Basics of Embedded C
Program and the Programming Structure of Embedded C.

Embedded C is perhaps the most popular languages among Embedded Programmers for
programming Embedded Systems. There are many popular programming languages like Assembly,
BASIC, C++, Python etc. that are often used for developing Embedded Systems but Embedded C
remains popular due to its efficiency, less development time and portability.

Before digging in to the basics of Embedded C Program, we will first take a look at what an
Embedded System is and the importance of Programming Language in Embedded Systems.

Introduction to Embedded C Programming Language


C Programming Language uses the same syntax and semantics of the C Program Before going in to
the details of Embedded C Programming Language and basics of Embedded C Program, we will first
talk about the C Programming Language.It is developed by Dennis Ritchie in the late 60’s and early
70’s, is the most popular and widely used programming language. The C Programming Language
provided low level memory access using an uncomplicated compiler (a software that converts
programs to machine code) and achieved efficient mapping to machine instructions.

The C Programming Language became so popular that it is used in a wide range of applications
ranging from Embedded Systems to Super Computers.Embedded C Programming Language, which is
widely used in the development of Embedded Systems, is an extension of C Program Language. The
Embedding Language like main function, declaration of datatype, defining variables, loops, functions,
statements, etc.

The extension in Embedded C from standard C Programming Language include I/O Hardware
Addressing, fixed point arithmetic operations, accessing address spaces, etc,

Department of ISE, AIT, Bangalore 2022-23 22


Intelligent System for Vertical Farming using IoT

5.3.1.History of Embedded C

Embedded C is a variant of the C programming language that is specifically designed for embedded
systems. It was developed in the late 1970s by Dennis Ritchie at Bell Labs and was based on the
original C programming language.

C became popular for embedded systems due to its efficiency and the ability to write low-level code
that interacts directly with hardware. Embedded C is similar to standard C, but it has some additional
features that are specifically designed for embedded systems, such as memory-mapped I/O, fixed-
point arithmetic, and the ability to define register-level interrupts.

Over time, embedded C has become widely used in the development of embedded systems,
including microcontrollers, real-time systems, and other embedded devices. Its popularity is due to its
flexibility, efficiency, and the availability of many software development tools that support embedded
C.

Today, embedded C continues to be widely used in the development of embedded systems. It has
been adopted by many microcontroller manufacturers and is supported by a wide range of
development tools and software libraries. As embedded systems become more complex and powerful,
embedded C has evolved to support new features and functionality, such as support for multicore
processors, real-time operating systems, and advanced communication protocols.

In an era with other available general-purpose programming languages, such as Java, Python and
Ruby, C and its various .NET relatives remain important languages for developers. Despite its age,
developers worldwide still commonly work in C, C#, C++ and Objective-C to create sophisticated
portfolios of modern applications.

This article takes a quick look at the storied history of the C programming language and its role in
high-level software development efforts. By understanding its history, developers can garner the
context necessary to understand what makes C-based languages useful for embedded systems
management, dynamic data processing and other complex programming projects.

Department of ISE, AIT, Bangalore 2022-23 23


Intelligent System for Vertical Farming using IoT

In 1978, Dennis Ritchie and Brian Kernighan published the book The C Programming Language,
which served as a common source of reference for C. This period of C's history is often referred to as
the K&R version of C, in reference to Kernighan and Ritchie.

This new iteration of C boasted innovative new development features, such as:

 a standard I/O library;


 unsigned and long int data types;
 various compound assignment operators (such as =+);
 void() functions;
 enumerated types; and
 the ability to store different data types in one memory location.
 struct data type assignments;

In 1983, the American National Standards Institute (ANSI) established the ANSI X3.159-1989:
Programming Language C, known as ANSI C. Another successive standard of the language was
released and called ISO C (or C90). Successive modifications occurred in 1995, 1999 and 2011, with
each one called C95, C99 and C11, respectively. C11, which took about five years to complete, added
another swath of innovative features to C and its libraries, such as:

 bounds-checked functions;
 anonymous structures;
 atomic operations;
 multithreading capabilities;
 Unicode support; and
 type-generic macros.

5.3.2.Development of Embedded C

Department of ISE, AIT, Bangalore 2022-23 24


Intelligent System for Vertical Farming using IoT

The development of Embedded C can be traced back to the late 1970s and early 1980s, when C was
gaining popularity as a programming language for systems programming. C was designed to be a
simple, efficient, and flexible language that could be used to write low-level code that interacts
directly with hardware.

As C became popular for embedded systems development, developers began to add extensions and
features to the language that were specifically designed for embedded systems. In the early 1980s,
Michael Barr developed the first version of Embedded C while working at Rice University. Embedded
C was specifically designed to address the unique requirements of embedded systems, such as low-
level hardware access, memory constraints, and real-time performance.

Barr's implementation of Embedded C included a number of features that were not present in standard
C, including support for memory-mapped I/O, fixed-point arithmetic, and the ability to define register-
level interrupts. These features allowed Embedded C to be used to develop software for a wide range
of embedded systems, from simple microcontrollers to complex real-time systems.

Over time, Embedded C has continued to evolve and adapt to the changing needs of embedded
systems development. Today, Embedded C is widely used in the development of embedded systems,
including microcontrollers, real-time systems, and other embedded devices. It is supported by a wide
range of development tools and software libraries, and has become the standard language for many
embedded systems applications.

5.3.3.Syntax and Semantics

The syntax of Embedded C is similar to that of standard C, with some additional features and syntax
extensions to support the unique requirements of embedded systems. The semantics of Embedded C

Department of ISE, AIT, Bangalore 2022-23 25


Intelligent System for Vertical Farming using IoT

are also similar to standard C, with some additional features and behavior that are specific to
embedded systems.

Some of the key features and syntax extensions of Embedded C include:

Memory-mapped I/O: Embedded C provides support for accessing hardware peripherals and other I/O
devices using memory-mapped I/O. This allows developers to read and write data to and from
hardware devices using the same syntax as reading and writing to memory.

Fixed-point arithmetic: Embedded C provides support for fixed-point arithmetic, which is commonly
used in embedded systems to perform efficient and accurate calculations on fractional
numbers.Register-level interrupts: Embedded C allows developers to define interrupts at the register
level, which allows for very low-level and efficient interrupt handling.

Preprocessor directives: Embedded C uses preprocessor directives to allow developers to define


constants, macros, and conditional compilation for embedded system.Data types: Embedded C
provides a range of data types to support the unique requirements of embedded systems, such as
uint8_t and uint16_t for unsigned integer types of specific widths.

The semantics of Embedded C are similar to standard C, but with some additional behavior that is
specific to embedded systems. For example, Embedded C may have specific memory and timing
requirements for certain operations, and may have specific rules for accessing hardware peripherals
and I/O devices.

Overall, the syntax and semantics of Embedded C are designed to support the unique requirements of
embedded systems, while still maintaining the efficiency, flexibility, and simplicity of the C
programming language.

5.3.4.Uses

Embedded C is a programming language that is specifically designed for use in embedded systems.
Embedded systems are computer systems that are designed to perform a specific function, often with

Department of ISE, AIT, Bangalore 2022-23 26


Intelligent System for Vertical Farming using IoT

real-time constraints, and are typically integrated into a larger device or system.

Some of the common uses of Embedded C include:

Microcontroller programming: Embedded C is commonly used to program microcontrollers, which are


small, low-cost computer systems that are used in a wide range of embedded systems applications.

Real-time systems: Embedded C is often used to develop real-time systems, which require precise
timing and synchronization to perform their functions.Automotive and aerospace applications:
Embedded C is used in many automotive and aerospace applications, such as engine control systems,
navigation systems, and flight control systems.

Industrial automation: Embedded C is used in industrial automation systems, such as programmable


logic controllers (PLCs) and process control systems.Consumer electronics: Embedded C is used in
many consumer electronics devices, such as smartphones, smart home devices, and wearables.

Medical devices: Embedded C is used in medical devices, such as pacemakers, insulin pumps, and
medical imaging equipment.Overall, Embedded C is a versatile programming language that is used in
a wide range of embedded systems applications,

from simple microcontroller-based systems to complex real-time systems and industrial automation
applications. Its popularity is due to its efficiency, flexibility, and the availability of many software
development tools that support Embedded C programming.

5.3.5.Examples of Embedded C

There are many examples of embedded systems that use Embedded C as their programming language.
Some common examples include:

Department of ISE, AIT, Bangalore 2022-23 27


Intelligent System for Vertical Farming using IoT

Automotive systems: Many automotive systems, such as engine control units (ECUs), anti-lock
braking systems (ABS), and airbag systems, use Embedded C for programming.

Consumer electronics: Many consumer electronics devices, such as smartphones, smart home
devices, and wearables, use Embedded C for programming.

Industrial automation: Industrial automation systems, such as programmable logic controllers


(PLCs), use Embedded C for programming.

Medical devices: Medical devices, such as pacemakers, insulin pumps, and medical imaging
equipment, use Embedded C for programming.

Aerospace and defense: Many aerospace and defense systems, such as flight control systems,
navigation systems, and communication systems, use Embedded C for programming.

Robotics: Robotics systems, such as industrial robots, use Embedded C for programming.IoT devices:
Many IoT devices, such as smart sensors, smart lighting systems, and smart thermostats, use
Embedded C for programming.

Overall, Embedded C is a versatile programming language that can be used in many different types of
embedded systems applications. Its popularity is due to its efficiency, flexibility, and the availability of
many software development tools that support Embedded C programming.

5.3.6.Features and Philosophy


Embedded C is a programming language specifically designed for use in embedded systems. Its
features and philosophy reflect the needs and constraints of embedded systems applications. Here are

Department of ISE, AIT, Bangalore 2022-23 28


Intelligent System for Vertical Farming using IoT

some key features and philosophy of Embedded C:

Low-level access: Embedded C provides low-level access to hardware resources, such as memory,
peripherals, and I/O ports. This enables developers to write efficient and optimized code for embedded
systems.

Small memory footprint: Embedded C is designed to be compact and efficient, with a small memory
footprint. This is essential for embedded systems, which often have limited memory resources.

Portability: Embedded C is designed to be portable across different hardware platforms and


compilers. This enables developers to write code that can be easily ported to different embedded
systems.

Modularity: Embedded C supports modularity, which enables developers to write reusable code
modules that can be used in different parts of the system.

Safety-critical applications: Embedded C is well-suited for safety-critical applications, such as


medical devices, automotive systems, and aerospace systems. It provides features, such as strong type
checking, which help ensure the safety and reliability of the system.

Real-time systems: Embedded C is well-suited for real-time systems, which require predictable and
timely response to external events. It provides features, such as interrupt handling and time-critical
functions, which enable real-time processing.

Overall, the philosophy of Embedded C is to provide a language that is efficient, portable, and well-
suited for embedded systems applications. Its features reflect the need for low-level access, small
memory footprint, and modularity, while also addressing the requirements of safety-critical and real-
time systems.

5.4.Code Snippet
In the C Language, the log function can be used in the following versions:

 ANSI/ISO 9899-1990

Department of ISE, AIT, Bangalore 2022-23 29


Intelligent System for Vertical Farming using IoT

log Example

/* Example using log by TechOnTheNet.com */

#include <stdio.h>
#include <math.h>

int main(int argc, const char * argv[])


{
/* Define temporary variables */
double value;
double result;

/* Assign the value we will calculate the log of */


value = 1.5;

/* Calculate the log of the value */


result = log(value);

/* Display the result of the calculation */


printf("The Natural Logarithm of %f is %f\n", value, result);

return 0;
}

5.5.MACHINE LEARNING ALGORITHMS

Many data mining tools are provided to implement machine learning algorithms. Some frequently
used, free and opensource tools are WEKA, TANAGRA, Rapid Miner, MATLAB, Apache Mahout
etc. Among them, WEKA version 3.8.2 is used in this work. The full meaning of WEKA is Waikato

Department of ISE, AIT, Bangalore 2022-23 30


Intelligent System for Vertical Farming using IoT

Environment for Knowledge Learning. It’s a computer program, which was developed at the
University of Waikato in New Zealand to identify knowledge from raw data. It’s an opensource
software that is issued under the General Public License.

WEKA supports different types of data mining tasks, for example, classification, regression, feature
selection, data pre-processing, clustering and visualization. WEKA was originally written in C, but
later it was rewritten in Java and it’s now compatible with the most computing platform. It is user-
friendly and its graphical interface comprises quick set-up and operation. More than twenty machine
learning algorithms available in WEKA were applied to the UCI Machine Learning Repository
Dataset and Stat log Database for Heart disease prediction to validate the model performance. Among
those five with greater accuracy (i.e. more than 80%) are taken into consideration for performance
measurement and they are described briefly below:

Figure 5.5: Diagram of an artificial neural network.

Department of ISE, AIT, Bangalore 2022-23 31


Intelligent System for Vertical Farming using IoT

 Naive Bayes: Naive Bayes is a surprisingly powerful algorithm for predictive modeling. It
is a statistical classifier which assumes no dependency between attributes attempting to maximize
the posterior probability in determining the class.

Theoretically, this classifier has the minimum error rate, but may not be the case always.
Inaccuracies are caused by assumptions due to class conditional independence and the lack of
available probability data. This model is associated with two types of probabilities which can be
calculated from the training dataset directly:
1. The probability of every class.
2. The conditional probability of each class with each x value.

According to Bayesian theorem P A B P A PBA PB ( | ) = ∗ ( ) ( ) ( ) , where ) ( ). Bayesian


classifier calculates conditional probability of an instance belonging to each class, based on the
above formula, and based PB A PA B PA ( | ) = ( on such conditional probability data, the
instance is classified as the class with the highest conditional probability. If these probabilities are
calculated, then the probabilistic model can be implemented to make predictions with new data
using Naïve Bayes Theorem. When the data is real-valued it is likely to assume a Gaussian
distribution (bell curve). Thus, these probabilities can easily be estimated. Naive Bayes is called
naive because of assuming each input variable independent. This classifier algorithm uses
conditional independence, means it assumes that an attribute value on a given class is
independent of the values of other attributes.

Artificial Neural Networks: Artificial neural networks also called Multilayer Perceptron are
known as biologically inspired and it is capable of modelling extremely complex non-linear
functions. ANNs are one of the major tools used in machine learning. As the name “neural”
suggests, they are brain-oriented systems that are intended to duplicate the way how humans
learn. Neural networks consist of 3 layers of input, output and hidden layer. In most cases, a
hidden layer comprises units that transform the input to a pattern that the output layer
manipulates. ANN’s are excellent tools for the purpose of finding patterns that are so complex or
ambiguous to a human programmer to extract and teach the machine how to recognize. Neural
networks are in use since the 1940s and over the last decades they have become an important
part of

Department of ISE, AIT, 2021- 32


Intelligent System for Vertical Farming using IoT

 Support Vector Machine: SVM is a technique for ramification of both linear and non- linear
data. It applies a non-linear mapping method so that it can transform the training data into a higher
dimension. A hyper plane is a kind of line which separates the input variable space in SVM. The hyper
plane can separate the points in the input variable space containing their class that is either 0 or 1. In
two-dimensions, one can visualize this as a line and it is assumed that each input points can be
completely separated by this line. The distance between the hyper plane and adjacent data coordinates
is called margin. The line which has the largest margin can distinguish between the two classes is
known as the optimal hyper plane. These points are called support vectors, as they define or support
the hyper plane. In practice, there is an optimization algorithm which is used to calculate the values for
the parameters that maximize the margin. Figure 3 depicts the feature transformation process.
 Random Forest: Random Forest is one of the most renowned and most powerful machine
learning algorithms. It is one kind of machine learning algorithm that is called Bagging or Bootstrap
Aggregation. In order to estimate a value from a data sample such as mean, the bootstrap is a very
powerful statistical approach. Here, lots of samples of data are taken, the mean is calculated, after that
all of the mean values are averaged to give a better prediction of the real mean value. In bagging, the
same method is used, but instead of estimating the mean of every data sample, decision trees are
generally used. Here, numerous samples of the training data are considered and models are generated
for every data sample. While a prediction for any data is needed, each model gives a prediction and
these predictions are then averaged to get a better estimation of the real output value.
 Simple Logistic Regression: Logistic regression is a technique of machine learning which is
taken from the field of statistics. This method can be used for binary classification where values are
distinguished with two classes. Logistic regression is similar to linear regression where the goal is to
calculate the values of the coefficients within every input variable. Unlike linear regression, here the
prediction of the output is

Department of ISE, AIT, 2021- 33


Intelligent System for Vertical Farming using IoT

constructed using a non-linear function which is called a logistic function. The logistic function
transforms any value within the range of 0 to 1. The predictionsmade by logistic regression are used as
the probability of a data instance concerning to either class 0 or class 1. This can be necessary for
problems where more rationale for a prediction is needed. Logistic regression works better when
attributes are unrelated to output variable and attributes correlated to one another are removed.

Figure 5.5.1: Principles of support vector machine operation.

5.6.CLOUD SERVER

In cloud server, there is a core, a large database that has enough space in order to accommodate
huge amounts of data from the different sensors so that the history of the system user can easily
be tracked. A wide range of data analyzing algorithms is interfaced with the database and APIs
such as Google Sheets for data visualization. A data flow diagram of the cloud server is
presented in Figure 5.3.

DATA SOURCE

Stacked growing beds full of leafy greens under artificial light and in a mesmerizing mist. That’s the
description of an indoor vertical farm at Let Us Grow. It’s their mission to bring the point of production
closer to the point of consumption and enable anyone to grow food anywhere. This will reduce the waste
and carbon footprint in fresh food production. With their vertical farming solutions they aim to boost the
indoor farming industry. Analyzing data is key to their mission.

Department of ISE, AIT, 2021- 34


Intelligent System for Vertical Farming using IoT

A CONTROLLED ENVIRONMENT

In such a controlled environment, Ricardo relies on various data sources. He needed a place where all
these different sources come together, so he could do quick checks on climate data. Let Us Grow
needed a platform to provide a realistic image of the climate inside the vertical farms.

“Where we need high quality climate data, we use 30MHz.”

“We had a good data set for what the farm was doing, but reliable and constant climate data was
something we didn’t have at the beginning. Now we have everything. We can check data back to the
minute in the 30MHz platform. It’s useful to see the fluctuation during tests with different levels of
temperature and humidity, for instance. The 30MHz platform is a visual way of spotting any problems
or spotting if something did go wrong. It made it a lot easier.”

Maximize growing rates, minimize the environmental impact

Let Us Grow provides technology for vertical farms and greenhouses. The British company combines
indoor farm management software with their own aeroponics technology. In their soil- less system the
plant roots are suspended in a nutrient rich mist. It’s a recirculating system which makes it resource
efficient. Because of the controlled environment there is no use for pesticides. The system is created to
maximize growing rates, while minimizing the environmental impact.

Let Us Grow and Ricardo are optimistic that vertical farming will find its place in the food supply
chain. “Maybe not next year, but maybe in 5-10 years we’ll be able to supply a significant amount of
fresh products worldwide. Not replacing any other system, but complementary. Especially in large
cities.”

Department of ISE, AIT, 2021- 35


Intelligent System for Vertical Farming using IoT

Figure 5.6.1: Data flow diagram of cloud server.

Department of ISE, AIT, Bangalore 2021- 36


Intelligent System for Vertical Farming using IoT

5.7.Software Modules:
Module name :- Dataset Training
Functionality :- A training dataset is a dataset of examples used during the learning process and is
used to fit the parameters. Data Collection is a process of gathering and measuring information on
targeted variables in a systematic way. Formal data collection process is required as it ensures the data
is defined and accurate so that the decisions based on the data are valid. The data required for the soil
quality data is the critical data for Vertical Farming.
Input :- Datasets containing activity data , and other soil quality data
Output :- Train the Machine

Module 2
Module name :- Data Pre-processing Module
Functionality:- The Pre-processing of genetic data includes the following:
 Data Transformation Normalization: scaling the values to a specific range.
 Aggregation: assigning probabilistic values to the genes.
 Construction: replacing or adding new genes inferred by the existing genes.
Input:- Datasets
Output:- Searching for a lower dimensional space that can best represent the data. Removing the
irrelevant data from the genome dataset. Sampling can be used to simplify the process of
classification using small dataset.

Module 3
Module name :- Data Synthesization
Functionality:- The collected data were synthesized to remove irrelevant features. For example, the
ID column was irreverent to develop a prediction model, thus it was removed. To handle null values,
list wise deletion technique was applied where a particular observation was deleted if it had one or
more missing values.
Input:- Pre-processed Data
Output:- Labelled Data

Department of ISE, AIT, Bangalore 37


2021-
Intelligent System for Vertical Farming using IoT

Module 4
Module name :- Prediction
Functionality:- With the classified dataset (training dataset) the test data can be predicted for heart
disease. And the corresponding positive and negative predictions with their probabilities are obtained.
To generate prediction of Vertical Farming, algorithms had been developed and their accuracy was
tested. After attaining results from various types of supervised learning like Linear
Input:- Data Input to Algorithms
Output:- Prediction and Classification

Hardware Description:

ESP 32:

This is ESP WROOM 32 MCU Module. ESP WROOM 32 is a powerful, generic WiFi-BT-BLE MCU
module that targets a wide variety of applications, ranging from low-power sensor networks to the
most demanding tasks, such as voice encoding, music streaming, and MP3 decoding.

At the core of this module is the ESP32S chip, which is designed to be scalable and adaptive. There
are 2 CPU cores that can be individually controlled or powered, and the clock frequency is adjustable
from 80 MHz to 240 MHz.

The user may also power off the CPU and make use of the low-power coprocessor to constantly
monitor the peripherals for changes or crossing of thresholds. ESP32S integrates a rich set of
peripherals, ranging from capacitive touch sensors, Hall sensors, low-noise sense amplifiers, SD
card interface, Ethernet, high-speed SDIO/SPI, UART, and I²C.

Using Bluetooth, users can connect to their phone or broadcast low energy beacons for its detection.
The use of Wi-Fi enables a large physical range, as well as a direct connection to the internet via a Wi-
Fi router. Perfect for wearable electronic or battery-powered applications, the ESP32 chip uses less
than 5µA.

In addition, this module can support data rates of up to 150 Mbps and 22 dBm output power at the PA
in order to allow for the widest physical range.

Department of ISE, AIT, Bangalore 2022- 38


Intelligent System for Vertical Farming using IoT

Figure 5.7:ESP 32 board

Fig ure 5.7.1: ESP 32 board pin diagram

Department of ISE, AIT, Bangalore 2022- 39


Intelligent System for Vertical Farming using IoT

PIN DESCRIPTION

Below Table explains the pin description ESP 32 board.

Table 5.7.1: The pin description Esp 32 board

Department of ISE, AIT, Bangalore 2022- 40


Intelligent System for Vertical Farming using IoT

ESP 32 TECHNICAL SPECIFICATION

Below Table explains the ESP 32 technical specification.

Table 5.7.2: ESP 32 technical specification

Microcontroller ATmega328P – 8 bit AVR family microcontroller


Operating Voltage 5V
Recommended
7-12V
Input
Voltage
Input Voltage 6-20V
Limits
Analog Input Pins 6 (A0 – A5)
Digital I/O Pins 14 (Out of which 6 provide PWM output)
DC Current on I/O 40 mA
Pins
DC Current on 50 mA
3.3V Pin
Flash Memory 32 KB (0.5 KB is used for Bootloader)
SRAM 2 KB
EEPROM 1 KB
Frequency(Clock
16 MHz
Speed)

Department of ISE, AIT, Bangalore 2022- 41


Intelligent System for Vertical Farming using IoT

OVERVIEW

ESP 32 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. ESP 32 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 ESP 32

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:

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.
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.
PWM Pins 3, 5, 6, 9 and 11: These pins provide an 8-bit PWM output by using analog Write () function.
SPI Pins 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK): These pins are used for SPI
communication.
In-built LED Pin 13: This pin is connected with built-in LED. When pin 13 is high, then LED will ON
and when 13 pin is low, it represents 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.ESP 32 has a couple of other pins as explained below:

Department of ISE, AIT, Bangalore 2022- 42


Intelligent System for Vertical Farming using IoT

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.

ESP 32 TO ATMEGA328 PIN MAPPING

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

SOFTWARE

Arduino IDE (Integrated Development Environment) is required to program the ESP 32


board.

Department of ISE, AIT, Bangalore 2022- 43


Intelligent System for Vertical Farming using IoT

5.8 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. ESP 32 is
programmed using Arduino programming language based on Wiring. To get it started with ESP 32
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

APPLICATIONS

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.

Department of ISE, AIT, Bangalore 2022- 44


Intelligent System for Vertical Farming using IoT

5.9.ESP 32 2D MODEL

Figure 5.9.1: ESP 32 2D Model

The user may also power off the CPU and make use of the low-power coprocessor to constantly
monitor the peripherals for changes or crossing of thresholds. ESP32S integrates a rich set of
peripherals, ranging from capacitive touch sensors, Hall sensors, low-noise sense amplifiers, SD card
interface, Ethernet, high-speed SDIO/SPI, UART, and I²C.

Department of ISE, AIT, Bangalore 2022- 45


Intelligent System for Vertical Farming using IoT

LCD

A liquid-crystal display (LCD) is a flat-panel display or other electronically modulated optical device
that uses the light-modulating properties of liquid crystals. Liquid crystals do not emit light
directly, instead using a backlight or reflector to produce images in color or monochrome. LCDs are
available to display arbitrary images (as in a general-purpose computer display) or fixed images with
low information content, which can be displayed or hidden, such as preset words, digits, and seven-
segment displays, as in a digital clock. They use the same basic technology, except that arbitrary
images are made up of a large number of small pixels, while other displays have larger elements.

LCDs can either be normally on (positive) or off (negative), depending on the polarizer arrangement.
For example, a character positive LCD with a backlight will have black lettering on a background that
is the color of the backlight, and a character negative LCD will have a black background with the
letters being of the same color as the backlight. Optical filters are added to white on blue LCDs to
give them their characteristic appearance. LCD’s consumes less amount of power compared to CRT
and LED and consist of some microwatts for display in comparison to some mill watts for LED’s.
LCDs are of low cost and provides excellent contrast. LCD’s are thinner and lighter when compared to
cathode ray tube and LED.

A 20x4 LCD display as shown in the figure 4.5.2 is very basic module and is very commonly used in
various devices and circuits. Preferred over seven segments and other multi segment LEDs. A 20x4
LCD means it can display 16 characters per line and there are 2 such lines. This LCD has two
registers, namely, Command and Data.
Fig 5.9.2: LCD Display

Department of ISE, AIT, Bangalore 2022- 46


Intelligent System for Vertical Farming using IoT

Fig Soil Moisture Sensor

Fig 5.9.3: Dht 11 moisture sensor

Department of ISE, AIT, Bangalore 2021- 47


Intelligent System for Vertical Farming using IoT

DESCRIPTION
FC-28 soil moisture sensor is a simple breakout for measuring the moisture in a soil and similar
materials. The soil moisture sensor is pretty straight forward to use. The two large exposed pads
function as probes for the sensor, together acting as a variable resistor. The more soil that is in the pads
will be and will results in a lower resistance, and a higher an out.

FEATURES

1. Digital output threshold adjust potentiometer


2. Power and digital output indicator or LED’s
3. Analog and digital outputs
4. Mounting hole for easy installation

TECHNICAL SPECIFICATIONS

1. Operating voltage 3.3V-5V


2. PCB size:3.2cm x 1.4cm
3. Power indicators:(red) and digital switching output indicator(green)
4. Comparator

Soil Pump:

Micro DC 3-6V Micro Submersible Pump Mini soil pump For Fountain Garden Mini soil 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 soil and power it. Make sure that
the soil level is always higher than the motor. Dry run may damage the motor due to heating and it will
also produce noise.

Department of ISE, AIT, Bangalore 2021- 48


Intelligent System for Vertical Farming using IoT

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

Department of ISE, AIT, Bangalore 2021- 49


Intelligent System for Vertical Farming using IoT

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 soil or wet and could use a day to dry out, you will never
over/under soil 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.

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.

Department of ISE, AIT, Bangalore 2021- 50


Intelligent System for Vertical Farming using IoT

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 soil, amend your soil or adjust
lighting.
4. Compact, portable & easy to use, just plug and use; Compact soil meter works
indoor/outdoors.
5. Save soil, 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
10. Save soil, energy and keep your plants, lawn, flower in top condition.

11. Measures moisture at root level.

12. No battery required, simple and convenient to use.

13. Multifunctional: Can test Moisture / Light / pH

Department of ISE, AIT, Bangalore 2021- 51


Intelligent System for Vertical Farming using IoT

PH sensor:

Principles of operation of a pH meter

A pH meter is essentially a voltmeter with a high input impedance which measures the voltage of an
electrode sensitive to the hydrogen ion concentration, relative to another electrode which exhibits a
constant voltage. The key feature of the pH-sensitive electrode is a thin glass membrane whose outside
surface contacts the solution to be tested. The inside surface of the glass membrane is exposed to a
constant concentration of hydrogen ions (0.1 M HCl).

Inside the glass electrode assembly, a silver wire, coated with silver chloride and immersed in the
HCl solution, is called an Ag/AgCl electrode. This electrode carries current through the half-cell
reaction. The potential between the electrode and the solution depends on the chloride ion
concentration, but, since this is constant (0.1 M), the electrode potential is also constant.

A reference electrode is needed to complete the electrical circuit. A common choice is to use
another Ag/AgCl electrode as the reference. The Ag/AgCl electrode is immersed in an 0.1 M KCl
solution which makes contact with the test solution through a porous fiber which allows a small flow
of ions back and forth to conduct the current. The potential created at this junction between the KCl
solution and the test solution is nearly zero and nearly unaffected by anything in the solution,
including hydrogen ions.

Using the pH Meter: Allow the meter a few minutes to stabilize after you plug it in. When you are
not using the meter, keep the electrode immersed in pH 7.0 buffer to a depth of about one inch. The
meter must be calibrated by using standards of known pH before an unknown is measured.
Since the unknowns are acidic, the pH 4.00 and pH 7.00 standards should be used.

Department of ISE, AIT, Bangalore 2021- 52


Intelligent System for Vertical Farming using IoT

An accurate pH reading depends on standardization, the degree of static charge, and the temperature

of the solution.

Glass electrode Reference electrode Combined electrode

The pH meter should be standardized each time it is used with a buffer of known pH, preferably one

closest to the desired final pH. To calibrate the pH meter, expose the hole in the electrode, rinse the

electrode with deionized soil, and place the electrode in a standard solution, e.g., pH 7. Turn the

selector to "pH". Adjust the pH meter to the appropriate pH. Rinse electrode with deionized soil and

place in a second standard buffer solution. The choice of the second standard depends on the final he

standard pH buffers used should be 7 and 10. If the final pH desired, for example, if the final pH

desired is 8.5, t pH desired is 5.5, the standard pH buffers used should be 4 and 7. Turn the selector to

"pH". Adjust the temperature knob to the second standard pH. Rinse the electrode with deionized soil,

and return the electrode to the soaking solution.

When rinsing the electrode, never wipe the end, but blot gently since wiping can create a static

electric charge, which can cause erroneous readings,

Make sure the solution you are measuring is at room temperature since the pH can change with a

change in temperature.

Department of ISE, AIT, Bangalore 2021- 53


Intelligent System for Vertical Farming using IoT

The pH-sensitive glass membrane is very thin and very easily broken. Do not touch the membrane

with anything harder than a Kim-Wipe and do that very gently. Do not drop the electrode or bump it

on the bottom of the beaker when immersing it in a solution.The glass membrane must be thoroughly

hydrated to work properly. Do not allow the electrode to remain out of soil any longer than necessary.

When the electrode is not in use, keep it immersed in the pH 7.00 buffer. Do not put the electrode

down on the desk.

Interfacing pH Sensors:
Ph sensors, interface and calibration

The pH electrode is essentially a simple single cell battery. The voltage is directly proportional to the
hydrogen ion concentration surrounding the electrode. The pH is the logarithm of the hydrogen ion
concentration.

The ideal pH electrode:

 Zero volts output at neutral pH (=7.0)


 Positive voltage in acids, pH<7
 Negative voltages in bases, pH>7
 Total realistic pH range is 0 to 14.
 Generates -59.16 millivolts per pH unit at room temperature (="Nernst potential"). Note that
this is a negative slope--higher pH, lower voltage.
 the full scale range is +/-0.414 volts. (+/-0.05916*7), at 25 degC.
 Temperature coefficient of the Nerst potential is -0.001984 mV per °C. That makes the slope -
54.2 millivolts per pH unit at 0 degrees Celsius, and -74.04 millivolts per pH unit at 100
degrees Celsius.

Department of ISE, AIT, Bangalore 2021- 54


Intelligent System for Vertical Farming using IoT

But the electrode is practically never ideal:

The above values depend somewhat on the construction of the individual electrode, and its aging.
That is why it is necessary to calibrate and standardize the pH monitoring and recording instrument
from time to time, depending on the conditions it is subjected to. "Standardize" means to adjust the

offset so that the instrument reads zero in neutral (pH 7) solution. "Calibrate" means to trim the slope
of the pH/mV response to the the correct value for the electrode at that point in time. The instrument
should probably have automatic temperature compensation, to adjust the slope in response to different
calibration and working temperatures.

The kicker from the electronic standpoint is that the output impedance of the pH electrode is
extremely high. The electrode acts like voltage source, however, there is a 10 to 50 mega ohm resistor
in series with the voltage. Any voltmeter that measures the output of a pH electrode has to have
extremely high input impedance, 1 tera ohm or more. Even many digital multimeters, which have 10
or 20 mega ohms of input resistance, will load down a pH electrode and give a reading that is much
lower than it should be.

It is the glass membrane of the probe that is responsible for the high resistance. It a special glass with
tiny "pores" that cannot support much electrical current.

The usual approach to pH electrodes is to amplify and buffer the signal, with an MOS or CMOS input
operational amplifier. When properly constructed with attention to the input circuit layout, it can easily
achieve the necessary high input resistance.

Department of ISE, AIT, Bangalore 2021- 55


Intelligent System for Vertical Farming using IoT

Here is the circuit of a pH amplifier:

Department of ISE, AIT, Bangalore 2021- 56


Intelligent System for Vertical Farming using IoT

This amplifier produces 1 volt output in neutral, pH=7, buffer. Adjust RT1 to set this offset. This
adjustment could also be used to set the output to 1.0 volts when the pH probe at the input is placed in
neutral pH buffer.

The resistor R6 sets the gain. With 221k½ installed at R6, the overall gain will be x2, and the fullscale
output will be nominally 0.16 to 1.84 volts to cover the 0 to 14 pH range.

This circuit does not have a gain control. The idea is that the main calibration will be done in
software. Similarly, although the trimmer RT1 can trim the offset (1 volts output in neutral pH), the
idea is to do the recurring calibration in software.

Here is the first cut on how to program it on the Basic Stamp: This assumes that the output of the pH
electrode is exactly 0 volts at pH7, and that it has a Nernst slope of exactly 59.16 mV per pH unit:

pHloop:
gosub ADread ' return millivolts, mV, not shown
pH = mV ** 55405 ' stamp's way to multiply times 700/828 (see below)
pH = pH - 845 ' 845 is the 1 volt offset, times 700/828
pH = 700 - pH ' adjusts to pH 7.00 at 1 volt input, decreasing in acid debug
rep "-"\pH.bit14,dec abs (pH/100),".".dec2 abs pH ' display with
decimal point xx.xx
goto pHloop

This routine reads the voltage, then converts to pH units, and then prints out the pH result as XX.XX
format. The display allows for a negative pH value, but that should never occur except in a super- acid,
or unless something is wrong with the instrument.

The factor **55405 is the stamp's way of approximating the fraction (7.00 pH units per 0.828-volt
change 700/828), to convert from millivolts to pH. (math: 700/828*65536=55405) The offset -

Department of ISE, AIT, Bangalore 2021- 57


Intelligent System for Vertical Farming using IoT

845+700 is applied after the multiplication, because the ** operation does not work correctly on
negative numbers. (The offset 845 comes from 1000 millivolts offset * 700/828 pH units per volt).

In the real world, the electrode will not have the ideal slope factor nor the ideal offset. What is more,
the slope (Nernst potential) and offset will drift slowly with time as the electrode ages. Also, the pH
measurement is temperature dependent. This is predictable, -0.002mV per degree C change in the
slope factor.

I practice the pH electrode will have means for interactive calibration. The user first puts the sensor in
neutral pH buffer and presses a button, and then puts the probe in either pH4 or pH10 buffer
(depending on whether the measurements to come will tend to the acidic or the basic side), and
presses a second button. The machine records the readings at those two calibrations values and then
computes the new slope and offset, which are applied to successive measurements. The temperature is
measured too, and the temperature correction is automatically applied. All this can be done using the
stamp. More on this later.

Additional considerations apply when measuring pH in real world solutions. Often these solutions
contain minerals and other chemical species that affect the temperature dependence of pH in a manner
quite different from the theoretical Nernst value of -0.002 mV/degree Celsius. "Cycle Chemistry pH
Measurement" is one reference that discusses.

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 Express 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 Ten silica 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.

Department of ISE, AIT, Bangalore 2021- 58


Intelligent System for Vertical Farming using IoT

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

Fig 5.9.4: Wi-Fi Module

TEMPERATURE SENSOR:
In general, a temperature sensor is a device which is designed specifically to measure the hotness or
coldness of an object. LM35 is a precision IC temperature sensor with its output proportional to the
temperature (in °C). With LM35, the temperature can be measured more accurately than with a
thermistor. It also possesses low self-heating and does not cause more than 0.1 °C temperature rise in
still air. The operating temperature range is from -55°C to 150°C.The LM35’s low output impedance,
linear output, and precise inherent calibration make interfacing to readout

Department of ISE, AIT, Bangalore 2021- 59


Intelligent System for Vertical Farming using IoT

or control circuitry especially easy. It has found its applications on power supplies, battery
management, appliances, etc.

Fig 5.9.5: LM35 Temperature sensor Pinout.

The LM35 is an integrated circuit sensor that can be used to measure temperature with an electrical
output proportional to the temperature (in °C). It can measure temperature more accurately than a
using a thermistor. The sensor circuitry is sealed and not subject to oxidation. The LM35 generates a
higher output voltage than thermocouples and may not require that the output voltage be amplified.
The LM35 has an output voltage that is proportional to the Celsius temperature. The scale factor is
.01V/°C.
The LM35 does not require any external calibration or trimming and maintains an accuracy of
+/-0.4°C at room temperature and +/-0.8°C over a range of 0°C to +100°C.Another important
characteristic of the LM35 is that it draws only 60 micro amps from its supply and possesses a low
self-heating capability. The LM35 comes in many different packages such as TO-92 plastic transistor-
like package, T0-46 metal can transistor-like package,8-lead surface mount SO-8 small outline
package.
Note: - LM35 is an analog temperature sensor. This means the output of LM35 is an analog signal.
Microcontrollers don’t accept analog signals as their input directly. We need to convert this analog
output signal to digital before we can feed it to a microcontroller’s input. For this purpose, we can use
an ADC (Analog to Digital Converter). If we are using a basic microcontroller like

Department of ISE, AIT, Bangalore 2021- 60


Intelligent System for Vertical Farming using IoT

Note: - LM35 is an analog temperature sensor. This means the output of LM35 is an analog signal.
Microcontrollers don’t accept analog signals as their input directly. We need to convert this analog
output signal to digital before we can feed it to a microcontroller’s input. For this purpose, we can use
an ADC (Analog to Digital Converter).

If we are using a basic microcontroller like 8051, we need to use an external ADC to convert analog
output from LM35 to digital. We then feed the output of ADC (converted digital value) to input of
8051. But modern-day boards like Arduino and most modern-day micro controllers come with inbuilt
ADC. Our ESP 32 has an in built 10-bit ADC (6 channel). We can make use of this in- built ADC of
Arduino to convert the analog output of LM35 to digital output. Since ESP 32 has a 6-channel inbuilt
ADC, there are 6 analog input pins numbered from A0 to A5. Connect analog out of LM35 to any of
these analog input pins of Arduino.

Department of ISE, AIT, Bangalore 2021- 61


Intelligent System for Vertical Farming using IoT

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

Department of ISE, AIT, Bangalore 2021- 62


Intelligent System for Vertical Farming using IoT

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

Department of ISE, AIT, Bangalore 2021- 63


Intelligent System for Vertical Farming using IoT

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.

Table 5.10.1: Unit test case for LED

Sl # Test Case : - UTC-1


Name of Test: - LED Testing
Items being tested: - LED
Sample Input: - Power supply
Expected output: - LED should display “Soil parameter” message.
Actual output: - LED displays “soil parameter values”.
Remarks: - Pass

Table 5.10.2: Unit Test Case for Temperature Sensor

Sl # Test Case : - UTC-2


Name of Test: - Temperature Sensor , and Turbidity Sensor Reading
Items being tested: - LM 35 Sensor , PH and Turbidity Sensor
Sample Input: - Input to Temperature Sensor
Expected output: - Should Read all Temperature Conditions
Actual output: - Temperature Values Read

Remarks: - Pass

Department of ISE, AIT, 2021- 64


Intelligent System for Vertical Farming using IoT

Table 5.10.3: Unit test case for Cloud Upload


Sl # Test Case : - UTC-3
Name of Test: - Wifi Module testing

Items being tested: - Wifi Module


Sample Input: - Power supply, Input to Sensors
Expected output: - Data Upload to thingspeak Cloud
Actual output: - Data Uploaded to Specific Thingspeak id

Remarks: - Pass

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.

Department of ISE, AIT, 2021- 65


Intelligent System for Vertical Farming using IoT

Table 5.10.4: Integration test case for Arduino and Sensors

Sl # Test Case : - ITC-1


Name of Test: - Working of ESP32 With Sensors
Items being tested: - ESP 32 and Sensor Values
Sample Input: - Input to Sensors
Expected output: - LCD should display all sensor details.
Actual output: - Values Displayed

Remarks: - Pass

Table 5.10.5: Integration test case for Arduino and Cloud Update

Sl # Test Case : - ITC-2

Name of Test: - Thingspeak Cloud to ML Model


Items being tested: - Data Retrieval
Sample Input: - Data From Thingspek id
Expected output: - User’s input should be accepted

Actual output: - User’s input accepted through Thingspeak Model

Remarks: - Pass

Department of ISE, AIT, 2021- 66


Intelligent System for Vertical Farming using IoT
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

Table 5.10.6: System test case

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: - Soil Quality Prediction
Actual output: - ML Model Predicted the results by taking input from sensors

Remarks: - Pass

Department of ISE, AIT, 2021- 67


Intelligent System for Vertical Farming using IoT

CHAPTER 6
RESULTS AND DISCUSSION

Assembled circuit board: This is the complete assembled circuit design of the project
with various sensors and actuator assembled together.

Fig 6.1: Assembled circuit board

Sensors: Establishing the connection with all the sensors soil sensor,DTH11 sensor and LDR
sensor connection to microcontroller

Fig 6.2: Sensors Connected

Department of ISE, AIT, Bangalore 2021- 68


Intelligent System for Vertical Farming using IoT

LED Sensor: LDRs are tiny light-sensing devices also known as photo resistors. An LDR is a
resistor whose resistance changes as the amount of light falling on it changes. The resistance of the
LDR decreases with an increase in light intensity. This property allows us to use them for making
light sensing circuits.

Fig 6.3: Led Light Monitoring

Soil Moisture Sensor: soil moisture sensor is the sensor responsible to measure the moisture content
in the soil such as water and humidity.

Fig 6.4: Moisture Sensor

Department of ISE, AIT, Bangalore 2021- 69


Intelligent System for Vertical Farming using IoT

Humidity & Temperature Sensors: This sensor is responsible to measure the physical factors from the
environment present in the soil.

Fig 6.5: Humidity & Temperature Sensors

Fig 6.6:Monitoring Plants

Department of ISE, AIT, Bangalore 2021- 70


Intelligent System for Vertical Farming using IoT

Blynk IoT app: The sensors value/ update in vertical farm is received by the owner by the
application that is Blynk IoT .There is a pop-up message that keeps updating the current
status of sensor value .

Fig 6.7: Blynk IOT

Monitoring System from Blynk iot app : The user can monitor the temperature humidity and
moisture content in soil through Blynk iot app

Fig 6.8: Prediction System

Department of ISE, AIT, Bangalore 2021- 71


Intelligent System for Vertical Farming using IoT

Alerts getting from Blynk iot app : The user will get know the alerts regarding the temperature
if it is high and soil moisture level is low that msg is notified to user through Blynk iot app

Fig 6.9::Msg Alert Notification to User

Timeline Notification from Blynk iot app : The user will get the notifications regarding the
temperature if it is high and soil moisture level through Blynk iot app

Fig 6.10 Blynk IoT Timeline Notification

Department of ISE, AIT, Bangalore 2021- 72


Intelligent System for Vertical Farming using IoT

Developer Mode from Blynk iot app : The user can add there prototype regarding the Farming house to
be notified While monitoring plants through Blynk iot app

Fig 6.11: Blynk IoT Developer Mode

Prototype Status from Blynk iot app : The user can monitor the weather status through Blynk iot app

Fig 6.12: Blynk IoT Prototype Status

Department of ISE, AIT, Bangalore 2021-22 73


Intelligent System for Vertical Farming using IoT

CHAPTER 7
CONCLUSION

This study has succeeded in making a system used for monitoring and controlling vertical farming
water circulation automatically with ESP32 through the website interface. This system is very
suitable and runs well in vertical farming Deep Flow Technique (DFT), because water circulation
can run more effectively when certain conditions. Based on the comparison of the results of
observations on the growth of mustard plants in two conditions resulted in a signifi-cant difference
in the results of high growth and number of leaves.We will be building an efficient and cost
effective system which will be reducing water consumption from 80% to 20% , agricultural land by
20%, reduces the utilization of fertiliser, minimises the involvement of labours and improves crop
yield within short duration with irrespective of seasons.

Department of ISE, AIT, Bangalore 2021-22 74


Intelligent System for Vertical Farming using IoT

REFERENCES

1. J.SasiBhanu, Sunitha Devi Bigul, and A. Prakash “Agricultural internet of things using machine
learning”30 July 2021.
2. Zhenfeng Xu, Junjie Chen, Yahui Wang and Zhen Fan “A Remote Monitoring System for
Greenhouse Based on the Internet of Things”ICMMR 20163.
3. Crane-Droesch, Andrew “Machine learning methods for crop yield prediction and climate change
impact assessment in agriculture”Environmental Research Letters, Volume 13, Issue 11, article id.
114003 (2018).
4. SrdjanSladojevic, Marko Arsenovic“Deep Neural Networks Based Recognition of Plant Diseases
by Leaf Image Classification”22 Jun 2016.

5. Laura García,Lorena Parra, Jose M. Jimenez“IoT-Based Smart Irrigation Systems: An Overview on


the Recent Trends on Sensors and IoT Systems for Irrigation in Precision Agriculture”2020 Feb;
20(4):1042. Published online 2020 Feb 14. doi:10.3390/s20041042.

6. Vinayak N. Malavade , Pooja K. Akulwar“Role of IoT in Agriculture”National Conference On


"Changing Technology and Rural Development" CTRD 2k16.

7. M.Weiser,The Computer for the 21st Century, Scientific American, 1991. R. Want, A. Hopper, V.
Falcao, and J. Gibbons, “Active badge location system,” ACM Transactions on Information Systems,
vol. 10, no. 1, pp. 91–102, 1992.

8. G. D. Abowd, C. G. Atkeson, J. Hong, S. Long, R. Kooper, and M. Pinkerton, “Cyberguide: a


mobile context-aware tour guide,” Wireless Networks, vol. 3, no. 5, pp. 421–433, 1997.

9. Y. Sumi, T. Etani, S. Fels, N. Simonet, K. Kobayashi, and K. Mase, “C-map: building a


contextaware mobile assistant for exhibition tours,” in Community Computing and Support Systems,
Social Interaction in Networked Communities.

10. K. Cheverst, N. Davies, K. Mitchell, A. Friday, and C. Efstratiou,“Developing a context-aware


electronic tourist guide: some issues and experiences,” in Proceedings of the SIGCHI Conference on
Human Factors in Computing Systems, pp. 17–24, ACMPress, NewYork, NY,USA,April 2000.

Department of ISE, AIT, Bangalore 2021-2022 Page 68

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy