Microcontroller Based Water Level Controller
Chris Jero Harsha P Rithik Harihar B S Imayavaramban S
[Link] Computer Science [Link] Computer Science [Link] Computer Science
Engineering Engineering Engineering
SRM Institute of Science and SRM Institute of Science and SRM Institute of Science and
Technology Technology Technology
chrisjeroharshax@[Link] bs.rithik07@[Link] imayavaramban474@[Link]
Abstract-Water is a vital resource, and future upgrades such as wireless
using it wisely is essential for sustainable monitoring, automated pump control,
living and effective resource and alert systems. This solution is
management. High water consumption in
suitable for household water tanks,
homes and industries often leads to
waste, shortages, and operational industrial reservoirs, agricultural
challenges, which highlights the need for irrigation systems, and laboratory storage
proper water level monitoring in storage units. By preventing water overflow and
tanks and reservoirs. This project shortages, the system promotes efficient
introduces a microcontroller-based water and mindful water usage, contributing to
level monitoring system that provides sustainable resource management.
real-time feedback using an ultrasonic
sensing method. The system is built with Keywords- Water Level Monitoring,
a NodeMCU microcontroller, an HC- Ultrasonic Sensor, NodeMCU, HC-SR04,
SR04 ultrasonic sensor, and an I2C-
I2C LCD Display, Real-Time
enabled LCD display. The ultrasonic
sensor emits sound waves and calculates Measurement, Microcontroller-Based
the distance based on the echo return System, Median Filtering, Non-Contact
time. The measured distance is then used Sensing, Water Conservation, Sustainable
to determine the water level by Resource Management, Automatic Water
subtracting the air gap inside the Control, IoT-Enabled Monitoring
container. To improve accuracy, multiple
readings are taken and processed using a I. INTRODUCTION
median filtering technique that reduces
noise and minimizes measurement errors Water management has become
caused by ripples or interference. increasingly important recently due to the
The final processed value is displayed growing demand for water in homes,
both as a percentage of the total water industries, and agriculture. Many regions
face challenges like water shortages and
level and as a distance in centimeters on waste, often due to inadequate monitoring
the LCD, offering clear and user-friendly and control in water storage facilities.
real-time monitoring. The system is Traditional methods for checking water
portable, cost-effective, energy-efficient, levels, such as manual inspections or
and non-contact in nature, eliminating mechanical float indicators, tend to be
corrosion and minimizing maintenance. inefficient, inaccurate, or require constant
human monitoring. To address these
Additionally, the NodeMCU platform
problems, electronic measurement and
allows for flexible programming and automation technologies are widely used
for real-time monitoring and smart control Monitoring and managing water levels
of water resources. have received significant attention due to
This project seeks to create a rising water scarcity, poor domestic water
microprocessor-based water level detector
management, and the need for automation
that accurately measures the water level in
a container and displays the results clearly. in industries. Many systems and research
The system includes the NodeMCU studies focus on measuring, controlling,
microcontroller, an ultrasonic sensor, and and automating water storage methods.
an I2C-enabled LCD display. The This section reviews key advancements in
ultrasonic sensor works by emitting sound sensor-based measurement systems,
waves and measuring the time it takes for microcontroller-driven monitoring units,
the echo to return after bouncing off the
IoT-enabled solutions, and techniques to
water surface. This distance measurement
determines the height of the water in the improve data accuracy, which influence
container. The non-contact method means the design of modern water level detection
the sensor does not have to be submerged, systems.
preventing corrosion and maintenance
issues. A. Traditional Water Level Monitoring
The NodeMCU microcontroller is Systems
essential for processing sensor data and
Early water level monitoring relied on
calculating the water level percentage
based on the measured distance. To mechanical methods, such as float
improve accuracy, the system takes switches and dip rods, which physically
multiple distance readings and uses a interacted with the water surface. While
median filtering technique to eliminate these methods were simple and cost-
noise and fluctuations caused by effective, they faced issues like corrosion,
disturbances on the water surface. The limited precision, and high maintenance
calculated water level appears on a 16x2
I2C LCD, offering a clear, real-time needs. Conductive electrode systems also
indication of the water status. emerged to detect levels through electrical
Additionally, the system can output data conductivity. However, they were sensitive
through the serial monitor for debugging to changes in water quality and needed
and analysis. regular cleaning. Traditional methods
The main aim of this project is to design a worked but often lacked long-term
reliable, accurate, and low-cost water level
reliability and flexibility, leading to a shift
monitoring system for various applications
such as overhead tanks, underground towards electronic, sensor-based
reservoirs, water dispensers, and industrial approaches.
storage units. Providing real-time feedback
B. Microcontroller-Based Detection
helps prevent waste due to overflow and
reduces issues caused by unexpected Techniques
shortages. This project shows how With advances in embedded systems,
microcontrollers and sensors can be
microcontrollers like PIC, AVR, and
effectively utilized in automation to
improve resource efficiency. In summary, Arduino became popular for real-time
the proposed water level detector presents water level measurement and automation.
a practical solution for modern water These systems integrated basic sensors to
management needs, promoting sustainable trigger alarms or control pumps. Although
use and enhancing convenience. they improved automation, many systems
II. RELATED WORK relied on threshold logic to indicate low,
medium, or full tank levels. This limited
accuracy and detail in readings, requiring
further enhancement.
III. METHODOLOGY
C. Ultrasonic Sensor-Based approaches
The proposed Microprocessor-Based
Ultrasonic distance measurement has
Water Level Detector system is developed
gained popularity due to its non-contact
using a modular and systematic approach
nature, preventing corrosion and allowing
to ensure accuracy, reliability, and
for installation in various environments.
efficient real-time monitoring. The
Previous studies showed that HC-SR04
methodology includes four main stages:
ultrasonic sensors provide reliable height
requirement identification, system design,
measurements when properly calibrated.
hardware integration, and software
However, raw readings from these sensors
implementation, followed by testing and
can be unstable due to angles of reflection,
evaluation. Each phase aims to ensure that
ripples, and noise. This instability
the system works consistently across
necessitates data processing to achieve
different container or tank environments.
consistent readings.
D. IoT-Enabled Water Level Monitoring
Systems
Recent developments include Wi-Fi
enabled modules like NodeMCU and
ESP32 that transmit real-time water level
data to mobile apps, dashboards, or cloud
servers. These systems provide enhanced
accessibility and remote monitoring but
depend on stable internet connectivity.
While such systems can help smart homes
and industries, they may complicate
matters for basic domestic use.
E. Summary of Literature Insights
Insights from the reviewed research
indicate that ultrasonic sensor-based,
microcontroller-driven systems offer a
practical balance between cost, accuracy,
and reliability. Improving readings with
filtering algorithms and providing clear
percentage-based outputs enhance
usability. The proposed system integrates
these insights to deliver a stable, low-
maintenance, user-friendly water level
monitoring solution.
Fig. 1. Workflow diagram of the proposed a median filtering algorithm, which
Microcontroller Based Water Level reduces noise from movements on the
Detector. water surface. The cleaned data is then
used to determine the exact water level
In the requirement analysis phase, the goal
percentage. A continuous loop updates the
was to create a system that measures water
LCD display in real time, allowing for
levels without direct contact, thus avoiding
smooth monitoring.
corrosion and maintenance challenges. The
functional requirements included a non- Testing was performed with different
contact sensor (ultrasonic), a water levels and container sizes. The
microcontroller for data processing results showed that the system provides
(NodeMCU), and a clear display interface consistent readings with minimal errors.
(16×2 Liquid Crystal Display with I2C). The methodology ensures that the system
Non-functional requirements like functions as a cost-effective, user-friendly,
accuracy, stability, low power use, and and reliable water level monitoring
user-friendliness were set to guide the solution for home and industrial
implementation. applications.
During the system design phase, a block IV. IMPLEMENTATION
diagram was created to show data flow
The Microcontroller-Based Water Level
between components. The ultrasonic
Detector consists of both hardware
sensor (HC-SR04) is placed at the top of
assembly and software programming. It
the container to measure the distance to the
uses a NodeMCU microcontroller
water surface. The NodeMCU receives
connected to an HC-SR04 ultrasonic
distance readings and compares them to
sensor and a 16×2 LCD module with an
the known tank height to convert them into
I2C adapter for display. The ultrasonic
water level values. The calculated water
sensor is mounted at the top of the
percentage, along with the measured
container to measure the distance to the
distance, appears on the LCD. Serial
water surface. The total height of the
monitoring is also set up for debugging
container is set in the code, which allows
and detailed analysis.
the system to determine the water level by
In the hardware integration phase, the subtracting the measured distance from the
ultrasonic sensor connects to the maximum height.
NodeMCU through digital input/output
A. Hardware Implementation
pins, while the LCD uses the I2C
communication protocol to minimize The NodeMCU (ESP8266-based)
wiring. The entire setup operates on a microcontroller is chosen for its low power
regulated 5V power supply. use, built-in processing ability, and
flexibility for future wireless connections.
The software implementation uses the
The HC-SR04 ultrasonic sensor connects
Arduino IDE. The program triggers the
to the NodeMCU through digital I/O pins.
ultrasonic sensor to send pulses and
The Trigger pin sends ultrasonic pulses
captures the echo duration to calculate the
while the Echo pin receives the reflected
distance. To improve accuracy, multiple
sound waves. The LCD connects using the
readings are collected and processed using
I2C interface, which simplifies wiring to water, preventing corrosion and extending
just two lines (SCL and SDA). its lifespan.
A regulated 5V power supply runs the V. RESULT AND DISSCUSION
NodeMCU, sensor, and LCD. The
The Microprocessor-Based Water Level
components are placed on a small
Detector successfully monitors the water
prototype board for stability. The sensor is
level in a container using an ultrasonic
angled to face straight down toward the
sensor and displays real-time
water surface to ensure accurate reflection
measurements on an LCD screen. The
of ultrasonic waves.
system continuously calculates the
B. Software Implementation distance between the sensor and the water
surface, converts it to the corresponding
The software is created using the Arduino
water height, and shows both the
IDE. It starts by initializing the sensor and
percentage level and the measured
LCD modules. The NodeMCU sends a
distance. This provides users with a clear
short trigger pulse to the ultrasonic sensor,
indication of the current water status
which emits an ultrasonic wave. The
without needing manual checks.
duration of the returning echo pulse is
captured and converted into distance using During testing, the system connected to
the standard speed of sound formula. To containers of different shapes and sizes to
increase reliability, the system takes evaluate performance under varied
multiple distance readings in quick conditions. The ultrasonic sensor
succession. These readings are then accurately detected changes in water
processed with the median filtering levels, and the NodeMCU microcontroller
technique, which eliminates outlier spikes processed the data efficiently. The median
caused by disturbances like water ripples filtering algorithm significantly improved
or vibrations. measurement stability, especially when the
water surface was disturbed by motion or
Once the filtered distance is obtained, the
vibration. Without filtering, values
water level percentage is calculated based
fluctuated rapidly; however, with median
on the known container height. This
smoothing, the readings became steady
percentage and the measured distance in
and reliable. The readings updated every
centimeters are constantly updated and
200 milliseconds, ensuring near real-time
displayed on the LCD in real time. The
monitoring without noticeable delay.
system runs in a loop to ensure continuous
monitoring without manual intervention. The LCD display showed the output in an
easy-to-read format: the first line displayed
C. System Operation
the water level in percentage (%) and the
When powered on, the ultrasonic sensor second line showed the measured distance
automatically measures the water level. As in centimetres (cm). Users could quickly
the water level changes, the display understand the information, making the
updates accordingly. The system needs no system user-friendly and suitable for home
calibration after the initial setup and use.
operates without physical contact with the
2. M. Sharma and R. Patel,
“Automatic Water Tank Level
Monitoring and Pump Controlling
System,” International Journal of
Engineering Research &
Technology, vol. 8, no. 5, pp. 455–
Fig. 2 shows a sample output on the LCD, 459, 2019.
where the system indicates a water level
percentage relative to the total container 3. H. Chavan and A. Dhabu, “Smart
height. Water Level Monitoring and
Controlling System Using IoT,”
Compared to traditional water level International Journal of Innovative
indicators like float switches and Research in Science, Engineering
conductive probes, the ultrasonic-based and Technology, vol. 5, no. 6, pp.
solution showed clear advantages. Since 82–87, 2021.
the sensor does not physically touch the
water, issues like rust, mineral buildup, or 4. A. K. Singh and V. Kumar, “Real-
contamination are completely avoided. Time Water Level Indicator Using
This leads to better durability and reduced NodeMCU and Ultrasonic Sensor,”
maintenance needs. Additionally, the International Journal of Scientific
system provides continuous monitoring Research in Computer Science,
instead of just triggering at specific Engineering and Information
threshold points, offering more precise Technology, vol. 7, no. 2, pp. 144–
control. 150, 2020.
The device's portability and minimal 5. V. Ramesh and P. Praveen,
wiring needs make it easy to install in “Ultrasonic Technology Based
household tanks, water bottles, laboratory Water Level Measurement
containers, and industrial reservoirs. The System,” International Journal of
NodeMCU also has potential for Emerging Trends in Engineering
expansion, such as wireless Research, vol. 4, no. 1, pp. 23–27,
communication or automated pump 2016.
control, making future upgrades possible.
REFERENCES
1. P. Kumar and S. Verma, “Design
and Implementation of Ultrasonic
Sensor Based Water Level
Indicator,” International Journal of
Advanced Research in Electronics
and Communication Engineering,
vol. 6, no. 3, pp. 120–124, 2017.