Smart Agriculture Monitoring Using IoT Platform
Smart Agriculture Monitoring Using IoT Platform
on
SMART AGRICULTURE MONITORING USING IoT
PLATFORM
Submitted by
A KALYAN 21W91A0402
A ANIL NAYAK 21W91A0401
G AKHIL CHARY 21W91A0435
B HARIKA 21W91A0440
i
SMART AGRICULTURE MONITORING USING IoT PLATFORM
DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING
BONAFIDE CERTIFICATE
External Examiner
ii
SMART AGRICULTURE MONITORING USING IoT PLATFORM
DECLARATION
DEPARTMENT OF ECE
A KALYAN 21W91A0402
A ANIL NAYAK 21W91A0401
G AKHIL CHARY 21W91A0435
B HARIKA 21W91A0440
iii
SMART AGRICULTURE MONITORING USING IoT PLATFORM
ACKNOWLEDGEMENT
DEPARTMENT OF ECE
A KALYAN 21W91A0402
A ANIL NAYAK 21W91A0401
G AKHIL CHARY 21W91A0435
B HARIKA 21W91A0440
iv
SMART AGRICULTURE MONITORING USING IoT PLATFORM
List of Contents
SMART AGRICULTURE MONITORING USING IoT PLATFORM .................................................... 1
CHAPTER 1 – INTRODUCTION.................................................................................................... 2
1.0 Introduction ............................................................................................................... 2
1.1 Motivation ....................................................................................................................... 2
1.2 Problem definition........................................................................................................... 3
1.3 Objective of Project ......................................................................................................... 3
1.4 Limitations of Project ...................................................................................................... 4
1.5 Organization of Documentation ...................................................................................... 4
CHAPTER 2 - LITERATURE SURVEY............................................................................................. 7
2.1 Introduction ..................................................................................................................... 7
2.2 Existing System ................................................................................................................ 7
2.3 Disadvantages & Limitations of Existing System ............................................................. 7
2.4 Proposed System ............................................................................................................. 9
CHAPTER 3 - ANALYSIS ............................................................................................................ 10
3.1 Introduction ................................................................................................................... 10
3.2 Software Requirement Specification............................................................................. 10
3.2.1 User Requirement .................................................................................................. 10
3.2.2 Software Requirement ........................................................................................... 10
3.2.3 Hardware Requirement .......................................................................................... 20
CHAPTER 4 – DESIGN ............................................................................................................... 57
4.1 INTRODUCTION ............................................................................................................. 57
4.2 DFD / ER / UML Diagrams .............................................................................................. 57
4.3 Module Design and Organization .................................................................................. 58
CHAPTER 5 – IMPLEMENTATION & RESULTS .......................................................................... 59
5.1 INTRODUCTION ............................................................................................................. 59
5.2 Explanation of Key Functions ........................................................................................ 59
5.2.1 Sensor Data Collection ........................................................................................... 59
5.2.2 Remote Motor Control via GSM ............................................................................. 59
5.2.3 Real-time Data Upload to ThingSpeak ................................................................... 59
5.2.4 Alert Notifications .................................................................................................. 60
5.2.5 Error Handling ........................................................................................................ 60
5.3 Method of Implementation........................................................................................... 60
v
SMART AGRICULTURE MONITORING USING IoT PLATFORM
vi
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Table of Figures
vii
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Table of Tables
viii
SMART AGRICULTURE MONITORING USING IoT PLATFORM
ABSTRACT:
Crop farming in India is labor intensive and obsolete. Farming is still dependent on
techniques which were evolved hundreds of years ago and doesn't take care of
conservation of resources. The newer scenario of decreasing water tables, drying up of
rivers and tanks, unpredictable environment presents an urgent need of proper
utilization of water. We have the technology to bridge the gap between water usage
and water wastage. Technology used in some developed countries is too expensive and
complicated for a common farmer to understand. Our project is to give cheap, reliable,
cost efficient and easy to use technology which would help in conservation of resources
such as water and also in automating farms.
1
SMART AGRICULTURE MONITORING USING IoT PLATFORM
CHAPTER 1 – INTRODUCTION
1.0 Introduction
Agriculture is major source of income for the largest population in India and is
major contributor to Indian economy. In past decade it is observed that there is not
much crop development in agriculture sector. Food prices are continuously increasing
because crop rate declined. There are number of factors which is responsible for this it
may be due to water waste, low soil fertility, Fertilizer abuse, climate change or
diseases etc. It is very essential to make effective intervention in agriculture and the
solution is IOT in integration with wireless sensor network. Internet of things (IOT) is
a method of connecting everything to the internet- it is connecting object or things
(such as car, home, electronic devices, etc. ...) which are previously not connected
with each other main purpose of IOT is ensuring delivery of right information to right
people at right time. In agriculture irrigation is the important factor as the monsoon
rain falls are unpredictable and uncertain.
1.1 Motivation
The agricultural growth is enhanced with the increase in the productivity and
upgradation of the plantation systems. The application of Internet of Things (IoT)
technology in agriculture could have the greatest impact for increase the productivity.
The global population is increased every year. So, to feed this much population, the
farming industry must use advanced technology like IoT for increased profit. Smart
farming based on IoT technologies will enable growers and farmers to reduce waste
and enhance productivity ranging from the quantity of fertilizer utilized to the number
of journeys the farm vehicles have made. In IoT-based smart farming, a system is
2
SMART AGRICULTURE MONITORING USING IoT PLATFORM
built for monitoring the crop field with the help of sensors (humidity, temperature,
soil moisture Sensor). The farmers can monitor the field conditions from anywhere.
IoT-based smart farming is highly efficient when compared with the conventional
approach.
The objective of this project is to create a smart, IoT-based system that enables
real-time monitoring of environmental factors crucial to agriculture. The specific
objectives include:
• Data Storage and Access via Cloud Platform: Send collected data to the
ThingSpeak server, allowing historical data tracking and analysis, which helps
farmers understand seasonal and environmental trends.
3
SMART AGRICULTURE MONITORING USING IoT PLATFORM
4
SMART AGRICULTURE MONITORING USING IoT PLATFORM
1. Introduction:
2. Literature Survey:
3. Analysis:
4. Design:
o This chapter covers the practical aspects of building and testing the
project. It details the coding, setup, configuration, and integration of
various components, including sensors, the Arduino, and ThingSpeak.
Screen captures and output examples are provided to show real-world
results and the system's responsiveness to environmental changes.
Results from test cases validate the system’s performance and
reliability.
5
SMART AGRICULTURE MONITORING USING IoT PLATFORM
7. Conclusion:
8. References:
6
SMART AGRICULTURE MONITORING USING IoT PLATFORM
2.1 Introduction
7
SMART AGRICULTURE MONITORING USING IoT PLATFORM
8
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Advantages:
9
SMART AGRICULTURE MONITORING USING IoT PLATFORM
CHAPTER 3 - ANALYSIS
3.1 Introduction
The analysis phase involves defining the system’s requirements and outlining the
technical and functional specifications necessary to achieve the project’s goals. This section
examines both user and system requirements, detailing the hardware and software
components needed to build a reliable IoT monitoring system. By clearly establishing these
parameters, the analysis phase provides a solid foundation for system design, ensuring each
component contributes to the overall functionality and efficiency of the solution.
The primary users of this system are farmers and agricultural managers seeking a
low-cost, reliable solution for real-time monitoring of environmental conditions. Users need
a system that is:
• Intuitive and Simple to Use: The system should have an easy setup and operation
process, requiring minimal technical knowledge. A straightforward interface is
essential for efficient data monitoring and device management.
• Remote Accessible: Users should be able to access data remotely through a cloud
platform, allowing them to monitor conditions without needing to be physically
present on the farm.
• Real-Time Alerts: The system should provide immediate alerts via a buzzer when
specific environmental thresholds are exceeded, allowing users to take prompt
action to protect crops.
Core Functionalities:
• Sensor Data Acquisition: Collect data from alcohol sensors, heart rate sensors, and
other relevant sensors.
10
SMART AGRICULTURE MONITORING USING IoT PLATFORM
• Data Processing and Analysis: Process and analyze sensor data to extract
meaningful insights, such as BAC levels, heart rate variability, and trends in alcohol
consumption.
• Data Transmission: Transmit processed data to a cloud-based platform for storage
and analysis.
• User Interface: Develop a user-friendly web or mobile app interface for data
visualization and interaction.
• Alert and Notification System: Implement a system to generate alerts and
notifications based on predefined thresholds or anomalous patterns.
Technical Requirements:
11
SMART AGRICULTURE MONITORING USING IoT PLATFORM
• Now after installing , open the Arduino IDE & add required libraries in the
following step.
o Here, we added DFRobot_DHT11
▪ Click on Sketch
▪ Include library
▪ Manage library
12
SMART AGRICULTURE MONITORING USING IoT PLATFORM
13
SMART AGRICULTURE MONITORING USING IoT PLATFORM
• Now upload the program into the Arduino uno r3 by connecting with a probe.
3.2.2.2 Proteus 8
• Introduction:
o Proteus Design Suite (designed by Labcenter Electronics Ltd.) is a
software tool set, mainly used for creating schematics, simulating
Electronics & Embedded Circuits and designing PCB Layouts.
o Proteus ISIS is used by Engineering students & professionals to create
schematics & simulations of different electronic circuits.
o Proteus ARES is used for designing PCB Layouts of electronic circuits.
o It's available in four languages i.e. English, Chinese, Spanish & French.
14
SMART AGRICULTURE MONITORING USING IoT PLATFORM
• Why Proteus?
o Proteus is quite lenient in circuit designing and it works on ideal
conditions i.e. if you don't add pull up resistors in Proteus simulation,
then it won't give garbage value.
o Proteus is also used for designing/testing programming codes for
different Microcontrollers i.e. Arduino, PIC Microcontroller, 8051 etc.
o Enter the name of the projet and select an appropriate location to save
the project,when finished, click NEXT.
15
SMART AGRICULTURE MONITORING USING IoT PLATFORM
16
SMART AGRICULTURE MONITORING USING IoT PLATFORM
button.
o Click on the schematic sheet where you want to place the component.
o Continue the above process until all the components have been placed.
o Connect component pins together by clicking on the starting pin and
then clicking on the pin of the component you want to connect to.
o Add Power and Ground terminals to your design by using the Terminals
sub menu.
o After the schematic is complete, click on the run arrow at the bottom
left of the project window.
o Use the virtual instruments and probes to verify your design is working
according to specificattions.
o Click on the ‘STOP’ button when you are are done with your
simulation.
17
SMART AGRICULTURE MONITORING USING IoT PLATFORM
• Click on “create a new” if you don’t have an account, if you have one login
with your credentials.
18
SMART AGRICULTURE MONITORING USING IoT PLATFORM
• Fill the required details & create your own channel (Make it public).
19
SMART AGRICULTURE MONITORING USING IoT PLATFORM
• After opening go to API Keys Section & copy the Write API Key to mention
it on our project to upload the data.
• Arduino Uno R3: The microcontroller serves as the system’s main processor,
collecting data from sensors and managing data flow to the cloud.
• DHT11 Sensor: Captures temperature and humidity data, crucial for
understanding environmental conditions.
20
SMART AGRICULTURE MONITORING USING IoT PLATFORM
• Soil Moisture Sensor: Monitors soil moisture levels, providing data that aids
in managing irrigation schedules.
• LCD Display: Displays real-time data on-site, allowing users to monitor
conditions at the farm without internet access.
• Buzzer: Alerts users to critical environmental conditions by sounding an
alarm.
• Power Supply: Ensures consistent power for uninterrupted operation, even in
remote locations with limited electricity access.
• Wireless Module : ESP8266 Wi-Fi module for wireless communication.
21
SMART AGRICULTURE MONITORING USING IoT PLATFORM
The name Arduino comes from a bar in Ivrea, Italy, where some of the founders
of the project used to meet. The bar was named after Arduin of Ivrea, who was
the margrave of the March of Ivrea and King of Italy from 1002 to 1014.
The initial Arduino core team consisted of Massimo Banzi, David Cuartielles,
Tom Igoe, Gianluca Martino, and David Mellis,[2] but Barragán was not invited to
participate.
22
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Following the completion of the Wiring platform, lighter and less expensive
versions were distributed in the open-source community.
It was estimated in mid-2011 that over 300,000 official Arduinos had been
commercially produced, and in 2013 that 700,000 official boards were in users' hands.
In October 2016, Federico Musto, Arduino's former CEO, secured a 50% ownership of
the company. In April 2017, Wired reported that Musto had "fabricated his academic
record.... On his company's website, personal LinkedIn accounts, and even on Italian
business documents, Musto was until recently listed as holding a PhD from the
Massachusetts Institute of Technology. In some cases, his biography also claimed an
MBA from New York University." Wired reported that neither University had any
record of Musto's attendance, and Musto later admitted in an interview with Wired that
he had never earned those degrees. Around that same time, Massimo Banzi announced
that the Arduino Foundation would be "a new beginning for Arduino." But a year later,
the Foundation still hasn't been established, and the state of the project remains unclear.
The controversy surrounding Musto continued when, in July 2017, he reportedly pulled
many Open source licenses, schematics, and code from the Arduino website, prompting
scrutiny and outcry. In October 2017, Arduino announced its partnership with ARM
Holdings (ARM). The announcement said, in part, "ARM recognized independence as
a core value of Arduino ... without any lock-in with the ARM architecture.” Arduino
intends to continue to work with all technology vendors and architectures.
23
SMART AGRICULTURE MONITORING USING IoT PLATFORM
24
SMART AGRICULTURE MONITORING USING IoT PLATFORM
board exposes most of the microcontroller's I/O pins for use by other circuits. The
Diecimila,[a] Duemilanove,[b] and current Uno[c] provide 14 digital I/O pins, six of
which can produce pulse-width modulated signals, and six analog inputs, which can
also be used as six digital I/O pins. These pins are on the top of the board, via female
0.1-inch (2.54 mm) headers. Several plug-in application shields are also commercially
available. The Arduino Nano, and Arduino-compatible Bare Bones Board and
Boarduino boards may provide male header pins on the underside of the board that
can plug into solderless breadboards.
Many Arduino-compatible and Arduino-derived boards exist. Some are
functionally equivalent to an Arduino and can be used interchangeably. Many
enhance the basic Arduino by adding output drivers, often for use in school-level
education, to simplify making buggies and small robots. Others are electrically
equivalent but change the form factor, sometimes retaining compatibility with shields,
sometimes not. Some variants use different processors, of varying compatibility.
25
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Serial 0(Rx), 1(Tx) Used to receive and transmit TTL serial data.
26
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Operating Voltage 5V
SRAM 2 KB
EEPROM 1 KB
27
SMART AGRICULTURE MONITORING USING IoT PLATFORM
DHT11 and DHT22 are the same types of sensors with some performance
differences. Both use capacitive humidity sensors and thermistors to measure the
relative humidity and temperature of the environment.
The DHT22 is more expensive, which means it is more capable than the
DHT11. DHT22 can measure from -40 to +125 degrees Celsius with +-0.5 degrees
accuracy, whereas the DHT11 can measure from 0 to 50 degrees Celsius with +-2
degrees accuracy.
Specifications DHT11
Temperature Range 0 to 50 ºC
Temperature Accuracy +/-2 ºC
Humidity Range 20% to 80%
Humidity Accuracy +/-5%
Sampling Period 1 Second
For sensing humidity, DHT11 has a resistive component that has two
electrodes and a moisture-holding substrate between them. When the moisture-
holding substrate absorbs the water vapor present in the air, it releases ions that
increase the conductivity between two electrodes.
28
SMART AGRICULTURE MONITORING USING IoT PLATFORM
The DHT11 or DHT22 can measure relative humidity only. So first you
should know what is relative humidity and how to calculate relative humidity.
Absolute humidity is the total mass of water vapor present in a given volume
or mass of air. It does not take temperature into consideration. On the other hand,
relative humidity is the ratio of how much water vapor is in the air and how much
water vapor the air could potentially contain at a given temperature.
29
SMART AGRICULTURE MONITORING USING IoT PLATFORM
𝜌𝜔
𝑅𝐻 = ( ) 𝑥100%
𝜌5
Where ,
RH – Relative Humidity,
ρw – density of water vapor at a certain temperature, and
ρs – the density of water vapor at saturation at that temperature.
The DHT11 uses a one-wire protocol to communicate with Arduino and other
MCUs. The sensor acts as a slave to a host controller. It will send digital data to the
host controller when requested.
The communication between the host controller and DHT11 can be broken down
into four steps:
Request signal: To get the humidity and temperature data, the host must send
a request signal for it. The data line is then pulled HIGH by default because of the
pull-up resistor. The request signal is a logical LOW for 18 milliseconds followed by
a low to high transition.
Then the host I/O needs to be set to input state to get the response signal.
30
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Figure 13 : Response
Data: After sending the response pulse, DHT11 begins to transmit sensor data
containing the values of humidity, temperature, and a checksum byte. The size of the
data packet is 40 bits or 5 bytes.
The first two bytes contain the values of relative humidity. The first byte
contains the humidity integer data and the second byte contains the humidity decimal
data.
The next two bytes (3rd and 4th) contain the temperature data. The third byte
contains the integer part and the fourth byte contains the fractional part of the
temperature.
The last byte is the checksum byte. This byte is used to check whether the
received data is correct or not. If the binary sum of the humidity and temperature
values (sum of the first four bytes) is equal to the checksum byte then the received
data is correct.
The bits are transmitted as a timing signal where the pulse width of the signal
determines whether it is a bit 0 or bit 1.
31
SMART AGRICULTURE MONITORING USING IoT PLATFORM
End Signal: After transmitting the 40-bit data packet, the sensor sends a logic
LOW signal for 50 microseconds and then pulls HIGH on the data pin. Then it goes
into low power consumption sleep mode.
The data from the DHT11 sensor can be sampled at 1Hz or once every second
Pinout of DHT11
In the below image, you can see that DHT11 have four pins.
• VCC
• Data
• No Connection
• Ground pin
32
SMART AGRICULTURE MONITORING USING IoT PLATFORM
They also come with a PCB-mounted version which has three pins. VCC, Data, and
Ground pin. This breakout board contains a pull-up resistor, which makes it easier to
connect with the Arduino.
33
SMART AGRICULTURE MONITORING USING IoT PLATFORM
One thing to note here is that the PCB version of these sensors has a built-in
pull-up resistor. so you don’t need to connect an external resistor to it.
A soil moisture sensor is a device used to measure the water content in soil.
These sensors provide vital information that helps in determining when and how
much to water crops, gardens, or lawns. The primary function of a soil moisture
sensor is to ensure that plants have adequate water for optimal growth while avoiding
overwatering, which can lead to waterlogging and root diseases.
Soil moisture sensors are designed to measure the volumetric water content of
the soil, providing data that can be used to optimize irrigation schedules, reduce water
usage, and prevent plant stress. They are widely used in agriculture, horticulture,
landscaping, and research.
There are several types of soil moisture sensors, each employing different methods to
measure soil moisture levels:
These sensors measure the soil’s dielectric permittivity, which changes with moisture
content. They consist of two metal plates that form a capacitor with the soil acting as
the dielectric material. The capacitance changes with soil moisture levels.
34
SMART AGRICULTURE MONITORING USING IoT PLATFORM
These sensors measure the electrical resistance between two electrodes inserted into
the soil. The resistance decreases as soil moisture increases because water conducts
electricity better than dry soil.
• Advantages: Simple to use, low cost, and easy to integrate into basic circuits.
These sensors measure the tension or suction that plants must exert to extract water
from the soil. They consist of a porous ceramic cup, water reservoir, and a pressure
gauge. As soil dries, the tension increases.
35
SMART AGRICULTURE MONITORING USING IoT PLATFORM
TDR sensors measure the time it takes for an electromagnetic pulse to travel along a
metal rod inserted into the soil. This travel time is affected by the soil’s moisture
content.
36
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Understanding the soil moisture sensor working principles is essential for selecting
the right sensor for specific applications:
1. Capacitive Sensors:
These sensors use two metal plates to form a capacitor with the soil as the dielectric
medium. Changes in soil moisture alter the dielectric constant, which affects the
capacitance. An electronic circuit measures this change and converts it into a soil
moisture level reading.
Example: When soil moisture increases, the dielectric constant of the soil increases,
which in turn increases the capacitance. The sensor’s electronic circuitry detects this
change and provides a corresponding moisture level reading.
2. Resistive Sensors:
These sensors measure the soil’s resistance to electrical current. As the soil moisture
increases, the resistance decreases because water conducts electricity better than dry
soil. The sensor translates the resistance measurement into a moisture level.
Example: When the soil is dry, the resistance between the sensor’s electrodes is high.
As the soil becomes wetter, the resistance drops, and the sensor’s circuitry converts
this change into a moisture level reading.
3. Tensiometric Sensors:
These sensors work by measuring the water tension in the soil. A porous ceramic tip
is filled with water and buried in the soil. The water inside the tip moves in and out
depending on the soil moisture, and the pressure required to draw water into the tip is
measured, indicating soil moisture levels.
Example: When the soil is dry, the tension is high because it requires more effort for
the plants to extract water. The tensiometer measures this tension and provides a
reading that reflects soil moisture availability.
37
SMART AGRICULTURE MONITORING USING IoT PLATFORM
4. TDR Sensors:
These sensors send an electromagnetic pulse along a probe inserted into the soil. The
travel time of the pulse is affected by the soil’s moisture content. By measuring the
travel time, the sensor determines the soil moisture level accurately.
Example: In wet soil, the pulse travels slower compared to dry soil. The sensor
measures the time delay and calculates the soil moisture content based on the known
properties of the soil.
2. Greenhouse Management
3. Landscape Irrigation
38
SMART AGRICULTURE MONITORING USING IoT PLATFORM
5. Home Gardening
39
SMART AGRICULTURE MONITORING USING IoT PLATFORM
are 16x2 and 20x2 displays. This means 16 characters per line by 2 lines and 20
characters per line by 2 lines, respectively.
40
SMART AGRICULTURE MONITORING USING IoT PLATFORM
The three control lines are referred to as EN, RS, and RW.
The EN line is called "Enable." This control line is used to tell the LCD that we are
sending it data. To send data to the LCD, our program should make sure this line is
low (0) and then set the other two control lines and/or put data on the data bus. When
the other lines are completely ready, bring EN high (1) and wait for the minimum
amount of time required by the LCD datasheet (this varies from LCD to LCD), and
end by bringing it low (0) again.
The RS line is the "Register Select" line. When RS is low (0), the data is to be
treated as a command or special instruction (such as clear screen, position cursor,
etc.). When RS is high (1), the data being sent is text data which should be displayed
on the screen. For example, to display the letter "T" on the screen we would set RS
high.
The RW line is the "Read/Write" control line. When RW is low (0), the
information on the data bus is being written to the LCD. When RW is high (1), the
program is effectively querying (or reading) the LCD. Only one instruction ("Get
LCD status") is a read command. All others are write commands--so RW will almost
always be low.
Schematic:
41
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Figure 22 : Schematic
Circuit Description:
Above is the quite simple schematic. The LCD panel's Enable and Register
Select is connected to the Control Port. The Control Port is an open collector / open
drain output. While most Parallel Ports have internal pull-up resistors, there is a few
which don't. Therefore by incorporating the two 10K external pull up resistors, the
circuit is more portable for a wider range of computers, some of which may have no
internal pull up resistors.
We make no effort to place the Data bus into reverse direction. Therefore
we hard wire the R/W line of the LCD panel, into write mode. This will cause no bus
conflicts on the data lines. As a result we cannot read back the LCD's internal Busy
Flag which tells us if the LCD has accepted and finished processing the last
instruction. This problem is overcome by inserting known delays into our program.
The 10k Potentiometer controls the contrast of the LCD panel. Nothing
fancy here. As with all the examples, I've left the power supply out. We can use a
bench power supply set to 5v or use an onboard +5 regulator. Remember a few de-
coupling capacitors, especially if we have trouble with the circuit working properly.
SETB RW
As we mentioned above, the EN line is used to tell the LCD that we are ready
for it to execute an instruction that we've prepared on the data bus and on the other
control lines. Note that the EN line must be raised/ lowered before/after each
instruction sent to the LCD regardless of whether that instruction is read or write text
or instruction. In short, we must always manipulate EN when communicating with the
LCD. EN is the LCD's way of knowing that we are talking to it. If we don't
raise/lower EN, the LCD doesn't know we're talking to it on the other lines.
42
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Thus, before we interact in any way with the LCD we will always bring the EN
line low with the following instruction:
CLR EN
And once we've finished setting up our instruction with the other control lines
and data bus lines, we'll always bring this line high:
SETB EN
The line must be left high for the amount of time required by the LCD as
specified in its datasheet. This is normally on the order of about 250 nanoseconds, but
checks the datasheet. In the case of a typical microcontroller running at 12 MHz, an
instruction requires 1.08 microseconds to execute so the EN line can be brought low
the very next instruction. However, faster microcontrollers (such as the DS89C420
which executes an instruction in 90 nanoseconds given an 11.0592 MHz crystal) will
require a number of NOPs to create a delay while EN is held high. The number of
NOPs that must be inserted depends on the microcontroller we are using and the
crystal we have selected.
The instruction is executed by the LCD at the moment the EN line is brought
low with a final CLR EN instruction.
While it is possible to write code that waits for a specific amount of time to allow
the LCD to execute instructions, this method of "waiting" is not very flexible. If the
crystal frequency is changed, the software will need to be modified. A more robust
method of programming is to use the "Get LCD Status" command to determine
whether the LCD is still busy executing the last instruction received.
The "Get LCD Status" command will return to us two tidbits of information;
the information that is useful to us right now is found in DB7. In summary, when we
issue the "Get LCD Status" command the LCD will immediately raise DB7 if it's still
busy executing a command or lower DB7 to indicate that the LCD is no longer
occupied. Thus our program can query the LCD until DB7 goes low, indicating the
LCD is no longer busy. At that point we are free to continue and send the next
command.
Applications:
• Medical equipment
43
SMART AGRICULTURE MONITORING USING IoT PLATFORM
3.2.3.5 Buzzer
Figure 23 : Buzzer
44
SMART AGRICULTURE MONITORING USING IoT PLATFORM
The pin configuration of the buzzer is shown below. It includes two pins
namely positive and negative. The positive terminal of this is represented with the ‘+’
symbol or a longer terminal. This terminal is powered through 6Volts whereas the
negative terminal is represented with the ‘-‘symbol or short terminal and it is
connected to the GND terminal.
Specifications
• Color is black
• The frequency range is 3,300Hz
• Operating Temperature ranges from – 20° C to +60°C
• Operating voltage ranges from 3V to 24V DC
• The sound pressure level is 85dBA or 10cm
• The supply current is below 15mA
Types of Buzzer
• Piezoelectric
• Electromagnetic
• Mechanical
• Electromechanical
• Magnetic
Working Principle
The working principle of a buzzer depends on the theory that, once the voltage
is given across a piezoelectric material, then a pressure difference is produced. A
piezo type includes piezo crystals among two conductors.
Once a potential disparity is given across these crystals, then they thrust one
conductor & drag the additional conductor through their internal property. So this
continuous action will produce a sharp sound signal.
Advantages
• Simply Compatible
• Frequency Response is Good
45
SMART AGRICULTURE MONITORING USING IoT PLATFORM
• Size is small
• Energy Consumption is less
• The Range of Voltage usage is Large
• Sound Pressure is high
Disadvantages
Applications
• Communication Devices
• Electronics used in Automobiles
• Alarm Circuits
• Portable Devices
• Security Systems
• Timers
• Household Appliances
• Electronic Metronomes
• Sporting Events
• Annunciator Panels
• Game Shows
All digital circuits require regulated power supply. In this article we are going
to learn how to get a regulated positive supply from the mains supply.
230V Step
Step Rectifie Filter
Down
Down r
Transform
Transform Capacitor Regulato Output
er
er r
Regulate
d Ac
Figure 24 : Block diagram of a fixed Regulated Power Supply
46
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Transformer:
47
SMART AGRICULTURE MONITORING USING IoT PLATFORM
48
SMART AGRICULTURE MONITORING USING IoT PLATFORM
winding & provide connection to the center. So, during the positive half cycle diode D1
conducts & D2 is in reverse biased condition. During the negative half cycle diode D2
conducts & D1 is reverse biased. Thus, we get both the half cycles across the load.
One of the disadvantages of Full Wave Rectifier design is the necessity of using
a center tapped transformer, thus increasing the size & cost of the circuit. This can be
avoided by using the Full Wave Bridge Rectifier.
C) Bridge Rectifier:
As the name suggests it converts the full wave i.e. both the positive & the
negative half cycle into DC thus it is much more efficient than Half Wave Rectifier &
that too without using a center tapped transformer thus much more cost effective than
Full Wave Rectifier.
Full Bridge Wave Rectifier consists of four diodes namely D1, D2, D3 and D4.
During the positive half cycle diodes D1 & D4 conduct whereas in the negative half
cycle diodes D2 & D3 conduct thus the diodes keep switching the transformer
connections so we get positive half cycles in the output.
49
SMART AGRICULTURE MONITORING USING IoT PLATFORM
If we use a center tapped transformer for a bridge rectifier, we can get both
positive & negative half cycles which can thus be used for generating fixed positive &
fixed negative voltages.
Filter Capacitor:
Even though half wave & full wave rectifier give DC output, none of them
provides a constant output voltage. For this we require to smoothen the waveform
received from the rectifier. This can be done by using a capacitor at the output of the
rectifier this capacitor is also called as “FILTER CAPACITOR” or “SMOOTHING
CAPACITOR” or “RESERVOIR CAPACITOR”. Even after using this capacitor a
small amount of ripple will remain.
We place the Filter Capacitor at the output of the rectifier the capacitor will
charge to the peak voltage during each half cycle then will discharge its stored energy
slowly through the load while the rectified voltage drops to zero, thus trying to keep the
voltage as constant as possible.
50
SMART AGRICULTURE MONITORING USING IoT PLATFORM
If we go on increasing the value of the filter capacitor then the Ripple will
decrease. But then the costing will increase. The value of the Filter ca0pacitor depends
on the current consumed by the circuit, the frequency of the waveform & the accepted
ripple.
V𝑟 𝐹
𝑐=
𝐼
Where,
Vr= accepted ripple voltage. (should not be more than 10% of the voltage)
I= current consumed by the circuit in Amperes.
F= frequency of the waveform. A half wave rectifier has only one peak in one cycle so
F=25hz
Whereas a full wave rectifier has Two peaks in one cycle so F=100hz.
Voltage Regulator:
51
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Also called as Resistive Voltage regulator because they dissipate the excessive
voltage resistively as heat.
2) Switching Regulators.
They regulate the output voltage by switching the Current ON/OFF very
rapidly. Since their output is either ON or OFF it dissipates very low power thus
achieving higher efficiency as compared to linear voltage regulators. But they are more
complex & generate high noise due to their switching action. For low level of output
power switching regulators tend to be costly but for higher output wattage they are
much cheaper than linear regulators.
The most commonly available Linear Positive Voltage Regulators are the 78XX
series where the XX indicates the output voltage. And 79XX series is for Negative
Voltage Regulators.
After filtering the rectifier output the signal is given to a voltage regulator. The
maximum input voltage that can be applied at the input is 35V.Normally there is a 2-3
Volts drop across the regulator so the input voltage should be at least 2-3 Volts higher
than the output voltage. If the input voltage gets below the Vin of the regulator due to
the ripple voltage or due to any other reason the voltage regulator will not be able to
produce the correct regulated voltage.
IC 7805:
52
SMART AGRICULTURE MONITORING USING IoT PLATFORM
The 7805 will automatically reduce output current if it gets too hot. The last two
digits represent the voltage; for instance, the 7812 is a 12-volt regulator. The 78xx series
of regulators is designed to work in complement with the 79xx series of negative
voltage regulators in systems that provide both positive and negative regulated voltages,
since the 78xx series can't regulate negative voltages in such a system.
The 7805 & 78 is one of the most common and well-known of the 78xx series
regulators, as it's small component count and medium-power regulated 5V make it
useful for powering TTL devices.
SPECIFICATIONS IC7805
VOUT 5V
OUTPUT IMAX 1A
53
SMART AGRICULTURE MONITORING USING IoT PLATFORM
inexpensive in volume, attracted many hackers to explore the module, the chip, and
the software on it, as well as to translate the Chinese documentation.
The ESP8285 is an ESP8266 with 1 MiB of built-in flash, allowing the
building of single-chip devices capable of connecting to Wi-Fi.
• Processor: L106 32-bit RISC microprocessor core based on
the Tensilica Xtensa Diamond Standard 106Micro running at 80 MHz[5]
• Memory:
o 32 KiB instruction RAM
o 32 KiB instruction cache RAM
o 80 KiB user-data RAM
o 16 KiB ETS system-data RAM
• External QSPI flash: up to 16 MiB is supported (512 KiB to 4 MiB typically
included)
• IEEE 802.11 b/g/n Wi-Fi
o Integrated TR switch, balun, LNA, power amplifier and matching
network
o WEP or WPA/WPA2 authentication, or open networks
• 16 GPIO pins
• SPI
OPERATIONS:
54
SMART AGRICULTURE MONITORING USING IoT PLATFORM
55
SMART AGRICULTURE MONITORING USING IoT PLATFORM
56
SMART AGRICULTURE MONITORING USING IoT PLATFORM
CHAPTER 4 – DESIGN
4.1 INTRODUCTION
The design phase organizes the technical and structural aspects of the system,
translating requirements into a practical blueprint for implementation. This phase
includes diagrams such as DFD, ER, and UML, which provide a visual understanding
of the system architecture and relationships between different components. A modular
approach ensures that each part of the system can function independently while
contributing to the overall functionality.
• Data Flow Diagram (DFD): Shows how data moves from sensors to the
Arduino and then to the ThingSpeak cloud platform, mapping each interaction
and data transformation.
• Entity-Relationship (ER) Diagram: Defines relationships between system
entities, such as sensors, the cloud platform, and the user interface.
• UML Diagrams: These diagrams describe the system's functional
components and illustrate the interactions between different modules,
establishing the logical organization of the system
RPS LCD
Arduino
Soil Moisture uno Buzzer
Sensor Controller
Wifi Module
DHT11
Server
57
SMART AGRICULTURE MONITORING USING IoT PLATFORM
BUZ1
BUZZER SOIL1
SOIL MOISTURE
ON
80
27
Reset BTN
www.TheEngineeringProjects.com
%RH
AREF
- +
DATA
13
GND
VDD
PB5/SCK
12
PB4/MISO
RESET 11
58
~ PB3/MOSI/OC2A
10
1
2
4
~ PB2/OC1B
9
~ PB1/OC1A
8
PB0/ICP1/CLKO
Test
ATMEGA328P-PU
1121
7
ANALOG IN
PD7/AIN1
6 www.TheEngineeringProjects.com
LCD2 A0
PC0/ADC0
~ PD7/AIN1
5 Vcc GND A0
A1 ~ PD5/T1/OC0B
4
PC1/ADC1
A2 PD4/T0/XCK
3
PC2/ADC2
A3 ~ PD3/INT1/OC2B
2
PC3/ADC3 PD2/INT0
A4 1
PC4/ADC4/SDA PD1/TXD
A5 0
PC5/ADC5/SCL PD0/RXD
ARDUINO UNO
VSS
7
VDD
VEE
U2
!RST
CH_PD
RS
RW ESP01
E
D0
D1
GPIO2
GPIO0
GND
RXD
VCC
D2
TXD
D3
D4
D5
8
D6
by TEP D7
LCD 16X2 V2
SMART AGRICULTURE MONITORING USING IoT PLATFORM
5.1 INTRODUCTION
The system includes several key functions that work together to achieve
seamless agricultural monitoring and motor control. Each function is implemented
with precision to ensure reliable performance. Below is an explanation of the critical
functions:
• Sensors like the DHT11 and soil moisture sensor continuously monitor
environmental parameters such as temperature, humidity, and soil moisture
levels.
• A GSM module enables remote control of the irrigation motor. The farmer
sends an SMS command to the system, which processes it and performs the
requested operation, such as turning the motor on or off.
• The processed data from sensors is uploaded to the ThingSpeak IoT platform
in real time. This allows farmers to monitor trends and historical data through
visual dashboards.
59
SMART AGRICULTURE MONITORING USING IoT PLATFORM
• Notifications are sent to the farmer via SMS if critical thresholds are breached,
such as low soil moisture levels or extreme environmental conditions.
5.3.1 Forms
Hardware Setup
1. Component Assembly:
• The DHT11, soil moisture sensor, and GSM module were connected to the
Arduino Uno R3.
60
SMART AGRICULTURE MONITORING USING IoT PLATFORM
2. Power Supply:
Software Setup
1. Arduino IDE:
• The Arduino was programmed using the Arduino IDE, employing libraries for
sensors and GSM communication.
• Custom logic was written to read sensor data, control the motor, and send
SMS alerts.
2. ThingSpeak Integration:
• The ThingSpeak API was configured to receive data from the system, creating
real-time visual dashboards for analysis.
3. Source Code
61
SMART AGRICULTURE MONITORING USING IoT PLATFORM
#include<LiquidCrystal.h>
#include<DFRobot_DHT11.h>
DFRobot_DHT11 DHT;
#define DHT11_PIN A4
int buzzer = 7;
int x;
void setup()
Serial.begin(115200);
lcd.begin(16,2);
wifi_init();
lcd.setCursor(0,0);
lcd.print("SMART AGRICULTURE");
delay(1000);
pinMode(mois,INPUT);
pinMode(buzzer, OUTPUT);
digitalWrite(buzzer, HIGH);
DHT.read(DHT11_PIN);
int t=DHT.temperature;
int h=DHT.humidity;
62
SMART AGRICULTURE MONITORING USING IoT PLATFORM
x=digitalRead(mois);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("TEMP:");
lcd.setCursor(5,0);
lcd.print(t);
lcd.setCursor(9,0);
lcd.print("HUM:");
lcd.setCursor(13,0);
lcd.print(h);
if(t>38)
digitalWrite(buzzer, LOW);
if(t<38)
digitalWrite(buzzer, HIGH);
if(x==LOW)
lcd.setCursor(0,1);
lcd.print("Mois:YES");
digitalWrite(buzzer,HIGH);
else
63
SMART AGRICULTURE MONITORING USING IoT PLATFORM
lcd.setCursor(0,1);
lcd.print("Mois:NO");
digitalWrite(buzzer,LOW);
delay(1000);
upload_iot(t,h,x);
delay(1000);
void wifi_init()
Serial.println("AT+RST");
delay(2000);
Serial.println("AT+CWMODE=1");
delay(2000);
Serial.print("AT+CWJAP=");
Serial.write('"');
Serial.print("Kanna");
Serial.write('"');
Serial.write(',');
Serial.write('"');
Serial.print("Hello MotO");
Serial.write('"');
Serial.println();
delay(1000);
64
SMART AGRICULTURE MONITORING USING IoT PLATFORM
cmd += "184.106.153.149";
cmd += "\",80";
Serial.println(cmd);
delay(1500);
getStr += String(x);
getStr +="&field2=";
getStr += String(y);
getStr +="&field3=";
getStr += String(z);
getStr += "\r\n\r\n";
cmd = "AT+CIPSEND=";
cmd += String(getStr.length());
Serial.println(cmd);
delay(1500);
Serial.println(getStr);
delay(1500);
65
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Deployment
LCD Display:
• Displays alcohol level and pulse rate in real-time.
• Output :
66
SMART AGRICULTURE MONITORING USING IoT PLATFORM
ThingSpeak Dashboard:
67
SMART AGRICULTURE MONITORING USING IoT PLATFORM
The system was tested under various conditions to evaluate its performance:
68
SMART AGRICULTURE MONITORING USING IoT PLATFORM
• Reliability: The GSM module performed well in areas with good network
coverage, successfully transmitting SMS commands and notifications.
• Response Time: The average time to execute a remote motor control
command was measured to be 5 seconds.
• Usability: Farmers found the SMS interface easy to use and appreciated the
simplicity of notifications.
Key Observations:
69
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Testing and validation are critical steps in the development lifecycle of the
"Smart Agriculture Monitoring using IoT" project. This phase ensures that the system
meets all specified requirements and performs as expected under different scenarios.
The objective is to identify any potential issues, verify data accuracy, and ensure the
robustness of the system. Testing validates each component, including sensors, data
processing, cloud connectivity, and alert mechanisms, ensuring reliable operation.
The testing process involves the design of test cases, which define specific
scenarios to verify system functionality. Key test cases for this project include:
• User Interface and Cloud Dashboard Testing: Tests ensure that data
visualizations on the ThingSpeak dashboard are accurate and easy to interpret.
Additionally, testing checks that users can access and navigate the interface
without technical difficulties.
• Hardware Durability
o Test Case: Components were subjected to prolonged operation and
environmental conditions (e.g., temperature variations).
o Expected Outcome: The system should maintain consistent performance
without hardware failure.
70
SMART AGRICULTURE MONITORING USING IoT PLATFORM
6.3 Validation
Validation ensures that the system meets the intended design objectives, providing
reliable, accurate, and actionable data for agricultural management. Validation checks
include:
71
SMART AGRICULTURE MONITORING USING IoT PLATFORM
Conclusion
This project has met its goals of designing an efficient, scalable, and easy-to-use
agricultural monitoring system. It supports optimal decision-making by providing
actionable data on soil and environmental conditions, helping farmers prevent water
wastage and reduce crop loss. The real-time alert mechanism ensures timely responses
to environmental changes, further protecting crops and maximizing yield.
Future Enhancements
While the system has achieved its core objectives, there are several opportunities
for future enhancements to improve functionality and scalability:
72
SMART AGRICULTURE MONITORING USING IoT PLATFORM
The "Smart Agriculture Monitoring using IoT" system holds promise for advancing
agricultural practices, and these future enhancements would further broaden its
applications, contributing to a more sustainable, technology-driven approach to
farming.
REFERENCES
73
SMART AGRICULTURE MONITORING USING IoT PLATFORM
74