Arduino-ESP32 Based Smart Irrigation System
Arduino-ESP32 Based Smart Irrigation System
2025
Kevin B. Montes
CUNY New York City College of Technology
Erick Cabrera
CUNY New York City College of Technology
This work is made publicly available by the City University of New York (CUNY).
Contact: [email protected]
2025 ASEE Northeast Section Conference, March 22, 2025, University of Bridgeport, Bridgpeort, CT, USA.
Abstract—In response to the growing demand for efficient enterprise IoT market will expand at a compound annual growth
water management in agriculture, this research presents the rate (CAGR) of 19.4%, reaching $483 billion between 2022 and
development of an Arduino-ESP32 based automated irrigation 2027 [1].
system. The project integrates an Arduino microcontroller with an
ESP32 module to facilitate real-time data collection and control of Often described as machine-to-machine (M2M)
irrigation processes. Sensors monitor soil moisture, water levels, communication, the IoT involves an immense network of
and local weather conditions, with data displayed on an LCD I2C interconnected "things" that rely on continuous connectivity.
screen for user accessibility. The ESP32 module handles alert These devices range from household gadgets and smart home
notifications via text messages, keeping users informed remotely. systems to industrial machinery, vehicles, and even entire urban
Key components, including a water pump, valve, relay module, infrastructures. Equipped with sensors, IoT devices gather
OLED screen, and LED display, are synchronized to ensure environmental data, such as temperature, humidity, and motion,
precise irrigation control. Additionally, an AC connector and as well as operational data like energy consumption and
speaker module provide safety alerts to support system performance. This information is transmitted via the Internet to
operations. This system aims to reduce water waste, optimize other devices or systems, where it is analyzed and used to guide
irrigation cycles, and offer a user-friendly, data-driven solution decisions and actions.
for both agricultural and home garden applications. The findings
will demonstrate the system's effectiveness in enhancing irrigation A smart irrigation system introduces modern technologies
practices, highlighting its potential as a sustainable model for like sensors, microcontrollers, and wireless communication in
resource management in small-scale farming and gardening an agricultural and landscape setting for a more efficient
contexts. approach. irrigation is generally not a regular irrigation
technique, but smart systems keep a constant view on such
Keywords—Arduino; ESP32; Real-time data; Smart Irrigation parameters as soil moisture, temperature, and humidity, among
Control Mechanism. others, to ensure water is precisely supplied in minimal or no
waste form to enhance the health of the crops. Integration of
I. INTRODUCTION Internet of Things (IoT) devices would make it capable of
Water scarcity is a growing concern in agriculture, where remote automatic operation depending on data-driven decisions
inefficient irrigation practices contribute to resource depletion and, therefore, improve efficiency and sustainability. Smart
and increased operational costs. Traditional irrigation methods irrigation is easy to apply with simple tools such as Arduino ,
often rely on manual scheduling, leading to overwatering or ESP 32, or Raspberry Pi that keep costs down and make
underwatering, which negatively affects crop yield and soil precision farming seamlessly accessible for a wide array of
health. To address these challenges, smart irrigation systems users.
leveraging the Internet of Things (IoT) [1] have gained This paper presents the development of an Arduino-ESP32-
significant attention. By integrating sensors, microcontrollers, based smart irrigation system designed to optimize water usage
and wireless communication, these systems enable real-time and enhance agricultural efficiency. The ESP32 microcontroller,
monitoring and automated water distribution, ensuring optimal with its built-in Wi-Fi and Bluetooth capabilities, allows remote
irrigation based on environmental conditions. monitoring and control, while Arduino provides a flexible and
The Internet of Things (IoT) is revolutionizing various cost-effective platform for system integration. The proposed
sectors, such as healthcare, energy, water management, urban system collects real-time data from soil moisture sensors,
development, and transportation, fundamentally changing how processes the information, and automates water delivery
we live and work. Currently, over 15 billion smart devices are accordingly. By reducing human intervention and minimizing
connected through the Internet, enabling seamless water wastage, this system contributes to sustainable farming
communication and remote operation. By 2030, the number of practices. The subsequent sections of this paper discuss related
connected IoT devices is expected to exceed 29 billion, almost works, system design, implementation, testing, and performance
triple the amount in 2020. Projections from the International evaluation, followed by conclusions and future research
Data Corporation (IDC) indicate that IoT-related spending will directions.
grow significantly, rising from $726 billion in 2019 to $1.1 In this research, we propose the development of a smart
trillion by 2023. Furthermore, IoT Analytics predicts that the irrigation system using two microcontrollers—Arduino Nano
and ESP32—designed for small-scale farming and gardening The combination of Arduino and ESP32 allows for the
applications. Traditional irrigation methods often rely on precise control and monitoring of the irrigation system.
manual scheduling, which can lead to inefficient water use, The Blynk app provides an easy-to-use interface for
either through overwatering or underwatering, both of which communication and management, whether the user is manually
negatively impact crop yields and soil health [2]. Additionally, adjusting settings or allowing the system to run automatically
smart farming plays a vital role in addressing climate change by
reducing the waste of natural resources. Integrating IoT III. TECHNICAL SPECIFICATIONS OF THE SMART
technology in agriculture enhances monitoring efficiency, IRRIGATION SYSTEM
enabling precise resource management and decision-making
support for farmers. Conventional irrigation systems often fail A. Arduino-Nano
to effectively monitor soil moisture levels and water
distribution, leading to inefficiencies and unnecessary resource Arduino Nano is a small and compact microcontroller board.
consumption. To address these challenges, IoT-powered smart Arduino Nano uses the ATmega328P microcontroller shown in
irrigation systems have gained significant attention. By Figure 2. Arduino Nano has 30 pins, including 14 digital I/O
incorporating sensors, microcontrollers, and wireless pins and 8 analog inputs. It features a USB-C connector for
communication, these systems facilitate real-time monitoring programming [4].The most notable advantage of Arduino Nano
and automated water distribution, ensuring optimal irrigation is its small breadboard-friendly design for smaller Robotics
based on environmental conditions [3]. systems Projects. Programming in the Arduino Nano is carried
out specifically in the integrated development environment
This paper presents the design and implementation of an (IDE). The programming language is selected as Embedded C
Arduino Nano-ESP32-based smart irrigation system aimed at or C++ language.
optimizing water usage and improving agricultural efficiency.
The ESP32 microcontroller, with its built-in Wi-Fi and
Bluetooth capabilities, enables remote monitoring and control,
while the Arduino platform offers a flexible and cost-effective
foundation for system integration. The proposed system collects
real-time data from soil moisture sensors, processes this
information, and automates water delivery accordingly. By
minimizing human intervention and reducing water waste, the
Figure 2. Arduino Nano
system supports sustainable farming practices. The subsequent
sections of this paper discuss related works, system design, B. ESP 32-WROOM-32D
implementation, testing, and performance evaluation, followed ESP32 is a low-power, affordable microcontroller with Wi-Fi
by conclusions and future research directions. and Bluetooth functionality for providing remote monitoring
and control in IoT applications, robotics, home automation, etc.
II. SYSTEM DESIGN It can perform more than one task simultaneously because of
The System Architecture for the development of dual-core processing. Wi-Fi and Bluetooth Low Energy (BLE)
an Automatic Arduino-ESP32-based irrigation system uses are built into it, which enables it to provide wireless
various sensors and an Arduino microcontroller, paired with connectivity to smart devices easily. Here, we employ the
the ESP32 to facilitate real-time data collection and control of ESP32-WROOM-32D, a generic high-performance Wi-Fi +
irrigation processes. BT + BLE MCU module. It allows for a wide range of
In this paper, the Smart Irrigation System operates in two applications from low power sensor networks up to real-time
modes: Manual Mode and Automatic Mode. Users can control data processing and thus is a general-purpose option for various
the system using any device, whether it's an iPhone embedded systems. The ESP32-WROOM-32D module offers
(iOS) or Android phone, through the Blynk application. The a 32 Mbit core running at 3.3 V with 40 MHz SPI Flash for
system utilizes Internet technology to establish a connection efficient data storage and processing. It features an on-board
between the devices and the irrigation system, enabling users to PCB antenna for stable wireless communication and has
manage it remotely. Shown in Figure 1. compact dimensions of 18 × 25.5 × 3.1 mm, making it suitable
for space-constrained projects [5]. Due to its high performance
and energy efficiency, this module is widely used in embedded
systems that require reliable wireless connectivity, as shown
in Figure 3.
Figure 1. Structured Diagram for Smart Irrigation Process Figure 3. ESP 32-Wroom-32D
C. The Relay Module
The Relay Module is an electric module that allows the
operation of a high-voltage load (like a motor, lamp, or
appliance) using a low-voltage signal (like from an Arduino,
ESP32, or another microcontroller). It is an electricity-
controlled switch that allows small electronic devices to make
bigger electrical devices on/off safe. There is an
electromagnet—coil of wire that becomes magnetized when
current flows through it—within a relay. This magnetism
mechanically opens or closes a switch, allowing or stopping the
flow of electricity to the connected high-power device.
Conceptually, a relay works like an electric lever, where a small
current activates a switch to control a larger current [6]. We use
the relay module in this project to interface and control a water Figure 6. Speaker
pump to achieve water management. This sensor has three
wires: red for positive (+), black for negative (-), and yellow for F. Capacitive Soil Moisture Sensor
the signal, as shown in Figure 4. There are different types of soil moisture sensors, and we are
using the V1.2 Module. This sensor measures soil moisture
using capacitive sensing instead of resistive sensing. It operates
within a voltage range of 3.3V to 5.5V, supported by its built-
in voltage regulator. It has three pins: one for power (5V), one
for ground, and one for analog output, making it well-suited for
low-voltage microcontrollers. The sensor outputs a frequency
signal that varies with moisture levels, ranging from 260 Hz for
high moisture to 680 Hz for low moisture, where higher
frequencies indicate drier soil [7].This sensor has three wires:
red for positive (+), black for negative (-), and yellow for the
signal, as shown in Figure 7. This sensor is essential for an
Figure 4. One Channel Relay
Arduino-ESP32-based smart irrigation system because it
D. Water Pump provides real-time soil monitoring with date tracking. It ensures
The water pump, as shown in Figure 5, is a 12V DC pump with precise water delivery by detecting when the soil is dry or not,
a volute design. It has a small motor that is powered by a conserving resources, and promoting healthier plant growth!
positive (+) red wire and negative (-) black wires connection,
which helps push water through the pump and expel it out.
Figure 10. Ultrasonic Sensor working principle Figure 12. OLED Screen
K. Blynk Application / Cloud disrupt system performance, leading to potential downtime and
Blynk is cloud based mobile application development reduced reliability.
platform for students and developers to build and develop B. Mitigation Process
connected IoT devices. It lets users connect hardware to the
cloud and create iOS and Android applications. Blynk allows To offset such threats, robust authentication mechanisms,
you to program and manage IoT boards such as the ESP32 or encrypted data transport, and fail-safe protection methods must
any Wi-Fi and Bluetooth microcontrollers. An Blynk IoT cloud be imposed. The internet connection should be kept private and
platform acts as a central hub for connecting and managing IoT secure to prevent cyber-attacks, protect sensitive information,
devices over the internet. use certain channels to send data to the and maintain system integrity. [16] Blynk's website and app
platform (like Exosite) [12]. Each device exposes its data need to be secured in an effort not to breach security. Activating
through these channels, which act as virtual pipelines that other Two-Factor Authentication (2FA) on all key accounts gives
devices or apps can access and use as needed. You will require added protection in addition to passwords. Any size of IoT
an Android or iOS smartphone to use Blynk. For iOS, download project should be secured as the internet harbors several threats.
from the App Store; for Android, download from the Google Through the utilization of these security measures, devices and
Play Store. You can then install and play around to experiment the Blynk application can be more secure against threats.
with the app to control and monitor your smart devices.
Here’s an example: we’ll demonstrate how to lock the app on
L. Arduino IDE both iOS and Android devices. For this demonstration, we’ll
Arduino IDE is an open-source, beginner computer program to use an iPhone to show you how to lock the app and block
program Arduino microcontrollers. Imagine it as an internet access.
workshop where you type (with C/C++), check, and upload
your code directly into boards like the Arduino Nano through
USB type C. The interface includes a text editor for writing
programs, a console for feedback, and a serial monitor to debug
or chat with your hardware.
The IDE simplifies coding with built-in libraries for sensors Figure 13- a. Using Passcode
like DHT11, Capacitive Soil Moisture Sensor, Ultrasonic
Sensor and LCD I2C/OLED and displays, allowing you to
focus on your project instead of low-level details. It's cross-
platform (runs on Windows, Mac, Linux) [13] and third-party
board supported, so it's flexible enough for everything from
simple blinking-LED experiments to sophisticated IoT systems.
Its open-source nature and massive community support make
debugging easy, whether you're a student, hobbyist, or engineer
working on ideas.
The system can be modified to support multiple water pumps C. Arduino Development Process Flow Chart
or solenoid valves, allowing for precise zonal irrigation based
on crop types and their specific watering requirements.
E. Data Management
For large scale implementations, a dedicated database system
could replace the current data storage method, enabling long-
term trend analysis and comprehensive water usage reporting,
which can be accomplished with the different cloud service
providers mentioned before.
VI. DESIGN AND INPLEMENTATION OF THE
SMART IRRIGATION SYSTEM Figure 17. Arduino Process Flow Chart
In this section, the circuit connection diagram of the irrigation D. Blynk Flow Chart
system is depicted in figure 13. In this figure, the connection
among the basic components of the system is shown. In Figure
14-15, the flow chart of ESP32 and Arduino microprocessors
are illustrated, respectively. While in figure 16, the flowchart of
the blynk software flowchart is depicted.
A. Electrical Subsystem Design
Figure 15. Circuit wiring (Schematics) Figure 18. Blynk Flow Chart
E. Software Design Table 1. Our System Vs. Commercial System
When connecting your ESP32 (or another internet-capable Feature Our System Commercial
System (Google)
microcontroller) to Blynk, you use Virtual Pins (V-pins) to send
Cost $45-50(Depending
and receive data. DataStream in Blynk are communication
on materials) $150-500+
channels that allow data transfer between your device and Power Low (operates with Medium-High
Blynk. Cloud. For this example, we’ll send random values from Consumption 5VDC) (24VAC)
the device using a Virtual Pin. Multiple (soil,
Steps to Set Up in Blynk: Sensor temperature,
o Go to your Blynk project. Integration humidity and water Often limited to 1-2
o Click on Add Datastream. level sensors) sensors
o Select Virtual Pin from the dropdown menu. Dual (Physical
o Configure the settings User Interface display + Mobile Typically, mobile
• Name: Random Value Send App) only
• Virtual Pin: (Choose an available pin, Communication Wi-Fi & Bluetooth Wi-Fi
Data Storage Local + Cloud Cloud
e.g., V0, V1, etc.)
(Blynk)
• Data Type: (e.g., Integer or Float) Customization High Low-Medium
• Min/Max: Set the range for your values
(e.g., 0 to 100). Our system delivers performance comparable to commercial
This setup allows your ESP32 to send soil sensor data (or any solutions at a significantly lower cost while offering flexible
other sensor readings) to the Blynk app via Virtual Pins, as deployment options. The Arduino Nano, depending on the
shown in Figure 17. brand, ranges from $10 to $25, while the soil moisture sensor
costs between $6 and $12, depending on the specific model
required for the project. Additionally, our Smart Irrigation
System can be scaled for larger farms by incorporating more
cost-effective and efficient sensors, as well as improved IoT
software. We have the flexibility to develop a custom
application or integrate existing platforms like Blynk. Our
solution not only enhances sensor capabilities but also provides
a more user-friendly interface, all while maintaining high
efficiency in water conservation.
VIII. RESULTS
Figure 19. Blynk Data Steams Design
A. System Testing and Performance
F. Physical Circuit
Now that you have set up your Blynk DataStream on the web
and assigned Virtual Pins (V-Pins) for all your sensor readings,
you’re ready to move on to the next step. Next, open the Blynk
app on your mobile phone. It doesn't matter whether you're using
Android or iOS, as both are supported. In the app, you'll use the
Virtual Pins to configure the Graphical User Interface (GUI),
allowing you to visualize and interact with your sensor data.
Refer to Figure 18 for an example of the GUI setup for Virtual
Pins. Before running the test, let's review the Graphical User
Interface (GUI) outcome. As illustrated in figure 19, This is how
the interface should look after setting up Virtual Pins and
configuring the Blynk app.
To connect your Arduino and ESP32 to Blynk, follow through
by ensuring both devices are well set up and ready to
Figure 20. Physical Circuit Front View synchronize. Open the Blynk app from your phone ensuring that
it will be able to access an internet connection. Make sure that
VII. COMPARATIVE ANALYSIS your ESP32 and your phone are connected to the same Wi-Fi
This Arduino(nano)-ESP32 based Smart Irrigation System network so that the Blynk will be able to connect. If you set it
offers several advantages when compared to existing irrigation up correctly, you will have a green light in the right corner in the
solutions. The table below provides a comparative analysis with Blynk app, which indicates that your ESP32 is connected.
similar IoT-based irrigation systems: Subsequently, try out your Blynk configuration by posting data
to confirm that all is well. In case of success, you're all set. But
in case the connection fails, review your ESP32 code for any
issues or check the Virtual Pin (V-Pin) settings within the Blynk B. Future Relaiability Improvements
Datastreams on the web. • Connectivity Failures
In areas with unreliable Wi-Fi, the system could fail to receive
commands. A failsafe local control mode should be
implemented to continue basic irrigation functions based on
sensor readings when connectivity is lost. [22] This means the
Smart Irrigation System must incorporate an autonomous
decision-making mechanism that ensures uninterrupted
operation, preventing disruptions in water distribution.
Additionally, integrating a local data logging feature would
enable the system to store sensor readings and synchronize with
the cloud once connectivity is restored, ensuring data integrity
and continuous performance optimization.
• Power Interruptions
Battery backup systems with proper charge management would
ensure continuous operation during power outages.
• Sensor Calibration and Redundancy
Multiple sensors of the same type could be deployed to provide
redundancy and improve measurement accuracy through data
Figure 21. The expected GUI layout before testing. fusion techniques.
As shown in Figures 20 and 21, the temperature remains • System Health Monitoring
at 25°C with 30% humidity, and both the OLED and LED
display the same readings. This confirms that the Arduino- Implementation of watchdog timers and self-diagnostic
ESP32-based Smart Irrigation System is functioning correctly. routines would allow the system to recover from software
Using the Blynk app, we can efficiently control the water pump. crashes and report potential hardware failures before they affect
irrigation performance. These security and reliability
enhancements would make the system more robust for real-
world agricultural applications where consistent operation is
critical for crop health and yield.
IX. CONCLUSION
The Arduino-ESP32-based Smart Irrigation System developed
in this research enhances water management efficiency for
small-scale agriculture and gardening. By integrating soil
moisture, ultrasonic water level, and DHT11 environmental
sensors, the system enables precision irrigation, surpassing
traditional manual methods. It employs Arduino Nano and
ESP32 microcontrollers within a dual-mode framework,
allowing both manual and automatic operation, with remote
control via the Blynk app. Real-time monitoring and instant text
notifications ensure effective irrigation management.
Experimental results demonstrate reduced water wastage
Figure 22. Graphic User Interface Data through data-driven irrigation based on real-time soil conditions.
Additionally, OLED and LCD I2C displays improve user
accessibility, while an integrated speaker provides critical alerts.
The system's affordability and scalability make it a viable
solution for diverse users, contributing to sustainable water
usage, improved crop health, and higher yields.
The proposed smart irrigation system offers a cost-effective
alternative to commercial solutions, priced at $45-50 compared
to $150-500+. It operates on low power (5VDC) and supports
multiple sensor types, surpassing commercial options. A dual
Figure 23. OLED & LED Data user interface (physical display and mobile app) enhances
accessibility. Security features include password protection,
multi-factor authentication, and encrypted data transmission. [7] P. Placidi, L. Gasperini, A. Grassi, M. Cecconi and A. Scorzoni,
The system is scalable for larger agricultural use with mesh "Characterization of Low-Cost Capacitive Soil Moisture Sensors for IoT
networking and cloud integration for predictive irrigation. Networks," Sensors, vol. 20, no. 12, 2020.
Reliability improvements, such as failsafe local control, battery [8] G. M. Debele and X. Qian, "Automatic Room Temperature Control
backup, and self-recovery mechanisms, are planned. Future System Using Arduino UNO R3 and DHT11 Sensor," in 2020 17th
International Computer Conference on Wavelet Active Media
enhancements will focus on machine learning, weather Technology and Information Processing (ICCWAMTIP), Chengdu,
forecasting, and solar-powered off-grid functionality. China, 2020.
Future work will focus on enhancing system intelligence [9] Q. Qi and G. J. Brereton, "Mechanisms of removal of micron-sized
particles by high-frequency ultrasonic waves," IEEE Transactions on
through machine learning algorithms capable of predicting Ultrasonics, Ferroelectrics, and Frequency Control, vol. 42, no. 4, pp.
irrigation needs based on historical data, integrating weather 619-629, 1995.
forecasting for more adaptive water management, and [10] A. M. Kamal, S. H. Hemel and M. U. Ahmad, "Comparison of Linear
incorporating solar power to improve sustainability and off-grid Displacement Measurements Between A Mems Accelerometer and Hc-
functionality in remote agricultural settings. Sr04 Low-Cost Ultrasonic Sensor," in 2019 1st International Conference
on Advances in Science, Engineering and Robotics Technology
This research contributes to the expanding field of IoT (ICASERT), Dhaka, Bangladesh, 2019.
applications in agriculture, providing a practical and sustainable [11] Y. Y. Chen, K. W. Jwo and R. S. Chang, "Research of an Intelligent
model for resource-efficient farming that balances technological Auto-Controlling System for LCD Screen Flicker," Journal of Display
innovation with environmental responsibility. Technology, vol. 12, no. 6, pp. 557-561, 2016.
[12] R. M. Salem, M. S. Saraya and A. T. Ali-Eldin, "An Industrial Cloud-
REFERENCES Based IoT System for Real-Time Monitoring and Controlling of
Wastewater," IEEE Access, vol. 10, pp. 6528-6540, 2022.
[13] O. E. Amestica, P. E. Melin, C. R. Duran-Faundez and G. R. Lagos, "An
[1] A. Hassebo and M. Tealab, "Global Models of Smart Cities and Potential Experimental Comparison of Arduino IDE Compatible Platforms for
IoT Applications: A Review," IoT, vol. 4, no. 3, pp. 366-411, 2023. Digital Control and Data Acquisition Applications," in 2019 IEEE
[2] C. Ingrao, R. Strippoli, G. Lagioia and D. Huisingh, "Water scarcity in CHILEAN Conference on Electrical, Electronics Engineering,
agriculture: An overview of causes, impacts and approaches for reducing Information and Communication Technologies (CHILECON),
the risks," Heliyon, vol. 9, no. 8, 2023. Valparaiso, Chile, 2019.
[3] N. P. Korlepara, V. N. Raju, P. V. Satyanarayana, V. S. Kumar, Y. J. [14] E. Chandak, M. Kothalkar, P. Raghatwan and Y. S. Rao, "IoT-Based
Priya and D. H. Vardan, "Real-Time Precision Irrigation System for Smart Learning Management System on Cloud," in 2024 3rd
Optimal Crop Yield and Water Conservation," in IOP Conference International Conference for Innovation in Technology (INOCON),
Series: Earth and Environmental Science, 2024. Bangalore, India, 2024.
[4] H. Al-Mimi, A. Al-Dahoud, M. Fezari and M. S. Daoud, "A Study on [15] V. Raghunathan, A. Kansal, J. Hsu, J. Friedman and M. Srivastava,
New Arduino NANO Board for WSN and IoT Applications," "Design considerations for solar energy harvesting wireless embedded
International Journal of Advanced Science and Technology, vol. 29, no. systems," in IPSN 2005. Fourth International Symposium on
4, pp. 10223-10230, 2020. Information Processing in Sensor Networks, Boise, ID, USA, 2005.
[5] S. B. Biswas and M. T. Iqbal, "Solar Water Pumping System Control
Using a Low Cost ESP32 Microcontroller," in 2018 IEEE Canadian
Conference on Electrical & Computer Engineering (CCECE), Quebec,
QC, Canada, 2018.
[6] T. H. Nasution, M. A. Muchtar, I. Siregar, U. Andayani, E. Christian and
E. P. Sinulingga, "Electrical appliances control prototype by using GSM
module and Arduino," in 2017 4th International Conference on
Industrial Engineering and Applications (ICIEA), Nagoya, Japan, 2017.