Akash Final Agrii
Akash Final Agrii
Akash Final Agrii
BACHELOR OF ENGINEERING
In
AKASH K R [19CSE002]
CERTIFICATE
This is to Certify that the project work Phase-2 report entitled “AN AUTOMATED
IRRIGATION SYSYEM FOR AGRICULTURE USING IOT” has been successfully
carried out by AKASH K R [19CSE002] bonafide students of BGS Institute of Technology
in partial fulfilment of the requirements of Degree of Bachelor of Engineering
Computer Science & Engineering of Adichunchanagiri University, B G Nagara during
the academic year 2022-23. It is certified that all corrections/suggestions indicated for the
internal assessment have been incorporated in the report deposited in the Department library.
The project report has been approved as it satisfies the academic requirements with respect to
the project work prescribed for Bachelor of Engineering Degree.
External Viva
1. ..................................... ......................................
2. ..................................... .......................................
ACKNOWLEDGEMENT
I sincerely convey our regards and thanks to Dr. B K Narendra, Principal, BGSIT, BG
Nagar, Nagamangala Taluk, Mandya District, for giving us a chance to carry out and
present our Project Work phase-2.
I heartfelt gratitude to all the teaching and non-teaching faculties of Computer Science
and Engineering Department, BGSIT, BG Nagara, Nagamangala [T], Mandya [D],
fortheir support and guidance towards the completion of our Project Work phase-2
Finally, I would also extend our heartfelt thanks to our family members, classmates, friends
and well-wishers for their support and encouragement throughout this effort.
AKASH K R [19CSE002]
ABSTRACT
Water scarcity and inefficient irrigation practices pose significant challenges to the agriculture
industry. This abstract presents an overview of a smart irrigation system for agriculture that
leverages the Internet of Things (IoT) technology to optimize water management, increase crop
production, and promote sustainable agricultural practices. The proposed IoT-based smart irrigation
system integrates a network of sensors, actuators, and communication devices to monitor and
control irrigation processes. Soil moisture sensors, weather sensors, and plant health sensors are
strategically placed in the field to collect real-time data on soil moisture levels, temperature,
humidity, rainfall, and crop conditions. This data is transmitted wirelessly to a central hub or cloud-
based platform for analysis and decision-making. The system utilizes advanced analytics
techniques and machine learning algorithms to process the collected sensor data. Based on crop-
specific water requirements, historical data, and weather forecasts, the system intelligently
determines the optimal irrigation schedule and volume. Automated actuators, such as valves or drip
irrigation systems, are then activated to deliver precise amounts of water to the crops, ensuring they
receive the right amount of moisture at the right time.
Key Words : Agriculture, IoT, Sensors, Weather Fore casts.
i
CONTENTS
ACKNOWLEDGEMENT
i
ABSTRACT
ii-iii
CONTENTS
iv
LIST OF FIGURES
LIST OF TABLES v
CHAPTER 1: INTRODUCTION 1 - 10
1.1 Overview 2
ii
5.1 System Analysis 22
CONCLUTION 57
REFRENCES 58
iii
LIST OF FIGURE
iv
Figure 8.2 Working Model ........................................................................................... 49
v
LIST OF TABLE
vi
An Automated Smart Irrigation For Agriculture Using IoT 2022-23
CHAPTER 1
INTRODUCTION
Rainfall in Karnataka is variable across the state and fluctuates by year. During dry periods,
irrigation may be needed to preserve landscape quality. Over- or under-irrigating a landscape
can possibly increase disease incidence, waste water and decrease overall landscape condition.
Irrigation system efficiency is dependent upon several factors including design, installation and
specific site conditions. Water applied to a landscape can account for a significant portion of a
property’s water use. In Oklahoma, outdoor water uses accounts for approximately 30 percent
to 50 percent of household water use. A substantial amount ofwater is lost to evaporation,
wind and runoff as a consequence of improper watering methods. Reducing or eliminating
this loss decreases utility bills and creates a more water efficient, healthy landscape. Outdoor
water savings can be achieved using smart irrigation technologies. Smart irrigation controllers
and sensors have been developed to reduce outdoor water use by irrigating based on plant water
need compared to traditional automatic system timers, which irrigate on a user-determined
fixed schedule. This technology exists as acomplete controller or as a sensor that can be added
to an existing irrigation timer to create a smart controller. Smart irrigation technology uses
weather data or soil moisture data to determine the irrigation need of the landscape. Smart
irrigation technology includes:
These products maximize irrigation efficiency by reducing water waste, while maintaining
plant health and quality. Incorporating smart irrigation technology in the landscape can
potentially reduce outdoor water consumption. This technology is appropriate for small,
residential landscapes as well as large, managed landscapes. The following sections describe
how each product functions and the advantages and disadvantages of each product. Irrigation
managers and homeowners should be aware that smart irrigation technology will need to be
periodically adjusted and maintained for maximum water savings. Soil moisture sensors can be
connected to an existing irrigation system controller. The sensor measures the soil moisture
content in the root zone before a scheduled irrigation event and bypasses the cycle if the soil
moisture is above a specific threshold. Different types of soil moisture sensors are available
and the consumer should ensure system compatibility before purchasing a sensor.
1.1 Overview
Agriculture will continue to be an important source of economy for many countries and
in near future smart agriculture will change the country's agricultural landscape. IoT
technologies will enable farmers to view and manage their farms remotely and at the same time
big scale agriculture farms could easily be implemented and monitored precisely. IoT sensors
help to measure soil quality, weather conditions, moisture level, and finally optimize these
parameters to increase the yield. Irrigation is the artificial application of water to the soil. It is
used in agricultural production where there is insufficient water at the right time for crop
production and can also be needed where the particular crop is out of its natural range. There
are potential risks associated with irrigation. Drip irrigation is sometimes called trickle
irrigation and involves dripping water onto the soil at very low rates (2-20 litres/hour) from a
system of small diameter plastic pipes fitted with outlets called emitters or drippers.
➢ Tensiometer:
A resistive soil moisture sensor uses the resistance changes (relationship betweenwater
content and electrical resistance) to measure the soil moisture content. They have two probes
that dip into the soil sample, one for discharging an electrical current and the other for receiving
it.
➢ Water Pump:
A submersible pump works by pushing water to the ground surface through converting
kinetic and rotary energy into pressure energy. This is achieved by first pulling the water into
the pump’s intake. Here, the impeller rotation will push the liquid through the diffuser and from
there to the surface.
➢ IOT Platform:
NodeMCU is an open source platform based on ESP8266 which can connect objects
and let data transfer using the Wi-Fi protocol. In addition, by providing some of the most
important features of microcontrollers such as GPIO, PWM, ADC, and etc, it can solve many
of the project's needs alone. The name "NodeMCU" combines "node" and "MCU" (micro-
controller unit). Strictly speaking, the term "NodeMCU" refers to the firmware rather than the
associated development kits. Both the firmware and prototyping board designs are open source.
The firmware uses the Lua scripting language.
➢ 5V Relay Model.
Fi
Fgure1.4 Relay Model
A 5V relay module is a type of electronic switch that uses a low voltage signal to operate
high voltage and high current circuits. It is intended to be simple to use and may be integrated
into a variety of electrical applications. The module is made up of a relay (an electromagnetic
switch) and a control circuit that is used to activate the relay. The 5V relay module takes its name
from the voltage needed to activate the relay. When 5V is given to the control circuit, the relay is
activated, enabling current to flow via the high voltage and high current circuit. The relay serves
as a link between the control and high voltage circuits, guaranteeing that the To ensure that the
control circuit is separated from the high voltage circuit, the relay.
➢ Connecting Wires
Figure1.5 Wires
Anyone who is interested in electronics or DIY projects has to be able to connect wires.
To make an uninterrupted electrical channel, connecting two or more wires together is necessary.
A loose or improperly connected wire might result in a short circuit or other electrical problems,
thus the quality of the connection is essential.
An Automated Irrigation System for Agriculture using IoT is a great idea for improving
the efficiency and effectiveness of irrigation in agriculture. Here are some components and
features that can be included in the system:
➢ Soil Moisture Sensors:
The system should include sensors that measure the moisture content of the soil. These
sensors can be placed at various locations throughout the farm to provide accurate and timely
data about the moisture levels.A soil mineral detector, also known as a soil mineral analyzer or
soil mineral spectrometer, is a device that measures the mineral content of soil. These detectors
work by using various techniques, such as electromagnetic radiation or X-ray fluorescence, to
identify and quantify the elements and minerals present in the soil.The device typically consists
of a handheld probe or sensor that is inserted into the soil, which then sends out a signal to detect
the various minerals present. The device can detect a range of minerals, including but not limited
to nitrogen, potassium, phosphorus, calcium, and magnesium. The readings from the detector can
be used to determine the nutrient levels in the soil, which is crucial information for agricultural
purposes.
➢ Rain sensors:
A rain sensor in smart irrigation is a device that helps conserve water by automatically
adjusting irrigation schedules based on rainfall. The sensor detects rainfall and sends a signal to
the irrigation controller to pause or delay watering, preventing overwatering and reducing water
waste.The rain sensor typically consists of a small cup-like device with a moisture-sensitive
switch inside. When it rains, the cup fills with water, and the switch is activated, sending a signal
to the irrigation controller. The controller then pauses irrigation for a set period of time, allowing
the rainwater to soak into the soil and reducing the need for additional watering.
Rain sensors are an essential component of smart irrigation systems, as they help conserve water
and reduce water waste. By using a rain sensor, smart irrigation systems can optimize irrigation
schedules based on real-time weather conditions, reducing water usage and improving plant
health.In addition to conserving water, rain sensors can also reduce labor costs associated with
manually adjusting irrigation schedules based on weather conditions. By automating this process,
farmers and landscapers can save time and money while still maintaining healthy plants.
➢ Gas Detect Sensors:
A gas detector sensor in smart irrigation systems is used to monitor the levels of various
gases, such as carbon dioxide and methane, in the soil or surrounding environment. These gases
can affect the growth and health of plants and can also indicate potential safety hazards, such as
gas leaks or underground fires.The gas detector sensor works by detecting the presence and
concentration of specific gases in the environment. It typically consists of a sensor element, which
can be made of various materials depending on the gas being detected, and an electronic circuit
that analyzes the sensor's output.In a smart irrigation system, the gas detector sensor can be used
to monitor the levels of gases in the soil and adjust the irrigation schedule accordingly. For
example, if the sensor detects high levels of carbon dioxide, it can trigger the irrigation system to
water the plants more frequently to increase oxygen levels in the soil.
➢ Mobile App:
1.
Figure 1.6 MOS Sensor
A mobile app can be developed to provide farmers with real-time information about the
irrigation system. This can include data about soil moisture levels, weather conditions, and the
status of the irrigation system. The app can also be used to make adjustments to the irrigation
schedule and duration.
➢ Threshold valve
A threshold valve sensor in smart irrigation is a device that helps regulate water flow and prevent
overwatering in irrigation systems. This sensor is designed to monitor the soil moisture level and
activate the valve to release water only when the soil is dry below a certain threshold.
• Briefly introduce the problem statement and motivation behind the project.
• Explain the significance and relevance of the smart irrigation system in the context of
modern agriculture.
• State the objectives and goals of the project.
2. Literature Review
• Provide an overview of the related work done in the field of IoT-based smart
irrigation systems.
• Discuss the advantages and limitations of existing systems.
• Identify the research gaps and opportunities for improvement.
3. Methodology
6. References
CHAPTER 2
LITERATURE SURVEY
2.1 SURVEY PAPERS
[1] Renewable Energy Integration Into Cloud & IoT-Based Smart Agriculture
Year: 2021.
Brief Introduction: Water is the basis and the main engine of life on earth. Humans use water
for industrial purposes, sanitation, and irrigation. In the last decades, the annual water
withdrawal ranged between 11 billion and 15 billion cubic meters per year, out of which 69
% is used in agriculture [1]. Unfortunately, most of this water is wasted because of inadequate
irrigation control systems. As in most arid and sub-Saharan countries, agriculture in Morocco
is the largest consumer of fresh water, especially after launching the Green Plan The associate
editor coordinating the review of this manuscript and approving it for publication was
EmrecanDemirors. Program in April 2008 [2]. This program aims to promoteagriculture as an
efficient sector capable of advancing the economy, fighting poverty, and preserving many
people in rural areas efficiently and sustainably. Within the framework of this program, the
government provided many facilities and assistance to farmers and investors in irrigated
agriculture to provide enough basic food for local consumption and export promotion
programs. However, the level of Smart Agriculture penetration in Morocco remains very low.
In addition, investors in the irrigated agricultural projects started sounding alarms of severe
depletion of groundwater on the horizon [3] and the lack of a cost-effective realtime data
collection in irrigation systems in farming fields.
Merits
This real-world prototype showed savings between 26% and 34% in water
consumption.
Efficiency is always improving so the same size solar that is available today will
become more efficient tomorrow.
Aesthetics are improving making the solar more versatile compared to older models.
Demerits
High initial costs for material and installation and long ROI
Needs lots of space as efficiency is not 100% yet.
[2] An Irrigation System That Uses Photovoltaic Solar Panel To Power System
Year: 2013
Brief Introduction: An irrigation system that uses photovoltaic solar panel to power system
because electric power supply would be expensive. For water saving purpose, an algorithm
developed with threshold value of temperature and soil moisture programmed into a micro
controller gateway. The system has a full duplex communication links based on internet cellular
interface using GPRS based on mobile data for graphically display and stored in a database
server. The automation irrigation system consists of two components were WSUand WIU.
Wireless Sensor Units (WSU) components were used for minimize power consumption
because microcontroller is well suited by its lower power current in sleep mode. Wireless
Information Unit (WIU) transmits soil moisture and temperature data to a webserver using
GPRS module. The WIU identify recorded and analyzed received temperature and soil
moisture data collected by WSU. WIU functionality is bases on microcontroller that
programmed to perform different task as to download the date and time information from web
server and compare the temperature and soil moisture value with maximum soil moistureand
minimum temperature value so that irrigated pumps activated.
Merits
Demerits
[3] Internet-of-Things (IoT)-Based Smart Agriculture: Toward Making the Fields Talk
Year: 2019
Brief Introduction: To improve the agricultural yield with fewer resources and labourefforts,
substantial innovations have been made throughout human history. Nevertheless, the high
population rate never let the demand and supply match during all these times. Accordingto the
forecasted figures, in 2050, the world population is expected to touch 9.8 billion, an increase
of approximately 25% from the current figure [1]. Almost the entire mentioned rise of
population is forecasted to occur among the developing countries [2]. On the other side, the
trend of urbanization is forecasted to continue at an accelerated pace, with about 70% of the
world’s population predicted to be urban until 2050 (currently 49%) [3]. Furthermore, income
levels will be multiples of what they are now, which will drive the food demand further,
especially in developing countries. As a result, these nations will be more careful about their
diet and food quality; hence, consumer preferences can move from wheat and grains to legumes
and, later, to meat. In order to feed this larger, more urban, and richer population, food
production should double by 2050 [4], [5]. Particularly, the current figure of
2.1 billion tons of annual cereal production should touch approximately 3 billion tons, and the
annual meat production should increase by more than 200 million tons to fulfil the demand of
470 million tons.
Merits
• It can reduce the overall expenditures.
• Easy to use and low cost, this technology is being utilized in many smart farming
applications.
Demerits
• Consumes high Power.
Year: 2021
Brief Introduction: IoT solutions are highly associated with cloud computing to process the
huge amount of heterogeneous data sent or received by agriculture sensors/actuators [4].
Although cloud computing can handle smart agriculture applications, some of theapplications
and services produce a large amount of data and need to be processed in a real- time manner,
which may cause a heavy load on the network, long response time, and poor quality of service,
due to limited bandwidth [5]. Therefore, using the traditional cloud-based architecture may not
be efficient to support these applications, which may also result in high energy consumption
due to the transfer of agriculture data to and from the cloud. The Information and
Communication Technology (ICT) industry is projected to account for 20% of the global
electricity demand by 2025 [5]–[8], [9]. Usually, consuming electricity is accompanied by
carbon emissions (CO2). fossil fuel usage is the primary source of CO2 [10]. Consequently, this
causes the growth of carbon dioxide emissions. According to [11], ICT uses 730 Million ton
(Mt) CO2 equivalents (CO2e) or 1.4% of worldwide carbon emissions.
Merits
Demerits
[5] A TDMA based MAC protocol used for collect data such as soil moisture and
temperature for optimum irrigation to save energy.
Year: 2011.
Brief Introduction: MAC protocol plays an important role to reduce energy consumption.
Two methods used for energy efficiency as Direct Communication method and aggregation
method. Direct Communication method provides collision free transmission of data, because
all the sensor nodes send data directly to the base station without the need of header node. This
method is better where the base station is near but it is not optimum where the base station is
far because sensor nodes consume more energy during transmission of data and if there is much
data to the sensor node, sensor nodes quickly damaged. The data aggregation method is better
to use rather than direct communication method. The sensor node senses the data and send to
the head node. The head node collects data from the entire sensor node, performs aggregation
using various aggregation techniques, and then sends data to the base station. Thus by using
aggregation method overall energy consumption reduce of the network. The simulation result
show that aggregation method provide better performance rather than direct communication
method. It provides 10% increase in residual energy and 13% increase in throughput. Sensor
nodes consume more energy while transmitting data.
Merits
Demerits
It is not an efficient method where the base station is far from base station.
Sensor nodes can be quickly damaged.
While big data could be of immense usage in the overall irrigation process, it is highly
vital to ensure effective management and control of the information. It has further been
explored that while the collected data from the sensors provide ample information that could
be used, the data analysis is critical to optimise the irrigation process in accordance with the
weather and crop conditions. Various organisations involved and related to the activity of
irrigation are rightly able to gather the required information, but they fail to properly assess the
data and deduce the useful outcomes out of it. This inability of analysis acts as a huge barrier
in improving work efficiency and lowering the related risks to the activities. Fig. 3 shows the
barriers of smart irrigation. Moreover, artificial intelligence (AI) is regarded as the technology
which is being used by most the organisations for varied purposes. Through the use of AI,
optimisation of available resources becomes more feasible along with gathering information
related to the crops such as diseases or corrected growth of plants. A related technique in this
to assess the collected data from the sensors to carry out the irrigationrelated activities is
fuzzy logic.
ensure optimum work efficiency. Some of the benefits that could be linked with machine
learning could therefore be regarded as water usage reduction, increased profits, and enhanced
crop yields. With lowering the risks related to irrigation through the use of machinelearning, it
may become more feasible to attain effective performance along with providing financial
benefits. There are various issues to agriculture field like crop diseases, lack of storage
management, pesticide control, weed management, lack of irrigation, and watermanagement
and all these issues can be resolved by using various artificial intelligence methods. Machine
learning improves the overall activities and processes related to irrigation through algorithms
and allow achieving the performance objectives.
The machine learning further supports predictions for irrigation patterns which are
mainly based on weather and crop scenarios. Predictions could be directly associated with the
usage of machine learning as it assists in taking measures and adopting strategies considering
the probable activities that may take in the future. These predictions therefore eventually allow
taking necessary measures which could support the irrigation process in the long run. Bannerjee
et al. classified AI breakthroughs and provided a quick summary of major AI techniques and
smart irrigation. Also, Chlingaryanetal demonstrated a machine learning expert system that
provides a flexible architecture for data driven decision making. Similarly, the development of
a sustainable precision irrigation system was demonstrated through the effective management
of sensed data about soil, plants, and weather. Correspondingly, Elavarasan et al. investigated
the integration of different machine learning models to find the optimal irrigation decision
management. The precision irrigation systems could be used to control the changing
environmental circumstances in an adaptive manner. Various machine learning applications
have been studied in literature, namely crop management, livestock management, water
management and soil management.
CHAPTER 3
Water is one of the essential elements of human existence. It is not always possible to get
water supply from natural sources. Here comes the application of irrigation supply.
Irrigation i the man-made means of supplying water.
1. Efficient use of water resources: The system should help optimize the use of water
resources by ensuring that the right amount of water is supplied to the plants at the right
time.
2. Reduced water waste: The system should minimize water waste by avoiding
overwatering or watering during rainy periods.
3. Improved crop yield and quality: The system should help improve crop yield and quality
by ensuring that the plants receive the appropriate amount of water and nutrients.
4. Remote monitoring and control: The system should enable remote monitoring and
control of the irrigation process, allowing farmers to monitor and adjust the system from
anywhere at any time.
5. Real-time data collection and analysis: The system should collect and analyze real-time
data on environmental conditions such as temperature, humidity, and soil moisture,
allowing for more accurate irrigation decisions.
6. Automation and energy efficiency: The system should automate the irrigation process,
reducing the need for manual labor and improving energy efficiency.
7. Scalability and adaptability: The system should be scalable and adaptable to different
types of crops, soil types, and irrigation methods.
1. Water conservation: By optimizing water usage and reducing water waste, the system
contribute to water conservation efforts, helping to reduce the strain on local water
resources.
2. Improved crop yield and quality: By ensuring that plants receive the appropriate amount
of water and nutrients, the system can improve crop yield and quality, leading to highe
profits for farmers.
3. Energy efficiency: By automating the irrigation process, the system can reduce the need
for manual labor and improve energy efficiency, resulting in cost savings for farmers.
4. Remote monitoring and control: The system enables farmers to monitor and adjust the
irrigation process remotely, providing them with greater control and flexibility over their
operations.
5. Data-driven decision-making: The system collects and analyzes real-time data on
environmental conditions, allowing farmers to make data-driven decisions about irrigation
management, resulting in more efficient and effective irrigation practices.
6. Scalability and adaptability: The system can be scaled and adapted to different types of
crops, soil types, and irrigation methods, providing farmers with a versatile tool that can
be customized to their specific needs.
CHAPTER 4
METHODOLOGY
Various sensors are deployed in the field like temperature sensor and moisture sensor. The data
collected from these sensors are connected to the microcontroller. In control section, the soil
moisture received data is verified with the threshold values. If the data exceeds the threshold
value the motor pump is switched ON and the status gets updates to blink server. The data is
sent to blink the farmer can monitor all the field details. In manual mode, the user has to switch
ON and OFF the motor by pressing the button in the Android Application (Blynk).
Overall, the methodology for developing an IoT-based smart irrigation system involves
a combination of hardware and software design, sensor deployment, data acquisition and
processing, control and actuation, and deployment and maintenance. The process is iterative,
with feedback from stakeholders used to refine the system at each stage of development.
This is done with the help of Wi-Fi. In automatic mode, the microcontroller gets
switchedON and OFF automatically if the value exceeds the threshold point the motor is get
supply voltage from 9V battery.
Start
Reading
Matches
Turn on/off pump
CHAPTER 5
1. Sensors: The sensors are deployed in the field to collect data on environmental conditions
such as temperature, humidity, and soil moisture. Different types of sensors may be used,
such as temperature sensors, humidity sensors, soil moisture sensors, and rain sensors.
2. Microcontrollers: The microcontrollers are used to interface with the sensors and send data
to the central server. Popular microcontrollers used in IoT applications include Arduino and
Raspberry Pi.
4. Cloud-based server: The cloud-based server is used to store and process the sensor data.
Cloud platforms such as AWS or Azure provide scalable and reliable solutions for data
storage and processing.
5. Data analytics and visualization: The data collected by the sensors is analyzed using data
analytics tools and presented to farmers in an intuitive and user-friendly interface, such as a
mobile app or a web-based dashboard.
6. Actuators: The actuators are used to control the irrigation process based on the data
collected by the sensors. Examples of actuators used in irrigation systems include solenoid
valves, pumps, and motors.
7. Control unit: The control unit is the brain of the system, responsible for processing the data
and sending commands to the actuators. The control unit may be located either on the cloud
server or on the microcontroller.
Networked Devices
These are the physical devices which include sensors, actuators, and transducers. These are the
actual devices that collect and send the data for processing. They are capable of receivingreal-
time data and they can convert the physical quantities into electrical signals which canbe
sent through a network.
Data Aggregation
It is a very important stage as it includes converting the raw data collected by sensors into
meaningful data which can be used to take actions. It also includes Data Acquisition Systems
and Internet Gateways. It converts the Analog signals provided by sensors into digitalsignals.
Dept. Of CS&E BGSIT BG Nagar Page 23
An Automated Smart Irrigation For Agriculture Using IoT 2022-23
Final Analysis
This is a stage that includes edge IT analytics and the processing of data to make it more
efficient and fully capable of execution. It also includes managing and locating all the devices
correctly
Cloud Analysis
The final data is received here and analyzed closely and precisely in data centres. They process
and clean the data to make it free from any kind of errors and missing values. After this stage,
data is ready to be sent back and executed to perform operations.
Now let us see the basic fundamental architecture of IoT which consists of four stages as
Sensing Layer − the first stage of IoT includes sensors, devices, actuators etc. which collect
data from the physical environment, processes it and then sends it over the network.
• Network Layer − the second stage of the IoT consists of Network Gateways and Data
Acquisition Systems. DAS converts the analogue data (collected from Sensors) into
Digital Data. It also performs malware detection and data management.
• Data Processing Layer − The third stage of IoT is the most important stage. Here, data is
pre-processed on its variety and separated accordingly. After this, it is sent to Data Centres.
Here Edge IT comes into use.
• Application Layer − The fourth stage of IoT consists of Cloud/Data Centres where data
is managed and used by applications like agriculture, defence, health care etc.
A sequence diagram is a type of UML diagram that illustrates the interactions between
different components of a system over time. In the context of an IoT-based smart irrigation
system, a sequence diagram may show how the different components of the system interact with
each other to perform various tasks.
For example, a sequence diagram for the system may show the following interactions:
1. Sensor data collection: The sequence diagram may show how the sensors in the field
collect data on environmental conditions such as temperature, humidity, and soil moisture,
and transmit this data to the microcontroller.
2. Data processing and analysis: The sequence diagram may show how the microcontroller
processes the data received from the sensors and sends it to the cloud-based server for
storage and analysis.
3. Control and actuation: The sequence diagram may show how the cloud-based server
analyzes the data to determine the irrigation needs of the crops, and sends commands to
the actuators (such as solenoid valves or pumps) to control the water supply to the crops.
4. User interaction: The sequence diagram may show how the user (i.e., the farmer)
interacts with the system through a mobile app or web-based dashboard to view the
environmentalconditions and irrigation status of the crops, and to adjust the system setings
as needed.
TCP/IP is a common networking protocol suite used for communication over the
internet. It provides a reliable, standardized means of transmitting data between devices over
a network, including the Internet of Things (IoT) devices.
IoT devices are often designed to be controlled remotely, and TCP/IP provides an
excellent means of doing so. In order to control an IoT device using TCP/IP, you would typically
need to develop an application that communicates with the device over the network using the
appropriate protocols. This application could be run on a computer or mobile device and would
interact with the IoT device through a gateway or interface device. One common approach for
controlling IoT devices using TCP/IP is to use the HTTP protocol, which is part of the TCP/IP
suite. HTTP is the protocol used for transmitting web pages over the internet and is well-suited
for controlling IoT devices since it supports both request-response communication and secure
communication through the use of HTTPS. Another protocol that is commonly used for IoT
devices is the MQTT protocol, which is designed for machine-to-machine (M2M)
communication. MQTT is a lightweight protocol that can be used to send and receive data .
Chapter 6
IMPLEMENTATION
6.1 Methodology & Techniques:
1. Requirements analysis: This step involves identifying the requirements and goals
of the smart irrigation system, such as the environmental conditions to be monitored,
the crops to be irrigated, and the desired level of automation.
2. System design: Based on the requirements analysis, the system architecture is
designed, including the hardware components (sensors, microcontroller, actuators)
and the software components (cloud-based server, user interface, communication
protocol).
3. Hardware implementation: The sensors, microcontroller, and actuators are
installed and configured according to the system design. The power source and
communication protocol are also selected and implemented.
4. Software development: The cloud-based server, user interface, and data analysis
algorithms are developed according to the system design. The software components
are tested and integrated with the hardware components.
5. Testing and validation: The system is tested and validated to ensure that it meets
the requirements and goals of the project. This includes functional testing (verifying
that the system performs its intended functions), performance testing (measuring the
system's efficiency and accuracy), and security testing (ensuring that the system is
protected against unauthorized access or tampering).
6. Deployment and maintenance: Once the system has been tested and validated, it
can be deployed in the field. Ongoing maintenance and support are required to
ensure that the system operates reliably and efficiently over time.
The techniques used in implementing an IoT-based smart irrigation system
include:
1. Sensor technology: Various sensor technologies can be used to collect data on
environmental conditions, such as temperature, humidity, and soil moisture. The
selection of sensors depends on the specific requirements of the project.
2. Microcontroller programming: The microcontroller is responsible for collecting
and transmitting the sensor data, as well as controlling the actuators. Programming
languages such as C or Python can be used to develop the microcontroller firmware.
The Sensor Interface can be broken down into three main components: The LCD, the
microcontroller, and the sensors which it communicates with. The LCD and microcontroller
are essentially the support behind the sensors to collect, store, transfer and display data.
Designing more advanced sensors was beyond the scope of this project, so the LCD and
microcontroller became the areas of focus. The Sensor Interface was designed to accept a wide
variety of sensors, analog, digital, wired and IC. Any of the sensors can also be connected to
another Bluetooth module to allow a wide variety of wireless sensors to communicate with the
central Sensor Interface microcontroller.
ESP8266 is Wi-Fi enabled system on chip (SoC) module developed by Espressif system. It
is mostly used for development of IoT (Internet of Things) embedded applications.
• I²S (Inter-IC Sound) interfaces with DMA(Direct Memory Access) (sharing pins with
GPIO),
• UART (on dedicated pins, plus a transmit-only UART can be enabled on GPIO2), and
• It employs a 32-bit RISC CPU based on the TensilicaXtensa L106 running at 80 MHz
(or overclocked to 160 MHz). It has a 64 KB boot ROM, 64 KB instruction RAM.
• ESP-01 comes with 8 pins (2 GPIO pins) – PCB trace antenna. (shown in above figure)
GPIO0 & GPIO2: - General Purpose I/O Pins. These pins decide what mode (boot or normal)
the module starts up in. It also decides whether the TX/RX pins are used for Programming
the module or for serial I/O purpose.To program the module using UART, Connect GPIO0
to ground and GPIO2 to VCC or leave it open. To use UART for normal Serial I/O leave both
the pins open (neither VCC nor Ground).
Now let’s connect ESP8266 module to computer with RS232 standard serial port (using USB
to Serial converter in case of laptop) as shown in below figure.
Note that, to put ESP8266 in flash mode, make connections as per above figure (in between
ESP8266 and USB to Serial converter) and then only connect it to PC/laptop. Do not forget to
connect GPIO0 pin to ground. Then click on START tab in ESP8266 DOWNLOAD TOOL,
and wait till it finishes. After finishing flash process, disconnect ESP8266 module from
PC/laptop and remove ground connection at GPIO0 pin. After successful downloading of
firmware, we can use below AT commands for server and client communication using
ESP8266.
III. Nodemcu:
The Internet of Things (IoT) has been a trending field in the world of technology. It has
changed the way we work. Physical objects and the digital world are connected now more
than ever. Keeping this in mind, Espressif Systems (A Shanghai-based Semiconductor
Company) has released an adorable, bite-sized WiFi enabled microcontroller – ESP8266, at
an unbelievable price! For less than $3, it can monitor and control things from anywhere in
the world – perfect for just about any IoT project.
ESP-12E Chip
There’s also 128 KB RAM and 4MB of Flash memory (for program and data storage) just
enough to cope with the large strings that make up web pages, JSON/XML data, and everything
we throw at IoT devices nowadays. The ESP8266 Integrates 802.11b/g/n HT40 Wi-Fi
transceiver, so it can not only connect to a WiFi network and interact with the Internet, but it
can also set up a network of its own, allowing other devices to connect directly to it. This makes
the ESP8266 NodeMCU even more versatile.
As the operating voltage range of ESP8266 is 3V to 3.6V, the board comes with a LDO
voltage regulator to keep the voltage steady at 3.3V. It can reliably supply up to 600mA,
Power to the ESP8266 NodeMCU is supplied via the on-board MicroB USB connector.
Alternatively, if you have a regulated 5V voltage source, the VIN pin can be used to directly
supply the ESP8266 and its peripherals.
#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <LiquidCrystal.h>
WiFiServer server(80);
int Relay1=15;
int Buzzer=4;
//#include<dht.h>
//#define dht_dpin 13
//#define trigPin 12
//#define echoPin 14
//long duration;
//int distance;
//dht DHT;
WiFiClient client;
void setup()
pinMode(Relay1,OUTPUT);
pinMode(Buzzer,OUTPUT);
// pinMode(Relay3,OUTPUT);
// pinMode(trigPin, OUTPUT);
// pinMode(echoPin, INPUT);
digitalWrite(Relay1,LOW);
digitalWrite(Buzzer,LOW);
// digitalWrite(Relay3,LOW);
Serial.begin(9600);
lcd.begin(16, 2);
lcd.clear();
lcd.print("Smart Irrigation..");
WiFi.begin(ssid, password);
delay(1000);
Serial.println("Connecting to WiFi...");
Serial.println("Connected to WiFi");
Serial.println(WiFi.localIP());
lcd.clear();
lcd.print(WiFi.localIP());
server.begin();
void loop()
if(client)
while (client.connected())
if (client.available())
Serial.println(request);
if(request=="A")
Serial.println("Pump 1 on");
client.print("Pump 1 On");
digitalWrite(Relay1,HIGH);
lcd.clear();
lcd.print("Pump On...");
delay(1000);
if(request=="B")
Serial.println("Pump 1 off");
client.print("Pump 1 Off");
digitalWrite(Relay1,LOW);
lcd.clear();
lcd.print("Pump Off...");
delay(1000);
int Rain_val=analogRead(36);
Rain_val=4095-Rain_val;
Serial.println("Rain:"+String( Rain_val));
lcd.clear();
lcd.print("Rain:");
lcd.print(Rain_val);
delay(2000);
if(Rain_val>1000)
Serial.println("Rain Detected");
client.print("Rain Detected");
lcd.clear();
lcd.print("Rain Detected..");
delay(1000);
//@@@@@@@@@@@@@@@@@@@@@@@@ Moisture
Sensor 1 @@@@@@@@@@@@@@@@@//
int Moist1_val=analogRead(39);
Moist1_val=4095-Moist1_val;
Serial.println("Moisture:"+String( Moist1_val));
client.print("Moisture:"+String( Moist1_val));
lcd.clear();
lcd.print("Moisture:");
lcd.print(Moist1_val);
delay(2000);
if(Moist1_val<200)
digitalWrite(Relay1,HIGH);
delay(2000);
if(Moist1_val>300)
digitalWrite(Relay1,LOW);
delay(2000);
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%% Soil
Moisture 2 %%%%%%%%%%%%%%%%%%%%%%%//
int Gas_val=analogRead(34);
Gas_val=4095-Gas_val;
Serial.println("GAS:"+String( Gas_val));
client.print("GAS:"+String( Gas_val));
lcd.clear();
lcd.print("Gas:");
lcd.print(Gas_val);
delay(2000);
if(Gas_val>3000)
Serial.println("Gas Detected");
client.print("Gas Detected");
lcd.clear();
lcd.print("Gas Detected");
Dept. Of CS&E BGSIT BG Nagar Page 40
An Automated Smart Irrigation For Agriculture Using IoT 2022-23
digitalWrite(Buzzer,HIGH);
delay(2000);
digitalWrite(Buzzer,LOW);
// if(Gas_val<500)
// {
// digitalWrite(Relay2,LOW);
// delay(2000);
// }
////**************************DHT11
HUMIDITY****************************//
//
// DHT.read11(dht_dpin);
// Serial.print("$Humidity: ");
// Serial.print(" %");
// Serial.print(" # ");
//
Dept. Of CS&E BGSIT BG Nagar Page 41
An Automated Smart Irrigation For Agriculture Using IoT 2022-23
// delay(2000);
//
// Serial.print("$Temperature:");
// Serial.print(" C");
// Serial.println(" # ");
//
// delay(2000);
//
// //************************** LDR
****************************//
// int LDR_val=analogRead(35);
// LDR_val=4095-LDR_val;
// Serial.println("LDR:"+String( LDR_val));
// delay(2000);
// if(LDR_val<1000)
// {
Dept. Of CS&E BGSIT BG Nagar Page 42
An Automated Smart Irrigation For Agriculture Using IoT 2022-23
// Serial.println("Cloudy Detected");
// client.print("Cloudy Detected");
// delay(2000);
// }
// if((LDR_val>1000)&&(LDR_val<2000))
// {
// delay(2000);
// }
// if((LDR_val>3000))
// {
// Serial.println("Sunny Detected");
// client.print("Sunny Detected");
// delay(2000);
// }
// digitalWrite(trigPin, LOW);
// delayMicroseconds(5);
Dept. Of CS&E BGSIT BG Nagar Page 43
An Automated Smart Irrigation For Agriculture Using IoT 2022-23
// digitalWrite(trigPin, HIGH);
// delayMicroseconds(10);
// digitalWrite(trigPin, LOW);
// Serial.print("Distance = ");
// Serial.print(distance);
// Serial.println(" cm");
// delay(2000);
// if(distance>30)
// {
// digitalWrite(Relay1,LOW);
// digitalWrite(Relay2,LOW);
Dept. Of CS&E BGSIT BG Nagar Page 44
An Automated Smart Irrigation For Agriculture Using IoT 2022-23
// delay(2000);
// }
// if((distance>15)&&(distance<25))
// {
// delay(2000);
// }
// if((distance<10))
// {
// delay(2000);
// }
// client.stop();
Serial.println("Client disconnected");
1. Initialization
• Read data from soil moisture sensors, temperature sensors, and humidity sensors.
3. Data Processing
• Calculate the average of the soil moisture, temperature, and humidity readings.
• Determine the moisture level of the soil based on the average soil moisture
reading.
• Check if the temperature and humidity readings are within the desired range.
4. Decision Making
• If the soil moisture level is below a certain threshold and the temperature and
humidityare within the desired range, turn on the irrigation process.
• If the soil moisture level is above a certain threshold, turn off the irrigation
process.
5. Irrigation Control
• Control the flow rate of water to ensure the soil is adequately irrigated.
6. Feedback
• Send feedback to the user on the status of the irrigation process and the current
sensor readings.
• Store the data for future analysis and optimization of the system.
Chapter 7
TESTING
7.1 Unit Testing
Smart irrigation systems utilize various test cases to ensure their proper
functionality and efficiency. one crucial aspect of testing is verifying the system's
ability to collect and process environmental data accurately. test cases typically
involve simulating different weather conditions and measuring the system's
response.
Chapter 8
RESULTS AND SNAPSHOTS
The model is intended for controlling and monitoring the environment. The node mcu serves
as a microcontroller that links the various sensors to a central processing unit, which then
issues instructions to the pump to respond appropriately the sensor.
The moisture sensor is probably used to gauge how moist the soil is. This is beneficial
for farming and gardening, as plants require a particular amount of moisture to develop
effectively.
The central processing unit may instruct the pump to water the plants appropriately using
the moisture sensor readings. The pump can be activated to deliver a precise amount of water
to replenish the soil's moisture level if it is too dry.
The pump can be operated to release a set amount of water to restore the desired range
of soil moisture.
The system's rain sensor is yet another crucial element. It can be used to determine when
it is raining, and the pump can then be switched off using this information. This is crucial since
watering plants in the rain can result in overwatering, which could harm the plants' ability to
thrive.
Data on rainfall patterns can be gathered using the rain sensor and utilized to forecast
weather patterns. The presence of gases in the environment can be determined using the gas
detector sensor. This can be helpful in environments like homes or workplaces where there is a
possibility of gas leakage.
A warning signal can be sent by the central processing unit to the user if the gas detection sensor
detects the presence of gas.
HTTP is the protocol used for transmitting web pages over the internet and is well-
suited for controlling IoT devices since it supports both request-response communication and
secure communication through the use of HTTPS. Another protocol that is commonly used
for IoT devices is the MQTT protocol, which is designed for machine-to-machine (M2M)
communication. MQTT is a lightweight protocol that can be used to send and receive data .
TCP/IP (Transmission Control Protocol/Internet Protocol) is a widely used network protocol
suite that forms the basis of communication on the internet. While TCP/IP is primarily
designed for transmitting data across networks, it can also be leveraged to control IoT (Internet
of Things) devices and gather information from them.
In the realm of IoT, TCP/IP can be employed to establish a connection between an
application and an IoT device. This allows the application to send commands and receive data
from the device, enabling control and monitoring functionalities. TCP/IP ensures reliable and
secure communication between the two entities. When an IoT device is connected to a TCP/IP
network, it is assigned an IP address, which serves as its unique identifier on the network. The
application can then use this IP address to establish a TCP connection with the IoT device To
control the IoT device, the application can send specific commands or instructions over the
TCP/IP connection. These commands can include actions such as turning the device on or off,
adjusting settings, or requesting sensor data. The IoT device receives these commands,
processes them, and sends a response back to the application.
Similarly, the IoT device can periodically send updates or data readings to the
application using the TCP/IP connection. This data can include information about the device's
status, sensor measurements, or any other relevant data collected by the device. By leveraging
TCP/IP for IoT device control and information retrieval, applications can interact with a wide
range of IoT devices seamlessly. This approach allows for centralized management and
monitoring of IoT deployments, enabling efficient control and data acquisition for various
applications and industries.
• TCP/IP Application for IoT Device Control
The rise of the Internet of Things (IoT) has revolutionized the way we interact with
everyday objects and devices. From smart homes to industrial automation, IoT devices
have become an integral part of our lives. One of the key components enabling the
seamless communication between these devices is the TCP/IP application layer
protocol suite.
The TCP/IP application layer provides a standardized set of protocols that allow IoT
devices to transmit and receive data over the internet. This layer is responsible for establishing
communication channels, managing data transfer, and ensuring reliable delivery between
devices. Let's explore how the TCP/IP application layer is used to control IoT devices and
exchange information. At the heart of IoT device control is the Hypertext Transfer Protocol
(HTTP), a protocol that enables the retrieval and manipulation of resources on the web. HTTP
operates on top of TCP/IP and allows IoT devices to communicate with servers, cloud
platforms, and other devices. By sending HTTP requests, IoT devices can access remote
resources and trigger specific actions. When an IoT device needs to send information to a server
or a cloud platform, it constructs an HTTP request message. This message typically includes a
method (e.g., GET, POST, PUT, DELETE) that specifies the desired action and a Uniform
Resource Identifier (URI) that identifies the target resource.
Additionally, the message may contain headers for authentication, content type, and
other metadata. The HTTP request is then sent over TCP/IP to the server. Upon receiving the
HTTP request, the server processes the message and returns an HTTP response. The response
contains a status code indicating the success or failure of the request and may also include a
response body with the requested data or additional instructions for the IoT device. The TCP/IP
application layer ensures the reliable delivery of the response back to the device. To illustrate
the control of IoT devices using TCP/IP, consider a smart home scenario. Suppose a user wants
to turn on the lights in their living room using a smartphone app. The app sends an HTTP
request to a cloud server, specifying the action to be taken (e.g., "POST /lights/on") and the
target device identifier. The server receives the request and verifies the user's credentials. Once
authenticated, the server generates an appropriate response and instructs the IoT hub to forward
the command to the specific light bulb in the living room.
The IoT hub uses TCP/IP to establish a connection with the light bulb and sends the
necessary control message. The light bulb receives the command, acknowledges it by sending
an HTTP response back to the hub, and proceeds to turn on the lights. The TCP/IP application
layer ensures that the HTTP requests and responses are transmitted reliably between the IoT
devices and the server, regardless of the underlying network infrastructure. It handles issues
such as data fragmentation, error detection, and retransmission to guarantee the integrity and
availability of the communication. Furthermore, the TCP/IP application layer supports various
other protocols that complement the IoT device control.
The Simple Network Management Protocol (SNMP) enables the monitoring and
management of network devices, while the Message Queuing Telemetry Transport (MQTT)
protocol provides lightweight publish-subscribe messaging for IoT applications with limited
bandwidth or power constraints.
In conclusion, the TCP/IP application layer plays a crucial role in controlling IoT
devices and facilitating the exchange of information. Through protocols like HTTP, it enables
seamless communication between IoT devices, servers, and cloud platforms. By leveraging
the power of TCP/IP, IoT applications can achieve reliable and secure device control, paving
the way for a more interconnected and intelligent world.
In summary, TCP/IP serves as a fundamental protocol for controlling and retrieving
information from IoT devices. It facilitates reliable and secure communication between
applications and IoT devices, enabling control functionalities and data exchange.
FUTURE ENHANCEMENT
Smart irrigation technology is still evolving, and there are several areas where future
enhancements could be made. One potential area of improvement is in the development of more
sophisticated sensors that can provide even more detailed data about soil moisture levels,
weather conditions, and plant water requirements. This could lead to even more precise and
efficient water management.Another area of improvement is the integration of smart irrigation
systems with other IoT devices, such as weather stations and soil moisture sensors. This could
enable even more automated and intelligent irrigation systems that can adjust watering
schedules based on real-time data.This system can be upgraded to real time monitoring using
cameras and also we can use machine leaning algorithms to detect disease in crops.
• Integration with weather forecasts: By incorporating weather data into the system, the
irrigation process could be adjusted based on predicted rainfall or changes in temperature
and humidity levels.
• Automated fertilization: In addition to controlling irrigation, the system could also
automatically apply fertilizers based on soil nutrient levels and plant needs.
• Enhanced data analysis and reporting: By incorporating machine learning and advanced
analytics, the system could provide more detailed insights into plant health and growth,
enabling farmers to make more informed decisions about their crops.
• Wireless sensor network: A wireless sensor network could be used to expand the coverage
area of the system, allowing farmers to monitor soil moisture levels and other environmental
factors across a larger area.
• Mobile application: A mobile application could be developed to enable farmers to monitor
and control the irrigation system remotely, providing greater flexibility and convenience.
• Integration with other farming systems: The irrigation system could be integrated with
other farming systems, such as crop monitoring or livestock management systems, to provide
a more comprehensive view of farming operations.
CONCLUSION
This project has been developed by integrated features of all the hardware components used.
Presence of every module has been reasoned out and placed carefully, thus contributing to the
best working of the unit. Thus, the Node Mcu Based Automatic Plant Watering System has
been designed and tested successfully. The system has been tested to function automatically.
The moisture sensors measure the moisture level (water content) of the different plants. If the
moisture level is goes to be below the desired and limited level, the moisture sensor sends the
signal to the Node Mcu board which triggers the Water Pump to turn ON.When the desired
moisture level is reached, the system halts on it’s own and the water Pump is turned OFF Thus
the “Automated Irrigation system based on soil moisture using Node Mcu” has been designed
and tested successfully.
REFERENCES
[1]. R. P. Eeramalla, K. Nagendramma, and S. S. Dara, "Smart Irrigation System using IoT
with Moisture Sensor," 2021 3rd International Conference on Communication and Signal
Processing (ICCSP), Chennai, India, 2021, pp. 719-723, doi:
10.1109/ICCSP51611.2021.9460734.
[2]. A. Shrivastava and R. Shukla, "Smart Irrigation System using IoT and Machine Learning
with Moisture Sensor," 2021 8th International Conference on Computing for Sustainable
Global Development (INDIACom), New Delhi, India, 2021, pp. 773-777, Doi:
10.1109/INDIACom52032.2021.9409549.
[3]. S. K. Sahu, S. K. Lenka and A. Panda, "Smart Irrigation System using Wireless Sensor
Network with Moisture Sensor," 2021 7th International Conference on Signal Processing and
Integrated Networks (SPIN), Noida, India, 2021, pp. 673-677, Doi:
10.1109/SPIN51464.2021.9409545.
[4]. D. R. Surya, K. Prabha, and R. S. Haripriya, "Smart Irrigation System using IoT and
Fuzzy Logic with Moisture Sensor," 2021 11th International Conference on Advances in
Computing, Communication and Control (ICAC3), Chennai, India, 2021, pp. 169-174, Doi:
10.1109/ICAC3-53622.2021.9509987.
[5]. Development of a low-cost temperature monitoring system based on the ESP32 module"
by A. B. de Almeida et al. (2021)
[6]. Design and implementation of a smart home automation system using ESP32" by A. N.
A. Aziz et al. (2021).
[7]. Evaluation of ESP8266 and ESP32 Microcontrollers for IoT Applications," by S. S. Pawar
et al., published in 2021.
[8]. Comparative Study of ESP32 and ESP8266 for Internet of Things Applications," by R.
A. Khan et al., published in 2021.
[9]. J. Anandhakumar and S. Ilango, "Smart Irrigation System Using IoT," in 2023
International Conference on Innovative Trends in Computer Science and Information
Technology (ITCSIT), 2023.
[10]S. Usha and K. Arumugam, "Smart Irrigation System for Precision Agriculture using
IoT," in International Conference on Computational Intelligence and Data Science (ICCIDS),
2022.