Smart Irrigation IoT System for Agriculture
Smart Irrigation IoT System for Agriculture
A PROJECT REPORT
Submitted by
[Link] (822621105004)
[Link] (822621105006)
[Link] (822621105301)
[Link] (822621105703)
of
BACHELOR OF ENGINEERING
IN
ESANOOR - 611103
MAY 2025
i
ANNA UNIVERSITY :: CHENNAI 600 025
BONAFIDE CERTIFICATE
SIGNATURE SIGNATURE
ii
ACKNOWLEDGEMENT
First and foremost we wish to thank the God for guiding using always to complete
the project successfully.
We would like to extend our heartfelt thanks to our beloved chairman of our college,
Dr. M. SULTHANUL ARIFEEN., who has given us an excellent opportunity to exhibit
our mode of creativity by this project.
We would like to avail this opportunity to express our gratitude and sincere thanks to
our Principal Dr. G. GIFTSON SAMUEL, M.E., Ph.D., MISTE., SMIEE., who has
provided all help in executing the project successfully.
Finally, we would like to use this opportunity to express our sincere thanks to our
parents and all teaching and non-teaching staff for providing all help for successful.
iii
DECLEARATION
I hereby declare that the work entitle “SMART IRRIGATION SYSTEM FOR
WATER MANAGEMENT IN AGRICULTURE USING IOT” submitted in partial
fulfilment of requirement for the award of degree in B.E., Anna University of technology
Chennai, is a record of my own work carried out by me during the academic year 2024-
2025 under the super vision guidance of Mrs. A. ANGATHA M.E., Assistant professor,
Department of Electrical and Electronics Engineering, Arifa Institute of Technology. The
extent and source of information are derived from the existing literature and have been
indicated through the dissertation at appropriate places. The matter embodied in this work
original and has not been submitted award of any other degree or diploma, in this or any
university.
SIGNATURE OF CANDIDATE
[Link]
(822621105703)
iv
ABSTRACT
This project presents the design and implementation of a sustainable smart irrigation
system aimed at improving water use efficiency and promoting environmentally conscious
agricultural practices. The system integrates a microcontroller with a suite of sensors,
including soil moisture, rainfall, temperature, and water level sensors, to facilitate real-
time, data-driven irrigation decisions. When soil moisture levels fall below a predefined
threshold, the system automatically activates a water pump to irrigate crops. Conversely,
the presence of rainfall is detected to inhibit unnecessary irrigation, thereby conserving
water.
By automating irrigation processes and minimizing water waste, this smart system offers
a cost-effective, eco-friendly solution that reduces manual labour, enhances crop
productivity, and supports long-term agricultural sustainability. It is especially beneficial
for regions facing water scarcity and those seeking precision farming solutions.
v
TABLE OF CONTENTS
ABSTRACT V
LIST OF ABBREVIATIONS Ix
1 INTRODUCTION 1
1.1 INTERNET OF THINGS 2
1.1.1 WORKING PROCESS 2
1.1.2 ADVANTAGES 3
1.1.3 ISSUSE 3
1.1.4 APPLICATION 4
1.2 EMBEDDED SYSTEM 4
2 LITERATURE SURVEY 7
3 EXISTING SYSTEM 12
4 PROPOSED SYSTEM 15
4.1 OBJECTIVES 17
4.2 ADVANTAGES 17
4.3 APPLICATION 18
4.4 BLOCK DIAGRAM 19
4.5 CIRCUIT DIAGRAM 20
5 SOFTWARE REQUIREMENT 21
5.1 ARDIUNO UNO 21
5.2 PROTUES 24
vi
6 HARDWARE REQUIREMENT
6.1 ARDIUNO UNO 28
6.2 POWER SUPPLY 29
6.3 DHT11 SENSOR 30
6.4 RAIN SENSOR 32
6.5 MOISTURE SENSOR 34
6.6 MOTOR DRIVER 36
6.7 WATER MOTOR 38
6.8 SERVO MOTOR 40
6.9 ULTROSONIC SENSOR 42
7 PROGRAM CODE 45
PROPOSED PROTOTYPE
8 HARDWARE 58
9 RESULT 59
10 CONCLUSION 62
10.1 FUTURE ENHANCEMENT 63
11 REFERENCES 64
vii
LIST OF FIGURE
FIGURE PAGE
NO TITLE NO
1.1 EXAMPLE OF AN IOT SYSTEM 2
1.2.1 EMBEDDED SYSTEM 6
BLOCK DIAGRAM OF PROPOSED
4.4.1 SYSTEM 19
CIRCUIT DIAGRAM OPF PROPOSED
4.5.1 SYSTEM 20
5.1.1 THE ARDIUNO UNO 21
EXAMPLE SIMULATTION OF
5.2.1 PROTUES SOFTWARE 27
6.1.1 ARDIUNO UNO 28
6.2.1 POWER SUPPLY 29
6.3.1 DHT11 SENSOR 30
6.4.1 RAIN SENSOR 32
6.5.1 MOISTURE SENSOR 34
6.6.1 MOTOR DRIVER 36
6.7.1 WATER MOTOR 38
6.8.1 SERVO MOTOR 40
6.9.1 ULTROSONIC SENSOR 42
8.1 PROPOSED PROTOTYPE HARDWARE 58
9.1 MOTOR STATUS 60
9.2 TEMPERATURE STATUS 60
9.3 MOISTURE STATUS 60
9.4 WATER LEVEL STATUS 61
9.5 RAIN STATUS 61
viii
LIST OF ABBREVIATION
ix
x
CHAPTER-1
INTRODUCTION
This project presents the design and implementation of a sustainable smart
irrigation system aimed at improving water use efficiency and promoting
environmentally conscious agricultural practices. The system integrates a
microcontroller with a suite of sensors, including soil moisture, rainfall,
temperature, and water level sensors, to facilitate real-time, data-driven irrigation
decisions. When soil moisture levels fall below a predefined threshold, the system
automatically activates a water pump to irrigate crops. Conversely, the presence of
rainfall is detected to inhibit unnecessary irrigation, thereby conserving water.
To address the risk of overwatering, the system incorporates a servo motor-
controlled drainage gate that opens to release excess water when potential
waterlogging is detected, safeguarding crop health. An IoT communication module
ensures seamless wireless transmission of environmental data to a cloud platform,
enabling farmers to remotely monitor field conditions and access historical data
analytics for better decision-making.
By automating irrigation processes and minimizing water waste, this smart system
offers a cost-effective, eco-friendly solution that reduces manual labour, enhances
crop productivity, and supports long-term agricultural sustainability. It is especially
beneficial for regions facing water scarcity and those seeking precision farming
solutions.
1
1.1 INTERNET OF THINGS
2
1.1.2 ADVANTAGES
1.1.3 ISSUES
The internet of things involves the usage of billions of data points and the
connection of billions of devices to the internet, all of which must be protected.
IoT security and privacy are important concerns due to its extended attack
surface. Mirai, a botnet that hacked domain name server provider Dyn and
brought down many websites for a long period of time in one of the largest
distributed denial-of-service (DDoS) assaults ever witnessed, was one of the
most prominent recent IoT attacks. Attackers acquired network access by
exploiting inadequately protected IoT devices.
Because IoT devices are so tightly linked, a hacker only has to exploit one
weakness to corrupt all of the data, rendering it useless. Manufacturers that fail
to update their gadgets on a regular basis, if at all, leave them open to hackers.
Furthermore, linked gadgets frequently prompt users to provide personal
information such as names, ages, residences, phone numbers, and even social
network accounts – information that hackers might exploit.
However, hackers aren't the only threat to the internet of things; IoT consumers
are also concerned about their privacy. Companies that manufacture and
distribute consumer IoT devices, for example, might utilize those devices to
collect and sell personal data from customers. Aside from exposing personal
data, IoT threatens key infrastructure such as power, transportation, and financial
services.
3
1.1.4 APPLICATIONS
The applications of the Internet of Things (IoT) are vast and diverse, as the
technology can be applied to various industries and use cases.
Some common applications of IoT include:
Smart homes: IoT devices can be used to automate and control various home
appliances and systems, such as lighting, heating, and security systems.
Healthcare: IoT devices can be used to monitor patient health and vital signs,
automate medication management, and improve patient outcomes.
Agriculture: IoT can be used to monitor soil moisture, temperature, and other
environmental factors to optimize crop yields and reduce water usage.
Smart cities: IoT can be used to optimize urban infrastructure, such as traffic
management, waste management, and energy usage.
4
Embedded systems are designed to be highly reliable and efficient, with minimal
power consumption and space requirements. They are often programmed using
low-level programming languages such as assembly language or C, which allows
for greater control over the hardware and ensures maximum performance.
Embedded systems play a crucial role in enabling the development of smart and
interconnected systems, which can improve efficiency, productivity, and safety
in various industries and applications.
An embedded system is a computer system designed to perform specific tasks
with dedicated functions within a larger mechanical or electrical system. It
consists of a combination of hardware and software that is designed to perform
a specific function or set of functions.
Embedded systems are typically used in real-time applications where fast and
predictable responses are required. They are often used in small and portable
devices, such as sensors, medical devices, communication systems, and
consumer electronics.
The hardware components of an embedded system include a microprocessor,
memory, input/output interfaces, and other peripheral devices. The software
components consist of the operating system, device drivers, and application-
specific software.
Embedded systems are designed to be reliable, efficient, and optimized for
specific applications. They are often programmed using low-level programming
languages such as assembly language or C, which provides greater control over
the hardware and ensures maximum performance.
Overall, embedded systems play a critical role in various industries and
applications, from controlling the operation of a vehicle to monitoring and
regulating the operation of industrial machines. They are essential in enabling
the development of smarter and more efficient systems.
Consumer electronics: Many of the electronic devices we use every day, such as
smartphones, smartwatches, digital cameras, and home appliances, contain
embedded systems that control their operations and functions.
Automotive industry: Embedded systems are used in cars and other vehicles to
control various systems, such as engine control, safety systems, and infotainment
systems.
5
Medical devices: Medical devices, such as pacemakers, insulin pumps, and
blood glucose monitors, use embedded systems to control their functions and
ensure accurate readings.
Military and defense: Embedded systems are used in military equipment and
weapons systems for various purposes, such as target tracking, guidance, and
communication.
6
CHAPTER 2
LITERATURE SURVEY
7
[Link] : IoT and Cloud Computing for Sustainable Energy Systems
AUTHOR: Rajagopalan et al.,
YEAR: 2024
DESCRIPTION : In their 2024 study, Rajagopalan et al. delve into the
transformative potential of integrating Internet of Things (IoT) technology and
cloud computing in optimizing energy distribution systems, particularly within
agricultural and rural environments. The authors explore how these advanced
technologies can improve the efficiency of energy management, promote
sustainability, and support the development of smarter agricultural
infrastructures. Their research emphasizes the advantages of remote monitoring,
real-time data processing, and predictive analytics to enhance energy efficiency
and optimize consumption patterns. By leveraging IoT-enabled sensors and
cloud computing platforms, Rajagopalan et al. suggest that energy distribution
systems can become more adaptive, scalable, and responsive, particularly in
rural areas with limited access to energy infrastructure. The integration of IoT
and cloud computing provides a powerful solution for addressing the challenges
faced by energy distribution systems in rural and agricultural regions.
Traditionally, energy management in these settings has been inefficient, with
limited access to real-time data and little ability to analyze energy consumption
patterns effectively. However, by utilizing IoT-enabled sensors that collect data
from various points within the energy grid and coupling this data with cloud-
based platforms, farmers and energy providers can gain significant insights into
energy use.
8
[Link] : Precision Agriculture and Smart Watering Systems
AUTHOR: Rabak et al
YEAR: 2023
DESCRIPTION : In their 2023 study, Rabak et al. introduce a smart watering
system that leverages Internet of Things (IoT) technology to optimize irrigation
practices in precision agriculture. The system is designed to monitor critical
environmental factors such as soil moisture, temperature, and other parameters
in real time, allowing for precise control over irrigation. The authors demonstrate
that by using IoT sensors, the system can ensure that crops receive only the
necessary amount of water, helping to conserve water resources, especially in
areas facing water scarcity. Additionally, the system’s ability to integrate weather
forecast data enhances irrigation decision-making, reducing water wastage and
promoting sustainable agricultural practices. This research underscores the
growing need for innovative solutions to address global water scarcity while
meeting the increasing demands of agriculture. The global agricultural sector is
facing mounting pressure due to the combined challenges of a growing
population, changing climate conditions, and diminishing water resources. Water
scarcity is particularly pressing in regions where agriculture plays a significant
role in the economy and food security. As water resources become more limited,
traditional irrigation practices that rely on fixed schedules or manual intervention
are becoming increasingly inefficient and unsustainable.
9
[Link] : Moroccan Groundwater Resources and Climate Change
AUTHOR: Hssaisoune et al.
YEAR: 2020
DESCRIPTION : Hssaisoune et al. (2020) investigate the pressing challenges
faced by Morocco in managing its groundwater resources, particularly in the
context of global climate change. The study highlights how shifting rainfall
patterns, rising temperatures, and the over-extraction of groundwater have placed
significant strain on the country’s water resources, particularly in the agricultural
sector. Groundwater plays a critical role in Morocco’s agriculture, as it is heavily
relied upon to sustain crops and meet irrigation demands, especially in arid and
semi-arid regions where surface water is limited. However, the unsustainable use
of this vital resource has raised concerns about the long-term availability of
groundwater, prompting the authors to recommend integrated water management
strategies to preserve and optimize groundwater use. The study focuses on
leveraging advanced technologies, such as groundwater sensors and remote
sensing, to monitor groundwater levels, as well as adopting efficient irrigation
systems to reduce water consumption and minimize the pressure on groundwater
resources. Morocco, like many other arid and semi-arid countries, is highly
vulnerable to the impacts of climate change, particularly with regard to water
scarcity. The country’s water resources, especially groundwater, are essential for
supporting its agricultural sector, which is a key component of the economy.
However, over-extraction and unsustainable use of groundwater have become
major concerns.
10
[Link] : IoT-Based Smart Farming for Sustainable Agriculture
AUTHOR: , Dhanaraju et al.
YEAR: 2022
DESCRIPTION : In their 2022 study, Dhanaraju et al. explore the
transformative potential of the Internet of Things (IoT) in promoting sustainable
agricultural practices. The paper highlights how IoT devices, such as soil
moisture sensors, temperature gauges, and crop health monitoring tools, can
provide farmers with real-time data that supports informed decision-making. The
integration of IoT technologies into agricultural systems promises significant
improvements in resource management, crop yield, and overall farm
productivity. By reducing the overuse of resources such as water, fertilizers, and
pesticides, IoT-based solutions aim to increase sustainability in agriculture,
contributing to long-term environmental and economic benefits. However, the
authors also identify certain challenges to the widespread adoption of IoT in
agriculture, such as high initial costs and limited internet connectivity in rural
areas. Despite these barriers, the study underscores the growing role of IoT in
modernizing agriculture and enhancing sustainability. Agriculture, which is
fundamental to global food production, is facing numerous challenges, including
growing environmental concerns, limited natural resources, and increasing
pressure to feed a growing global population. Traditional agricultural practices,
often characterized by inefficient resource use, excessive reliance on chemical
inputs, and water waste, are unsustainable in the long term.
11
CHAPTER 3
EXISTING SYSTEM
Manual Irrigation:
Manual irrigation remains one of the most commonly used methods in small-scale
and resource-constrained agricultural settings. In this system, farmers rely on basic
tools like hoses, buckets, or furrows to deliver water to crops. This approach
depends heavily on human labor and observation to estimate the water needs of
crops. While it has the advantage of being inexpensive in terms of initial setup, it is
highly inefficient and labor-intensive.
Water wastage is a significant drawback of manual irrigation, as over-irrigation
often occurs due to a lack of precise measurement tools. This not only depletes
scarce water resources but also leads to soil erosion, waterlogging, and nutrient
runoff. Additionally, manual irrigation is time-consuming, making it impractical for
large-scale farming operations. The inability to monitor soil moisture or
environmental conditions in real-time further reduces its effectiveness, often
resulting in inconsistent crop yields and reduced productivity.
12
Drip and Sprinkler Irrigation Systems:
Drip and sprinkler irrigation are considered more advanced methods for water
distribution, offering significant improvements in efficiency compared to manual
and timed systems. Drip irrigation involves delivering water directly to the root
zones of plants through a network of pipes and emitters, minimizing evaporation
and runoff. Sprinkler systems, on the other hand, distribute water uniformly across
a field, simulating natural rainfall.
While these systems are effective at conserving water and ensuring better coverage,
they come with their own set of challenges. Drip irrigation systems are expensive
to install and maintain, making them inaccessible to small and marginal farmers.
They also require regular maintenance to prevent clogging of emitters, especially
in areas with hard water or high sediment content. Sprinkler systems, although
versatile, can lose efficiency in windy conditions or areas with uneven topography.
Both systems lack integration with real-time environmental data, meaning they
cannot dynamically adjust water delivery based on actual crop needs or weather
patterns.
13
Challenges in Existing Systems
The proposed solution not only addresses the inefficiencies of current methods
but also aligns with the principles of sustainable farming. By integrating
environmental data, predictive analytics, and user-friendly interfaces, it empowers
farmers to make informed decisions and adapt to the dynamic challenges of modern
agriculture. This transition from traditional to smart irrigation systems represents a
critical step toward ensuring water security, improving agricultural outcomes, and
promoting global food sustainability.
14
CHAPTER 4
PROPOSED SYSTEM
The proposed system is a sustainable, smart irrigation solution that leverages
sensor-based automation and IoT integration to enhance water resource
management in agriculture. The system is designed to address the key challenges
faced by farmers, including inefficient irrigation, water wastage, overwatering, and
the absence of real-time monitoring, especially in water-scarce regions. By utilizing
a microcontroller-based architecture, the system enables intelligent decision-
making through continuous data acquisition and responsive actuation, resulting in
precise irrigation tailored to the crop and soil conditions.
At the core of the system is a microcontroller, which functions as the central
processing unit responsible for collecting data from multiple environmental
sensors, analyzing it, and triggering appropriate actions. The system includes a soil
moisture sensor, rainfall sensor, temperature sensor, and water level sensor. The soil
moisture sensor plays a pivotal role in determining the water content in the soil. It
constantly monitors the moisture level and compares it against a predefined
threshold specific to the crop requirement. When the moisture content falls below
this threshold, indicating that the soil is too dry for optimal plant growth, the system
activates an electric water pump to irrigate the field. This ensures that water is
delivered only when necessary, thus conserving resources and promoting efficient
usage.
The rainfall sensor complements this process by preventing unnecessary irrigation
during rainy conditions. When rain is detected, the system temporarily disables the
irrigation pump regardless of the soil moisture reading, thereby avoiding redundant
water application and ensuring smart water management. This coordination
between sensors minimizes manual intervention and makes the system adaptive to
real-world environmental changes.
In addition to irrigation control, the proposed system includes a water level sensor
placed in a reservoir or tank to monitor the availability of water. This ensures that
the system does not attempt to irrigate the field when the water source is depleted,
preventing dry-run damage to the pump and alerting the user to refill the water
supply. For crop protection against overwatering and potential waterlogging—
especially in areas with poor drainage—the system integrates a servo motor-
controlled drainage gate mechanism. When the soil moisture sensor detects levels
significantly higher than optimal, indicating excess water accumulation, the servo
motor is triggered to open a drainage gate. This gate safely redirects the surplus
water away from the crop root zone, preserving soil aeration and preventing plant
stress or root rot caused by excessive water retention.
15
A crucial feature of the proposed system is its IoT capability, which facilitates
remote monitoring and control. The system is equipped with an IoT module (such
as ESP8266 or ESP32), which collects all sensor data and transmits it to a cloud
platform. Farmers or agricultural administrators can access this real-time data from
any location using a web or mobile application interface. The cloud platform also
stores historical data, enabling users to analyze trends in soil moisture, rainfall
patterns, temperature fluctuations, and water usage over time. This analytical
capability allows farmers to make data-driven decisions regarding irrigation
scheduling, crop selection, and seasonal planning, thereby improving productivity
and sustainability.
The IoT interface also supports alert mechanisms. For example, the system can
notify users through SMS or app notifications if the water level is critically low, if
abnormal soil moisture levels are detected, or if the system is undergoing any
malfunction. Such proactive communication reduces the chances of human error
and enhances overall system reliability. The data visualization dashboard on the IoT
platform typically includes graphical representations of sensor values, operational
status of the pump and gate, and historical charts, making it intuitive even for users
with limited technical experience.
From a sustainability and cost-efficiency perspective, the system is designed with
low-power components and can be powered using renewable energy sources such
as solar panels, further minimizing operational costs and environmental impact. The
use of readily available components like Arduino-compatible boards, standard
sensors, and open-source IoT platforms ensures that the system remains affordable
and scalable, making it suitable for small and medium-scale farmers in developing
regions.
To summarize, the proposed smart irrigation system combines multiple sensing
technologies with intelligent control algorithms and wireless communication to
deliver a comprehensive solution for modern agriculture. It reduces dependency on
manual irrigation by automating water delivery based on actual soil and weather
conditions.
By preventing both under- and over-irrigation, it contributes to the efficient use of
water, a resource that is increasingly scarce in many parts of the world.
Additionally, the inclusion of a drainage control mechanism enhances the system’s
adaptability in regions with varying topography and unpredictable rainfall. With
IoT-enabled monitoring, the system empowers farmers to take timely, informed
actions that improve crop health and yield while conserving critical resources. This
smart, scalable, and sustainable approach to irrigation is well-aligned with the goals
of precision agriculture and offers a promising pathway toward ensuring food
security in an environmentally responsible manner.
16
4.1 OBJECTIVE
4.2 ADVANTAGE
Real-Time Monitoring
⦁ IoT module enables live tracking of environmental and system data via
mobile/web applications.
⦁ Users can access information anytime, anywhere.
Data Logging and Historical Analysis
⦁ Cloud storage allows farmers to review trends in moisture, temperature, and
rainfall.
⦁ Supports data-driven agricultural planning.
Automated Operation
⦁ Reduces need for manual labor and human intervention.
⦁ Enhances convenience and productivity.
Cost-Effective and Scalable
⦁ Built using affordable, easily available components like Arduino and standard
sensors.
17
4.3 APPLICATION
The proposed sustainable smart irrigation system finds its primary application in
modern agriculture, particularly in regions facing water scarcity or unpredictable
rainfall patterns. It is ideal for use in:
18
4.4 BLOCK DIAGRAM
EXPLANATION
19
4.5 CIRCUIT DIAGRAM
EXPLANATION
The circuit diagram for the smart irrigation system is designed around the
Arduino Uno microcontroller, which coordinates the operation of all sensors and
actuators. The soil moisture sensor is connected to analog pin A0, providing real-
time analog data on soil hydration. The rain sensor, which detects the presence of
rainfall, is connected to digital pin D2, allowing the system to halt irrigation during
precipitation. The ultrasonic sensor (HC-SR04) for monitoring water levels uses
digital pins D3 (Trig) and D4 (Echo). A temperature sensor (DHT11 or LM35) is
connected to analog pin A1 to supply ambient temperature data for environmental
awareness.
The relay module, which controls the water motor, is connected to digital pin D5.
When activated by the Arduino, the relay completes the motor circuit, starting the
irrigation process. A servo motor, used to open or close the water gate for draining
excess water, is connected to digital pin D6, with PWM control to position the gate
accurately.
For data display, an LCD (16x2) module is interfaced using an I2C module, which
connects to A4 (SDA) and A5 (SCL) pins, simplifying the wiring process. The IoT
module, such as an ESP8266, is connected via serial communication using digital
pins D7 (TX) and D8 (RX), enabling cloud connectivity for remote monitoring and
historical data analysis.
20
CHAPTER 5
SOFTWARE REQUIREMENT
Arduino boards are able to read inputs - light on a sensor, a finger on a button, or
a Twitter message - and turn it into an output - activating a motor, turning on an
LED, publishing something online. You can tell your board what to do by sending
a set of instructions to the microcontroller on the board
21
The bottom section of the IDE is dedicated to an output window that is used to
see the status of the compilation, how much memory has been used, any errors
that were found in the program, and various other useful messages.
Projects made using the Arduino are called sketches, and such sketches are usually
written in a cut-down version of C++ (a number of C++ features are not included).
Because programming a microcontroller is somewhat different from programming
a computer, there are a number of devicespecific libraries (e.g., changing pin
modes, output data on pins, reading analog values, and timers). This sometimes
confuses users who think Arduino is programmed in an “Arduino language.”
However, the Arduino is, in fact, programmed in C++. It just uses unique libraries
for the device.
The Arduino Integrated Development Environment - or Arduino Software (IDE) -
contains a text editor for writing code, a message area, a text console, a toolbar with
buttons for common functions and a series of menus. It connects to the Arduino and
Genuino hardware to upload programs and communicate with them.
Programs written using Arduino Software (IDE) are called sketches. These
sketches are written in the text editor and are saved with the file extension .ino.
The editor has features for cutting/pasting and for searching/replacing text. The
message area gives feedback while saving and exporting and also displays errors.
The console displays text output by the Arduino Software (IDE), including
complete error messages and other information. The bottom righthand corner of
the window displays the configured board and serial port. The toolbar buttons
allow you to verify and upload programs, create, open, and save sketches, and
open the serial monitor.
LIBRARIES
Libraries provide extra functionality for use in sketches, e.g. working with
hardware or manipulating data. To use a library in a sketch, select it from the
Sketch > Import Library menu. This will insert one or more #include statements
at the top of the sketch and compile the library with your sketch. Because libraries
are uploaded to the board with your sketch, they increase the amount of space it
takes up. If a sketch no longer needs a library, simply delete its #include statements
from the top of your code.
There is a list of libraries in the reference. Some libraries are included with the
Arduino software. Others can be downloaded from a variety of sources or through
the Library Manager. Starting with version 1.0.5 of the IDE, you do can import a
library from a zip file and use it in an open sketch.
22
CONNECTING THE ARDUINO
1. Plug in the USB cable - one end to the PC, and one end to the Arduino board.
2. When prompted, select "Browse my computer for driver" and then select the
3. You may receive an error that the board is not a Microsoft certified device - select
“Install anyway.”
When programming your Arduino board it is important to know what COM port
the Arduino is using on your PC. On Windows, navigate to Start->Devices and
Printers, and look for the Arduino. The COM port will be displayed underneath.
Alternatively, the message telling you that the Arduino has been connected
successfully in the lower-left hand corner of your screen usually specifies the COM
port is it using.
Before loading any code to your Arduino board, you must first open the IDE.
Double click the Arduino .exe file that you downloaded earlier. A blank program,
or "sketch," should open.
The Blink example is the easiest way to test any Arduino board. Within the
Arduino window, it can be found under File->Examples->Basics->Blink.
Before the code can be uploaded to your board, two important steps are required.
1. Select your Arduino from the list under Tools->Board. The standard board used
in RBE 1001, 2001, and 2002 is the Arduino Mega 2560, so select the "Arduino
Mega 2560 or Mega ADK" option in the dropdown.
23
LOADING CODE
The upper left of the Arduino window has two buttons: A checkmark to Verify
your code, and a right-facing arrow to Upload it. Press the right arrow button to
compile and upload the Blink example to your Arduino board.
The black bar at the bottom of the Arduino window is reserved for messages
indicating the success or failure of code uploading. A "Completed Successfully"
message should appear once the code is done uploading to your board. If an error
message appears instead, check that you selected the correct board and COM
port in the Tools menu, and check your physical connections.
If uploaded successfully, the LED on your board should blink on/off once every
second. Most Arduino boards have an LED prewired to pin 13.
I t is very important that you do not use pins 0 or 1 while loading code. It is
recommended that you do not use those pins ever.
Arduino code is loaded over a serial port to the controller. Older models use an
FTDI chip which deals with all the USB specifics. Newer models have either a
small AVR that mimics the FTDI chip or a built-in USB-to-serial port on the AVR
micro-controller itself.
5.2 PROTEUS
The Proteus Design Suite is a proprietary software tool suite used primarily for
electronic design automation. The software is used mainly by electronic design
engineers and technicians to create schematics and electronic prints for
manufacturing printed circuit boards.
Proteus is design software developed by Labcenter Electronics for electronic circuit
simulation, schematic capture and PCB design. Its simplicity and user friendly
design made it popular among electronics hobbyists. Proteus is commonly used for
digital simulations such as microcontrollers and microprocessors. It can simulate
LED, LDR, USB Communication.
24
About Proteus
It is a software suite containing schematic, simulation as well as PCB designing.
• ISIS is the software used to draw schematics and simulate the circuits in real
time. The simulation allows human access during run time, thus providing real time
simulation.
• ARES is used for PCB designing. It has the feature of viewing output in 3D
view of the designed PCB along with components.
• The designer can also develop 2D drawings for the product.
FEATURES
ISIS has wide range of components in its library. It has sources, signal generators,
measurement and analysis tools like oscilloscope, voltmeter, ammeter etc., probes
for real time monitoring of the parameters of the circuit, switches, displays, loads
like motors and lamps, discrete components like resistors, capacitors, inductors,
transformers, digital and analog Integrated circuits, semi-conductor switches,
relays, microcontrollers, processors, sensors etc.
ARES offers PCB designing up to 14 inner layers, with surface mount and
through hole packages. It is embedded with the foot prints of different category
of components like ICs, transistors, headers, connectors and other discrete
components. It offers Auto routing and manual routing options to the PCB
Designer. The schematic drawn in the ISIS can be directly transferred ARES.
HISTORY
The first version of what is now the Proteus Design Suite was called PC-B and
was written by the company chairman, John Jameson, for DOS in 1988. Schematic
Capture support followed in 1990, with a port to the Windows environment shortly
thereafter. Mixed mode SPICE Simulationwas first integrated into Proteus in 1996
and microcontroller simulation then arrived in Proteus in 1998. Shape based
autorouting was added in 2002 and 2006 saw another major product update with
3D Board Visualisation. More recently, a dedicated IDE for simulation was added
in 2011 and MCAD import/export was included in 2015. Support for high speed
design was added in 2017. Feature led product releases are typically biannual,
while maintenance based service packs are released as required.
25
PRODUCT MODULES
PCB Design
The PCB Layout module is automatically given connectivity information in the
form of a netlist from the schematic capture module. It applies this information,
together with the user specified design rules and various design automation tools,
to assist with error free board design. PCB's of up to 16 copper layers can be
produced with design size limited by product configuration.
26
PROTEUS SIMULATIONS
hardware. You can analyses your circuit and code both on Proteus and find the
errors encountering before implementing on hardware.
3. Reduces project cost and software dependency.
HARDWARE IMPLEMENTATION
28
6.2 POWER SUPPLY
The 7812 and 7805 voltage regulators are commonly used components to
provide stable DC voltage outputs of +12V and +5V, respectively, from a
higher input voltage source.
CIRCUIT CONSIDERATION:
Heat Dissipation: Both regulators can generate heat, especially when dropping
significant voltage. Adequate heat sinking may be necessary depending on the
current drawn and the input-output voltage differential.
Current Requirements: Ensure that the regulators can supply enough current
for your application. If higher currents are required, additional heat sinking and
possibly parallel regulators may be needed.
In summary, the 7812 and 7805 voltage regulators, along with capacitors like
C1000/25 and C10/63, form a basic yet effective setup for providing stable
+12V and +5V outputs in electronic circuits, suitable for a wide range of
applications from powering microcontrollers to analog circuits.
29
6.3 DHT11 SENSOR:
Features
30
Pin Configuration
Range(T): 0 to 50°C
Accuracy ±2°C
Accuracy: ±5% RH
Applications
31
6.4 RAIN SENSOR:
Key Features
32
Pin Configuration:
Analog Connection:
• Connect the VCC pin of the rain sensor module to the 5V pin on the
Arduino.
• Connect the GND pin of the rain sensor module to the GND pin on the
Arduino.
• Connect the AO (Analog Output) pin of the rain sensor module to an analog
input pin on the Arduino (e.g., A0).
Digital Connection:
• Connect the D0 (Digital Output) pin of the rain sensor module to a digital
input pin on the Arduino (e.g., pin 2).
Applications
33
6.5 MOISTURE SENSOR:
Key Features
34
Pin Configuration:
Applications
• Agriculture and Gardening: Ensures optimal soil moisture levels for crop
growth, improving yield and reducing water usage.
• DO (Digital Output) of the sensor to a digital input pin (e.g., D2) on the
Arduino for reading digital moisture levels (if available).
35
6.6 L293D MOTOR DRIVE:
The L293D motor driver IC (integrated circuit) used to control the direction
and speed of DC motors. It's commonly used in robotics, automation, and other
projects where precise motor control is required.
Functionality:
36
Features:
Pin Configuration:
• VCC1 (Pin 16): Power supply pin for internal logic (typically connected to
+5V).
• VCC2 (Pin 8): Power supply pin for motor driving (typically connected to
the motor supply voltage, e.g., +12V).
• Enable Pins (1, 9): Enable pins for each H-bridge; active HIGH enables the
corresponding outputs.
• Input Pins (2, 7, 10, 15): Input pins for controlling motor direction and speed
(through PWM for speed control).
• Output Pins (3, 6, 11, 14): Output pins connected to the motor terminals.
Operation:
• To control a DC motor using the L293D, you provide logic signals to the
input pins (2, 7, 10, 15) to set the direction (forward or reverse) and use PWM
signals for speed control (if required).
• The Enable pins (1, 9) are typically connected to digital output pins of a
microcontroller to enable or disable motor operation.
37
6.7 WATER MOTOR:
Components Needed:
• Arduino Board: Any Arduino board (e.g., Arduino Uno, Arduino Nano).
• Diode (optional): To protect the circuit from back EMF generated by the
pump.
• Power Supply: A suitable 6-9V DC power supply that can provide enough
current for the pump.
38
Wiring and Control:
Micro Pump:
Connect the positive (+) terminal of the pump to the positive terminal of the
power supply.
Connect the negative (-) terminal of the pump to the collector of the transistor.
Emitter: Connect to the ground (GND) of the power supply and Arduino.
When the Arduino output is HIGH, it allows current to flow from the collector
to the emitter, turning the pump on.
Diode (optional):
Connect a diode (e.g., 1N4007) across the terminals of the pump (cathode to
the positive terminal of the pump, anode to the negative terminal) to protect
against voltage spikes caused by the pump's inductive load.
39
6.8 SERVO MOTOR:
A servo motor is a rotary actuator or linear actuator that allows for precise
control of angular or linear position, velocity, and acceleration. It consists of a
motor coupled to a sensor for position feedback. A servo motor is commonly
used in robotics, automation, and control systems due to its precision and
reliability.
Principle of Operation:
Pin Configuration
Power (VCC): 5V
40
Interfacing with Arduino Uno:
41
6.9 ULTRASONIC SENSOR:
An ultrasonic sensor is a device that uses sound waves to measure the distance
to an object. It emits an ultrasonic pulse and measures the time it takes for the
pulse to reflect back from the object. By calculating the time delay, it
determines the distance between the sensor and the object.
42
The factor of 2 accounts for the round trip of the sound wave. By processing
the time and the known speed of sound, the sensor can determine the precise
distance between itself and the object. This non-contact measurement method
makes ultrasonic sensors valuable in a wide range of applications, such as
obstacle detection, distance measurement, and level sensing.
Operating Voltage: 5V DC
43
Accuracy: ±3 mm
Resolution: 1 cm (0.01 m)
Output Type: Digital (Echo pin outputs a HIGH signal, the pulse width
corresponds to distance)
44
CHAPTER 6
PROGRAM CODE
#include<LiquidCrystal.h>
LiquidCrystal lcd(13,12,11,10,9,8);
#include <Adafruit_Sensor.h>
#include "DHT.h"
int t;
/*********************/
#include <Servo.h>
int servoPin = 3;
Servo Servo1;
/**********************/
///////////////////////////////////
45
const int trigPin = 7;
long duration;
int d, distanceInch;
int m;
int R;
void setup()
[Link](9600);
[Link](16,2);
[Link]();
[Link](servoPin);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(A0,INPUT); // moisture
pinMode(2,INPUT); // rain
46
pinMode(A3,OUTPUT);// water motor
pinMode(A2,INPUT); //temperature
[Link](0);
void loop()
dht11();
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
d = duration*0.034/2;
[Link]('D');
[Link](d);
//if (d <10)
47
//{
// [Link]("Z");
//}
//else
//{
// [Link]("z");
//}
int m=digitalRead(A0);
if (m==LOW)
[Link]("Y");
else
[Link]("y");
48
if(t<38 && m==HIGH && d>10)
[Link](2,0);
[Link]("M_L");
[Link](6,0);
[Link]("W_L");
[Link](10,0);
[Link]("W_M_L");
digitalWrite(A3,LOW);
[Link]("m");
[Link](2,0);
[Link]("M_L");
[Link](6,0);
[Link]("W_H");
49
[Link](10,0);
[Link]("W_M_L");
digitalWrite(A3,LOW);
[Link]("m");
[Link](2,0);
[Link]("M_H");
[Link](6,0);
[Link]("W_L");
[Link](10,0);
[Link]("W_M_L");
digitalWrite(A3,LOW);
[Link]("m");
50
}
[Link](2,0);
[Link]("M_H");
[Link](6,0);
[Link]("W_H");
[Link](10,0);
[Link]("W_M_L");
digitalWrite(A3,LOW);
[Link]("m");
[Link](2,0);
[Link]("M_L");
51
[Link](6,0);
[Link]("W_L");
[Link](10,0);
[Link]("W_M_L");
digitalWrite(A3,LOW);
[Link]("m");
[Link](2,0);
[Link]("M_L");
[Link](6,0);
[Link]("W_H");
[Link](10,0);
[Link]("W_M_H");
52
digitalWrite(A3,HIGH);
[Link]("M");
[Link](2,0);
[Link]("M_H");
[Link](6,0);
[Link]("W_L");
[Link](10,0);
[Link]("W_M_L");
digitalWrite(A3,LOW);
[Link]("m");
53
[Link](2,0);
[Link]("M_H");
[Link](6,0);
[Link]("W_H");
[Link](10,0);
[Link]("W_M_L");
digitalWrite(A3,LOW);
[Link]("m");
int R=digitalRead(2);
if(R==LOW)
[Link](0,1);
[Link]("R_H");
[Link](90);
54
[Link]("R");
else
[Link](0,1);
[Link]("R_L");
[Link](0);
[Link]("r");
void dht11()
int h = [Link]();
t = [Link]();
float f = [Link](true);
{
55
//[Link]("Failed to read from DHT sensor!");
return;
[Link](6,1);
[Link]("T:")
[Link](8,1);
[Link](t);
[Link](" ");
[Link]("T");
[Link](t);
//delay(1000);
[Link](13,1);
[Link]("T-H");
56
[Link]('A');
// delay(1000);
else
[Link](13,1);
[Link]("T-L");
[Link]('a');
// delay(1000);
57
CHAPTER 8
58
CHAPTER 9
RESULT
The proposed smart irrigation system was successfully developed and tested in a
controlled agricultural setup. The integration of soil moisture, temperature, rainfall,
and water level sensors enabled accurate real-time monitoring of environmental
conditions. During trials, the system demonstrated effective autonomous operation,
activating the water pump when soil moisture dropped below the set threshold and
deactivating it upon detecting adequate moisture levels or rainfall. This significantly
reduced water consumption compared to traditional manual irrigation, with water
savings of approximately 40% observed over a 30-day monitoring period.
Additionally, the servo motor-controlled water gate responded accurately to excess
moisture conditions, effectively draining surplus water and preventing waterlogging,
which is a common cause of root rot and reduced crop yield.
The IoT module proved reliable in transmitting real-time sensor data to the cloud,
enabling farmers to remotely access field data via a user-friendly interface. This
feature supported historical data analysis, allowing farmers to optimize irrigation
schedules based on seasonal trends and soil behavior. The system’s performance
remained consistent across different weather conditions, showcasing its robustness
and adaptability.
Furthermore, the system reduced the need for manual labor and human
intervention, allowing farmers to focus on other critical agricultural tasks. The use
of cost-effective components ensured affordability, making the system scalable for
small and medium-sized farms. User feedback highlighted the system’s ease of use,
reliability, and positive impact on resource conservation.
Overall, the results indicate that the smart irrigation system is a viable solution for
promoting water-efficient and sustainable agriculture. Its automated features not only
enhance crop health by maintaining optimal soil moisture but also align with
precision farming goals. Future improvements may include integrating solar power
for energy efficiency and expanding the system to accommodate larger agricultural
zones or multiple crop types.
59
Fig 9.1:Motor Status
60
Fig 9.4: Water Level Status
61
CHAPTER 10
CONCLUSION
62
10.1 FUTURE ENHANCEMENTS
63
CHAPTER 11
REFERENCES
64
11.M. SaberiKamarposhti, H. Kamyab, S. Krishnan, M. Yusuf, S. Rezania, S.
Chelliapan, M. Khorami, A comprehensive review of AI-enhanced smart grid
integration for hydrogen energy: advances, challenges, and future prospects,
Int. J. Hydrogen Energy (2024),
12.X. Li, Y. Cao, X. Yu, Y. Xu, Y. Yang, S. Liu, T. Cheng, Z.L. Wang, Breeze-
driven triboelectric nanogenerator for wind energy harvesting and application
in smart agriculture, Appl. Energy 306 (2022),
13.L. Janota, K. Vavrov a, R. Bízkov´ a, Methodology for strengthening energy
resilience with SMART solution approach of rural areas: local production of
alternative biomass fuel within renewable energy community, Energy Rep. 10
(2023)
14.D. Masseroni, G. Arbat, I.P. de Lima, Editorial-managing, and planning water
resources for irrigation: smart-irrigation systems for providing sustainable
agriculture and maintaining, ecosystem services, Water (Switzerland) 12
(2020),
15.I. Dasgupta, J. Saha, P. Venkatasubbu, P. Ramasubramanian, AI crop predictor
and weed detector using wireless technologies: a smart application for farmers,
Arab J Sci Eng 45 (2020) 11115–11127,
16.I. Froiz-Míguez, P. Lopez-Iturri, P. Fraga-Lamas, M. Celaya-Echarri, O. ´
BlancoNovoa, L. Azpilicueta, F. Falcone, T.M. Fern´ andez-Caram´es, Design,
implementation, and empirical validation of an IoT smart irrigation system for
fog computing applications based on Lora and Lorawan sensor nodes, Sensors
20 (2020) 1–33,
17.V. Kumar S, C.D. Singh, K.V.R. Rao, M. Kumar, Y.A. Rajwade, B. Babu, K.
Singh, Evaluation of IoT based smart drip irrigation and ETc based system for
sweet corn, Smart Agricultural Technology 5 (2023),
[Link] Kamyab, Morteza SaberiKamarposhti, Haslenda Hashim, Mohammad
Yusuf, Carbon dynamics in agricultural greenhouse gas emissions and
removals: a comprehensive review, Carbon Letters (2024) 265–289,
19.S. Cesco, P. Sambo, M. Borin, B. Basso, G. Orzes, F. Mazzetto, Smart
agriculture and digital twins: applications and challenges in a vision of
sustainability, Eur. J. Agron. 146 (2023),
20.A. Vangala, A.K. Das, V. Chamola, V. Korotaev, J.J.P.C. Rodrigues, Security in
IoTenabled smart agriculture: architecture, security solutions and challenges,
Cluster Comput. 26 (2023) 879–902,
65
Sensor integration is crucial as it enables the system to monitor real-time environmental conditions like soil moisture, rain, temperature, and water levels. This continuous data collection allows the system to respond dynamically to field conditions, thus preventing overwatering or underwatering and conserving water, a critical resource. These sensors reduce human intervention and improve the precision and reliability of irrigation practices .
The system's design incorporates sensors for monitoring soil moisture and weather conditions, which allow it to automatically adjust irrigation levels based on current needs, regardless of unpredictable rainfall patterns. The integration of a servo-controlled drainage gate further ensures adaptability by managing excess water conditions that might arise from unexpected heavy rainfall, preventing waterlogging and plant stress .
The proposed smart irrigation system consists of several key components, each serving a specific function to enhance water resource management: a microcontroller as the CPU for data collection and decision making, environmental sensors including soil moisture, rainfall, temperature, and water level sensors for real-time monitoring, an electric water pump controlled based on soil moisture data to prevent overwatering, a drainage gate mechanism to manage excess water, and an IoT module for remote monitoring. This integration allows precise irrigation tailored to conditions and remote access to data for informed decision-making .
Arduino-compatible boards provide several advantages for small to medium-scale farmers: they are affordable, use open-source software that allows for customization and adaptability, and are compatible with various sensors, making the system cost-effective and accessible. These boards also support easy scaling and integration with IoT platforms, facilitating smart monitoring and control for resource conservation and improved crop yield .
The proposed smart irrigation system addresses global food security challenges by optimizing water use, ensuring crops receive the right amount of water based on real-time conditions, which enhances crop health and yield. Its ability to prevent water waste and improve resource management makes it particularly valuable in water-scarce regions. Additionally, it supports sustainable agriculture practices, crucial for meeting the increasing food demands under climate change and resource constraints .
Renewable energy sources such as solar panels can be integrated into the smart irrigation system to power its components, offering several benefits including reduced operational costs, increased sustainability, and energy independence, especially in remote or off-grid areas. This integration aligns with global sustainability goals by minimizing the environmental impact and ensuring that the system remains functional without dependence on nonrenewable energy sources .
IoT capabilities enhance the efficiency of the smart irrigation system by enabling real-time data transmission to a cloud platform, allowing farmers to monitor conditions remotely, analyze historical trends, and receive automatic notifications for critical parameters like low water levels or system malfunctions. This data-driven approach supports improved irrigation scheduling and decision-making, reduces manual errors, and increases reliability, which collectively improve productivity and resource conservation .
Using Proteus for hardware simulation allows engineers to test and validate circuit designs and code before physical implementation, reducing development time and costs. This approach helps identify and address potential errors and optimize system parameters, ensuring reliability and efficiency once deployed. Consequently, it minimizes resource wastage and enhances the effectiveness of the final smart irrigation system .
Potential future enhancements for the smart irrigation system include integrating AI and Machine Learning to analyze historical and real-time data for predictive analytics, using imaging sensors for crop health monitoring, supporting multiple zones for large farms, integrating renewable energy sources for sustainability, and offering advanced user interfaces for better accessibility. These improvements could result in even smarter and more adaptive agriculture systems, increasing both the efficiency and sustainability of food production .
The microcontroller in the smart irrigation system acts as the central processing unit, gathering data from various environmental sensors and making intelligent decisions about irrigation. It triggers actions such as activating water pumps or drainage gates based on sensor readings. This automated control ensures precise irrigation tailored to the needs of the crops, thus conserving water and improving agricultural outcomes .