ABSTRACT
Water is one of the most vital resources in our daily life, and its efficient use and
conservation are crucial in today’s world. Manual monitoring of water tank levels often leads
to overflow, dry runs, or excessive use of energy and labor. To overcome these challenges,
this project proposes the design and implementation of a fully automated water level
monitoring and control system using an ultrasonic sensor integrated with an Arduino Uno
microcontroller. The system is designed to detect the water level in a tank in real time and
control the operation of a 5V motor pump accordingly, without any manual intervention.
The ultrasonic sensor continuously sends and receives sound waves to measure the distance
between the sensor and the water surface. This data is processed by the Arduino Uno to
calculate the actual water level. The current water level is displayed on a 16x2 LCD screen,
allowing users to visually monitor the tank status. When the water level drops below a
predefined minimum threshold, the Arduino automatically turns ON the motor pump using a
relay module to fill the tank. Conversely, when the tank reaches its maximum capacity, the
motor is switched OFF, and a buzzer is activated to alert the user.
The system is built to be energy-efficient, low-cost, and easy to deploy in both residential and
agricultural applications. It eliminates the need for human supervision, thus preventing
overflow, dry run damage to the pump, and wastage of water. The use of an Arduino
microcontroller ensures flexibility and precision in operations, while the integration of simple
hardware components makes the system highly scalable and maintainable.
This project demonstrates a practical and intelligent solution for smart water management
systems, offering great potential for rural and urban settings where automation and water
conservation are key concerns.
Keywords: Water Level, Ultrasonic Sensor, Arduino, Motor Pump, Automation, Relay
Module, Real-Time Monitoring.
3
ACKNOWLEDGEMENT
4
TABLE OF CONTENTS
CHAPTER
NO
1
TITLE
PAGE NO
ABSTRACT
3
ACKNOWLEDGEMENT
4
TABLE OF CONTENTS
5
INTRODUCTION
8
1.1 Introduction
1.2 Problem Statement
1.3 Objective of Project
2
LITERATURE REVIEW
12
2.1 Introduction
2.2 Review of Literature Survey
2.3 Summary
3
METHODOLOGY
16
3.1 Introduction
3.2 Block Diagram
3.3 Flowchart
4
HARDWARE COMPONENTS
21
4.1 Arduino UNO
4.2 Ultrasonic Sensor
4.3 LCD Display
4.4 Buzzer
4.5 Relay and Waterpump
5
SOFTWARES IMPLEMENTATION
31
5.1 Arduino IDE
6
IMPLEMENTATION AND RESULTS
38
6.1 Implementation
6.2 Result
7
CONCLUSION AND OUTCOME
42
7.1 Conclusion
7.2 Future Work
7.3 Outcome
5
REFERENCES
44
ANNEXURE
45
6
LIST OF FIGURES
FIGURE NO.
TITLE.
NO.
3.1
Block Diagram
16
3.2
Flow Chart of Working of Model
19
4.1
Arduino UNO
21
4.2
Ultrasonic Sensor
22
4.3
LCD Display 16*2
25
4.4
Buzzer
27
4.5
Relay Module
28
5.1
Arduino IDE
31
5.2
Fig.5.2 Arduino code example
32
5.3
5.4
5.5
6.1
Arduino Serial Monitor
Fig 5.4 Arduino IDE Code Compiling
Selecting Board
Circuit Diagram of Water Level Indicator
33
33
34
38
7
CHAPTER 1
INTRODUCTION
1.1 Introduction
In today’s digital era, mobile phones have become an essential part of daily life, serving as a
primary medium for communication, online transactions, navigation, entertainment, and
emergency services. With the increasing dependence on smartphones, the demand for reliable
and accessible mobile charging facilities has also grown rapidly. This demand becomes
especially critical in public places such as railway stations, bus terminals, shopping malls,
educational institutions, hospitals, and rural areas where access to charging points may be
limited. To address this growing need, this project presents a Coin Based Mobile Charging
System, which offers a convenient and automated solution for mobile charging in public
environments.
The Coin Based Mobile Charging System operates on a simple and user-friendly principle
where a user inserts a coin to access mobile charging for a fixed duration. The system uses a
multi coin acceptor to detect and validate the inserted coin. Once the coin is accepted, a
signal is sent to the Arduino Uno, which acts as the central control unit of the system. The
Arduino processes the input signal and activates a relay module, allowing power to flow
from the 12V to 5V USB power module to the mobile charging port. The charging process
continues for a predefined time based on the number of coins inserted, after which the system
automatically cuts off the power supply to prevent misuse and energy wastage.
The system is designed to ensure safe and controlled power delivery. The Arduino Uno
operates at 5V and controls the relay using digital output pins. The relay acts as an electronic
switch, isolating the low-power control circuit from the high-power charging circuit. The 12V
to 5V USB power module converts the input voltage into a regulated 5V output suitable for
charging mobile devices. A 16×2 LCD display is used to provide real-time information to
the user, such as instructions, charging status, and remaining charging time. This combination
of hardware components ensures a reliable, efficient, and automated mobile charging solution
suitable for public use.
8
1.2 Problem Statement
The rapid increase in mobile phone usage has led to a corresponding rise in the demand for
mobile charging facilities. While mobile phones offer convenience and connectivity, their
limited battery life often creates challenges for users, especially when they are away from
home or office for extended periods. In public places, people frequently encounter situations
where their mobile batteries are drained, but charging facilities are either unavailable or
inaccessible. This problem is particularly severe in developing regions, rural areas, and
crowded public spaces where infrastructure limitations restrict access to conventional
charging points.
Traditional mobile charging solutions in public areas usually involve free charging stations or
manually operated power outlets. These systems suffer from several drawbacks, including
uncontrolled usage, power wastage, lack of security, and maintenance issues. Free charging
points are often misused, leading to excessive power consumption and equipment damage.
Additionally, such systems do not provide a fair usage mechanism, resulting in long waiting
times and inconvenience for users. In some cases, the absence of proper control mechanisms
leads to safety hazards such as overheating, short circuits, or unauthorized access to power
sources.
Another major concern is the absence of an automated and self-regulated charging
mechanism. Many existing charging stations require manual supervision or rely on honorbased usage, which is inefficient and impractical in high-traffic areas. The lack of a structured
payment mechanism also discourages service providers from installing charging stations, as
there is no direct return on investment. As a result, users are left without reliable charging
options during emergencies, travel, or long waiting periods.
Furthermore, from an energy management perspective, uncontrolled charging contributes to
unnecessary power consumption and increased electricity costs. In public spaces where
multiple devices are charged simultaneously without time restrictions, energy wastage
becomes a significant issue. This not only increases operational expenses but also negatively
impacts sustainability efforts aimed at reducing energy consumption. Therefore, there is a
pressing need for a controlled, automated, and user-paid mobile charging system that ensures
fair usage, minimizes power wastage, and provides a convenient service to the public.
9
The proposed Coin Based Mobile Charging System aims to overcome these limitations by
introducing an intelligent and automated solution. By integrating a coin-operated mechanism
with a microcontroller-based control system, the project ensures that charging is provided
only for a limited and predefined duration. This approach promotes responsible energy usage,
reduces misuse, and offers a practical solution for both users and service providers.
1.3 Objective of the Project
The primary objective of this project is to design and implement an efficient, automated, and
user-friendly Coin Based Mobile Charging System that provides controlled access to
mobile charging in public places. This objective is achieved through the integration of a multi
coin acceptor, Arduino Uno microcontroller, relay module, 12V to 5V USB power module,
and a 16×2 LCD display. The system is designed to be reliable, cost-effective, and suitable
for deployment in various public and semi-public environments.
One of the key objectives is to accurately detect and validate coins using a multi coin
acceptor. The coin acceptor identifies the inserted coin and generates corresponding electrical
pulses, which are sent to the Arduino Uno. The Arduino processes these pulses to determine
the charging duration assigned to the user. This mechanism ensures fair usage and prevents
unauthorized access to the charging facility.
Another important objective is to automate the charging process using a relay module
controlled by the Arduino. The relay acts as an electronic switch that enables or disables the
charging circuit based on the programmed logic. When a valid coin is detected, the relay is
activated, allowing power to flow to the USB charging port. Once the allocated charging time
expires, the relay automatically turns off, cutting the power supply and preventing overuse.
This automation eliminates the need for manual supervision and enhances system reliability.
The project also aims to provide real-time feedback to users through a 16×2 LCD display.
The LCD displays messages such as “Insert Coin,” “Charging Started,” “Time Remaining,”
and “Charging Completed,” making the system easy to use even for first-time users. This
visual interface improves user experience and reduces confusion during operation.
10
Cost efficiency and scalability are also key objectives of this project. The system is designed
using low-cost, readily available components, making it affordable for small businesses,
public service providers, and rural installations. Additionally, the modular design allows for
future upgrades, such as integrating digital payment methods, timers with variable charging
durations, or IoT-based monitoring systems.
In summary, the main objectives of this project include:
• Controlled Charging Access: Enable mobile charging only after valid coin insertion.
• Automation: Automatically start and stop charging using a relay controlled by Arduino.
• User Interface: Display charging status and instructions on a 16×2 LCD.
• Energy Efficiency: Reduce power wastage by limiting charging time.
• Cost-Effectiveness and Reliability: Develop a low-cost, durable, and easy-to-maintain
system suitable for public use.
11
CHAPTER 2
LITERATURE REVIEW
1.1 INTRODUCTION
In this chapter, we discuss previous research focused on the design and development of
automated and coin-operated power distribution and mobile charging systems. Various
approaches have been explored to provide controlled access to electrical power in public
places while ensuring energy efficiency and user convenience. The primary sources of
information include research papers, journals, technical reports, and conference publications
that highlight advancements in coin-operated systems, embedded control technologies, and
public charging infrastructure. These studies provide insights into different methods of power
control, user authentication, and automation techniques used in similar applications.
2.2 LITERATURE REVIEW
In this chapter, we present a comprehensive review of existing research and developments
related to coin-based and automated mobile charging systems, with a particular focus on
those utilizing microcontrollers, relay modules, power regulation units, and user interface
displays for controlled charging operations.
[1] R. Gupta, S. Mehta, and A. Khanna (2020) proposed a coin-operated mobile charging
station designed for public transportation hubs. The system uses a microcontroller to validate
coin inputs and activate charging ports for a predefined duration. Their work emphasizes
controlled power delivery to reduce misuse and energy wastage, while ensuring user
accessibility in crowded public environments.
[2] M. Patel and K. Shah (2019) developed an Arduino-based coin-operated power supply
system intended for mobile and small electronic device charging. The system integrates a
relay module to control the power flow and a regulated power supply to ensure safe charging.
The study highlights the effectiveness of using microcontrollers for time-based power control
in public charging applications.
12
[3] A. Verma and P. Joshi (2018) explored the use of coin acceptor modules in automated
service systems, including mobile charging units. Their research focused on signal processing
techniques used by coin acceptors to differentiate valid and invalid coins. The system
demonstrated improved reliability and reduced chances of unauthorized usage when
integrated with a microcontroller-based control unit.
[4] S. R. Kumar, N. Prakash, and V. Suresh (2017) designed a coin-based electrical power
control system using an Arduino microcontroller and relay switching mechanism. The system
allowed users to access electrical power for a limited time based on coin input. The study
emphasized the importance of automation in reducing manual supervision and improving
energy efficiency in public utility systems.
[5] L. Fernandez and M. Gomez (2017) presented a microcontroller-based public charging
system equipped with an LCD display for user interaction. The display provided real-time
feedback such as charging status and remaining time, improving user experience. The system
demonstrated that visual feedback plays a crucial role in making automated public systems
more user-friendly and intuitive.
[6] J. A. Mukred et al. (2020) developed a time-controlled power distribution system using a
coin-operated interface. Their design incorporated a microcontroller to manage power output
duration and a relay to isolate control circuitry from high-power loads. The system aimed to
minimize power wastage while providing a secure and controlled charging solution for public
use.
[7] S. Banerjee et al. (2017) proposed a smart coin-operated charging kiosk for mobile
devices, focusing on energy conservation and safety. The system included overcurrent
protection, regulated power output, and automated cutoff mechanisms. Their research
highlighted the importance of integrating safety features into public charging systems to
prevent damage to both devices and infrastructure.
[8] Md. R. Hossain et al. (2016) designed a digital coin-based power control unit using
embedded systems. The system allowed users to access electrical power only after successful
coin validation and automatically terminated the supply after the allocated time. The study
demonstrated the effectiveness of embedded control in managing shared power resources
efficiently.
13
[9] S. L. Mohammed et al. (2019) developed a microcontroller-based charging system with
precise timing control for mobile devices. The system used a regulated power module to
ensure stable voltage output and included indicators for system status. Experimental results
showed reliable operation with minimal voltage fluctuation, ensuring safe charging for
mobile devices.
[10] Autonomous Coin-Based Mobile Charging and Power Control System (2018) by M.
I. Bello, S. M. Gana, and M. J. Umar
Bello et al. developed an automated coin-operated charging system designed for public
environments. The system uses a coin acceptor module to generate pulses corresponding to
inserted coins, which are processed by an ATMEGA328-based microcontroller. The
controller activates a relay to supply power to USB charging ports for a fixed duration. The
system includes an LCD display to provide user instructions and charging status.
Experimental results demonstrated stable operation and effective power control, making the
system suitable for public deployment.
[11] Study on Automated Coin-Operated Charging Systems Using Microcontrollers
(2023) by A. Djalilov, E. Sobirov, O. Nazarov, and S. Urolov
Djalilov et al. investigated automated charging systems that utilize coin-based authentication
and microcontroller-controlled power delivery. The system measures charging duration based
on coin input and ensures automatic cutoff after the allotted time. The study reported high
reliability and low error rates in coin detection and timing accuracy. The findings suggest that
such systems can be effectively implemented in public charging facilities, reducing human
intervention and promoting efficient energy usage.
2.3 Summary
From the review of previous research, various methodologies have been applied for coinbased power distribution and mobile charging systems. Microcontroller-based solutions
provide accurate timing control, automation, and cost-effectiveness, while coin-operated
mechanisms ensure fair usage and reduced misuse of electrical power. The use of relay
modules and regulated power supplies has proven to be effective in delivering safe and
controlled charging output. This project builds upon these existing approaches by integrating
14
an Arduino Uno with a multi coin acceptor, relay module, 12V to 5V USB power module,
and a 16×2 LCD display to develop an efficient and automated coin based mobile charging
system suitable for public applications.
15
CHAPTER 3
METHODOLOGY
3.1 Introduction
The Coin Based Mobile Charging System is designed to provide an automated and controlled
mobile charging facility in public and semi-public environments. The system uses a multi
coin acceptor in combination with an Arduino Uno to validate user input and control the
charging process effectively. The system is equipped with a relay module and a 12V to 5V
USB power module that automatically activates when a valid coin is inserted and deactivates
once the allocated charging time expires. This setup ensures fair usage of electrical power,
prevents misuse, and eliminates the need for manual supervision, making it ideal for locations
such as railway stations, bus stops, shopping malls, educational institutions, and rural areas.
3.2 Block Diagram of Coin Based Mobile Charging System Model
Fig 3.1 Block Diagram
16
The block diagram of the coin based mobile charging system represents the key components
and their interconnections:
a) Arduino UNO
The Arduino UNO is a microcontroller board based on the ATmega328P. It is the central
processing unit of the project, responsible for receiving signals from the multi coin acceptor,
calculating the charging duration, and controlling outputs like the LCD display and relay
module. It supports easy programming through the Arduino IDE and is ideal for beginners
and embedded system applications due to its simplicity, affordability, and strong community
support.
b) Multi Coin Acceptor
The multi coin acceptor is used to detect and validate coins inserted by the user. It identifies
different denominations and generates corresponding electrical pulses. These pulses are sent
to the Arduino, which processes them to determine whether the coin is valid and how much
charging time should be allocated. The coin acceptor ensures secure and accurate user
authentication in public charging systems.
c) LCD Display (16×2)
The 16×2 LCD display is used to show system messages and charging status to the user. It
can display two lines with up to 16 characters each, making it ideal for simple information
output. The LCD displays messages such as “Insert Coin”, “Charging Started”, “Time
Remaining”, and “Charging Completed”, providing clear and real-time feedback during
system operation.
d) Relay Module (5V)
The relay module acts as a switch controlled by the Arduino to turn the charging circuit on or
off. It allows the low-power Arduino to safely control high-power electrical devices. When a
17
valid coin is detected, the Arduino activates the relay to enable power flow to the charging
module. Once the time expires, the relay disconnects the power supply automatically.
e) 12V to 5V USB Power Module
The 12V to 5V USB power module converts the input voltage into a regulated 5V output
suitable for mobile device charging. It ensures stable voltage and current delivery, protecting
mobile devices from damage due to voltage fluctuations. This module forms the core of the
power supply system and enables safe USB-based charging.
f) Mobile Charging Port
The mobile charging port provides the physical interface for users to connect their mobile
devices. It is connected to the USB power module and supplies regulated power when the
relay is activated. This port allows users to charge different types of mobile devices using
standard USB cables, ensuring compatibility and ease of use.
3.3 Flowchart of Working of the Model
18
The flowchart represents the sequential steps involved in the operation of the coin based
mobile charging system:
Fig 3.2 Flow Chart of Working of Model
1. Coin Detection:
o The multi coin acceptor detects and validates the inserted coin.
o The Arduino Uno receives the pulse signal and verifies its authenticity.
2. Charging Activation:
o If the coin is valid, the Arduino activates the relay module to start the charging
process.
3. Monitoring Process:
o The LCD display continuously updates the charging status and remaining time.
o The system monitors the countdown timer internally through the Arduino.
4. Charging Deactivation:
o Once the allocated charging time is completed, the relay turns off the power supply
automatically.
5. Automation and Efficiency:
o The entire process is automated to ensure controlled charging, energy efficiency,
and minimal human intervention.
19
CHAPTER 4
HARDWARE COMPONENTS
4.1 Arduino Uno
Fig 4.1 Arduino UNO
Arduino Uno is a microcontroller board and it having 14 output and input pins, in this 6 pins
used as PWM output,6 analog input,1 UARTs 16 having usb, power jack icsp button and reset
button, Vin, Gnd, serial communication, external interrupts, led can simply connect to a
computer and the supply AC to DC adapter or battery, operating voltage of this boards is 5 volt
and the range of the input will 7 to 12 volts, length of the board is about 68.6 mm and the width
is 53.4, the weight of this is 25 g, comparing to the Arduino Nano it having more space and
more processing, programming of the Arduino Uno can be done in pc with the c programming
language and it can transfer to the Arduino by using USB cables.
Hardware Features:
Microcontroller: ATmega328P – runs at 16 MHz.
I/O Pins: 14 digital I/O pins (6 of which support PWM), and 6 analog input pins.
Communication: UART, SPI, and I2C for serial communication.
20
Power: Operates at 5V and accepts input voltage from 7-12V via barrel jack or Vin
pin.
Memory: 32 KB Flash memory, 2 KB SRAM, and 1 KB EEPROM.
USB Interface: USB-B port used for uploading code and serial communication.
These features enable Arduino Uno to interface with various sensors, actuators, displays, and
modules, making it highly flexible for prototyping.
Pin Description:
Digital Pins (0-13): Used for digital input/output.
PWM Pins (3, 5, 6, 9, 10, 11): Provide analog output using Pulse Width Modulation.
Analog Pins (A0-A5): Used to read analog sensors.
Power Pins: Includes 5V, 3.3V, GND, and Vin for power management.
Reset Pin: Used to restart the microcontroller.
ICSP Pins: Used for in-system programming of the microcontroller.
Applications:
1. Home Automation: Arduino Uno is used to build systems that control lights, fans, and
other appliances based on sensor data.
2. IoT Projects: With Bluetooth, WiFi, or GSM modules, it can be part of smart systems
like weather stations or security alarms.
3. Robotics: Controls motor drivers and sensors in mobile robots.
4. Data Logging Systems: Collects and stores sensor data like temperature or humidity
over time.
5. Water Level Monitoring: In this project, Arduino reads distance from an ultrasonic
sensor, calculates the water level, and controls a pump using a relay.
21
4.2 Ultrasonic Sensor (HC-SR04)
Fig 4.2 Ultrasonic Sensor
The HC-SR04 Ultrasonic Sensor is a key component in the water level monitoring system. It
operates by emitting ultrasonic sound waves, which travel through the air and bounce back
upon hitting the water surface. The sensor then calculates the time taken for the echo to return
and determines the distance using the speed of sound principle. This measured distance helps
in calculating the exact water level in the tank or reservoir. The HC-SR04 sensor consists of a
transmitter and a receiver, with an operational range of 2 cm to 400 cm and an accuracy of
around 3 mm. It requires a 5V power supply and works efficiently with the Arduino Uno. The
sensor is connected to the Arduino via Trigger and Echo pins, which are controlled through
programming. This real-time distance measurement is processed by the Arduino to display the
water level on an LCD screen and trigger alerts when necessary.
Hardware Features:
Measurement Range: 2 cm to 400 cm, making it suitable for medium-range
applications.
Operating Voltage: 5V DC, compatible with Arduino and other microcontrollers.
Accuracy: ±3 mm, which is quite precise for water level monitoring.
Triggering Time: Minimum 10 µs pulse required.
Low Power Consumption: Efficient for battery-operated systems.
22
These features make it ideal for projects requiring accurate, real-time distance detection in a
compact form factor.
Pin Description:
VCC: Connects to +5V power supply from the Arduino.
GND: Ground connection, common with Arduino GND.
TRIG (Trigger): The pin that receives a HIGH pulse (10 µs) to initiate the ultrasonic
burst.
ECHO: Outputs a pulse corresponding to the time it takes for the echo to return.
Arduino reads this duration to calculate distance.
Applications:
1. Water Level Detection: Measures the distance from the sensor to the water surface,
enabling precise water level calculations.
2. Obstacle Detection in Robots: Helps in identifying objects or walls to avoid collisions.
3. Parking Assistance Systems: Used in cars to detect the distance to nearby obstacles
while parking.
4. Smart Trash Bins: Detects fill levels of bins to optimize waste collection.
5. Security Systems: Senses motion or presence of intruders in restricted zones.
23
4.3 LCD Display (16x2)
Fig 4.3 LCD Display 16*2
The LCD Display (16x2) is an essential component of the water level monitoring system,
responsible for displaying the real-time percentage of water present in the tank. It operates by
receiving processed data from the Arduino Uno, which calculates the water level based on
ultrasonic sensor readings. The display is connected to the Arduino using multiple pins: VCC
and GND provide power, while the data pins (D4 to D7) facilitate communication. The RS
(Register Select) pin is connected to a digital pin on the Arduino to differentiate between
command and data signals, while the E (Enable) pin is used to trigger the display. The LCD
uses a 5V power supply, ensuring compatibility with the Arduino Uno. The code running on
the Arduino continuously updates the display, ensuring real-time monitoring of water levels.
This feature allows users to visually assess the water level and take necessary actions before
overflow or depletion occurs.
Hardware Features:
Display Format: 16 characters × 2 lines.
Controller: Based on the HD44780 LCD controller.
Operating Voltage: 4.7V to 5.3V, fully compatible with Arduino Uno.
Backlight: LED backlight for better visibility in low-light conditions.
24
Low Power: Draws minimal current, ideal for embedded applications.
Pin Description:
VSS: Ground.
VDD: +5V power supply.
VO: Contrast adjustment pin (typically connected to a potentiometer).
RS (Register Select): Selects command or data register. LOW = command, HIGH =
data.
RW (Read/Write): Read or write mode. Tied to GND (write-only) in most projects.
E (Enable): Enables the module to latch data at a falling edge.
D0–D7: 8-bit data lines (in 4-bit mode, only D4 to D7 are used).
A/K: Pins for backlight (Anode and Cathode).
Applications:
1. Water Level Display: Shows percentage of water level in real time using data from
the Arduino.
2. Temperature/Humidity Monitors: Displays sensor readings for user convenience.
3. Digital Clocks: Used to show real-time clock values.
4. Menu Systems in Embedded Projects: Provides a simple interface to change settings.
5. Home Automation Interfaces: Displays the status of lights, fans, and other appliances.
25
4.4 Buzzer
Fig 4.4 Buzzer
The buzzer acts as an alert mechanism, warning when the water level is critically high or low.
It is connected to a digital output pin of the Arduino Uno and is triggered when the ultrasonic
sensor detects that the water level exceeds a predefined threshold. The Arduino processes the
sensor's data and, upon crossing the limit, activates the buzzer to emit a loud sound, notifying
users to take action. This helps in preventing overflow or depletion of water. The buzzer
operates on 5V, matching the Arduino's power requirements, and is connected with a resistor
to regulate current flow. The connection setup includes linking one terminal of the buzzer to
the Arduino’s digital pin and the other to ground. This ensures an efficient, automated alert
system, improving the reliability of water level monitoring.
Hardware Features:
Operating Voltage: 5V DC.
Sound Level: Approximately 85 dB at 10 cm.
Current Consumption: ~30 mA, low power consumption.
Polarity Sensitive: Must be connected with the correct positive and negative
terminals.
Easy Control: Can be turned on/off by a single digital pin.
Pin Description:
26
Positive (+): Connected to a digital output pin of Arduino.
Negative (–): Connected to GND. Optionally, a resistor can be added in series for
current limiting.
Applications:
1. Water Overflow Alarm: Sounds when water level exceeds a threshold.
2. Security Systems: Alerts in case of unauthorized access or motion detection.
3. Fire Alarms: Integrated into systems to produce loud warning sounds.
4. Reverse Parking Sensors: Beeps based on distance from obstacles.
5. Appliance Notifications: Used in microwave ovens and washing machines to signal
task completion.
4.5 Relay ( 5 volt )
Fig 4.5 Relay Module
The 5V relay module and 5V motor pump play a crucial role in the water level management
system. The relay acts as a switch that controls the pump, allowing it to turn on or off based on
the water level detected by the ultrasonic sensor. The relay is connected to the Arduino through
a digital pin, enabling automated control. When the water level drops below the threshold, the
Arduino signals the relay to activate the pump, filling the tank. Once the water reaches the
27
desired level, the relay turns off the pump to prevent overflow. The relay is powered by a 5V
supply from the Arduino, while the motor pump operates with a separate power source,
ensuring stable operation. The pump is connected to the relay’s output terminals, allowing for
seamless switching based on Arduino's instructions. This setup ensures efficient water level
management without manual intervention.
Hardware Features (Relay):
Operating Voltage: 5V (logic level).
Load Support: Can switch AC/DC loads up to 10A at 250V AC or 30V DC.
Isolation: Optocoupler provides electrical isolation between Arduino and the relay.
Status LED: Indicates ON/OFF state of the relay.
Trigger Logic: Active LOW (relay turns ON when input pin is LOW).
Pin Description (Relay):
VCC: +5V power from Arduino.
GND: Ground connection.
IN: Control signal from Arduino (digital pin).
COM (Common): Common contact for switching.
NO (Normally Open): Open by default, closes when relay is activated.
NC (Normally Closed): Closed by default, opens when relay is activated
28
CHAPTER 5
SOFTWARE IMPLEMENTATION
5.1 Arduino IDE
Fig.5.1 Arduino IDE
29
Arduino code is written in C++ with an addition of special methods and functions, which we’ll
mention later on. C++ is a human-readable programming language. When you create a ‘sketch’
(the name given to Arduino code files), it is processed and compiled to machine language.
Arduino IDE
The Arduino Integrated Development Environment (IDE) is the main text editing program used
for Arduino programming. It is where you’ll be typing up your code before uploading it to the
board you want to program. Arduino code is referred to as sketches.
Figure 1Fig.6.1 Circuit Diagram of Water Level Indicator
Fig.5.2 Arduino code example
Arduino code example
As you can see, the IDE has a minimalist design. There are only 5 headings on the menu bar,
as well as a series of buttons underneath which allow you to verify and upload your sketches.
Essentially, the IDE translates and compiles your sketches into code that Arduino can
understand. Once your Arduino code is compiled it’s then uploaded to the board’s memory.
All the user has to do to start compiling their sketch is press a button (a guide to this can be
found below).
30
If there are any errors in the Arduino code a warning message will flag up prompting the user
to make changes. Most new users often experience difficulty with compiling because of
Arduino’s stringent syntax requirements. If you make any mistakes in your punctuation when
using Arduino, the code won’t compile and you’ll be met with an error message.
Serial Monitor and Serial Plotter
Arduino serial monitor can be opened by clicking on the magnifying glass icon on the upper
right side of the IDE or under tools. The serial monitor is used mainly for interacting with the
Arduino board using the computer, and is a great tool for real-time monitoring and debugging.
In order to use the monitor, you’ll need to use the Serial class.
Arduino serial plotter is another component of the Arduino IDE, which allows you to
generate a real-time graph of your serial data. The serial plotter makes it much easier for you
to analyze your data through a visual display. You’re able to create graphs, negative value
graphs, and conduct waveform analysis.
Fig 5.3 Arduino Serial Monitor
Debugging Arduino Code and Hardware
Unlike other software programming platforms, Arduino doesn’t have an onboard debugger.
Users can either use third-party software, or they can utilize the serial monitor to print
Arduino’s active processes for monitoring and debugging.
31
By using the Serial class, you can print to the serial monitor, debugging comments and values
of variables. On most Arduino models, this will be using serial pins 0 and 1 which are
connected to the USB port.
From Software to Hardware
There is a lot to be said of Arduino’s software capabilities, but it’s important to remember
that the platform is comprised of both software and hardware. The two work in tandem to run
a complex operating system.
Code → Compile → Upload → Run
At the core of Arduino, is the ability to compile and run the code.
After writing the code in the IDE you need to upload it to the Arduino. Clicking the Upload
button (the right-facing arrow icon), will compile the code and upload it if it passed
compilation. Once your upload is complete, the program will start running automatically.
You can also do this step by step:
1.
First, compile the code. To do this simply click the check icon (or click on sketch >
Verify / Compile in the menu bar.––––
Fig 5.4 Arduino IDE Code Compiling
32
As you can see, the check icon is located in the top left underneath the “File” tag in the menu
section.
Once you’ve done this, Arduino will start to compile. Once it's finished, you’ll receive a
completion message that looks like this:
As you can see, the green line at the bottom of the page tells you that you’re “done
compiling”. If your code fails to run, you’ll be notified in the same section, and the
problematic code will be highlighted for editing.
Once you’ve compiled your sketch, it’s time to upload it.
1.Choose the serial port your Arduino is currently connected to. To do this click on Tools >
Serial port in the menu to designate your chosen serial port (as shown earlier above). You can
then upload the compiled sketch.
2.To upload the sketch, click on the upload icon next to the tick. Alternatively you can go the
the menu and click File> upload. Your Arduino LEDS will flicker once the data is being
transferred.
Once complete, you’ll be greeted with a completion message that tells you Arduino has
finished uploading.
Setting Up Your IDE
In order to connect an Arduino board to your computer you need a USB cable. When
using the Arduino UNO, the USB transfers the data in the program directly to your
board. The USB cable is used to power your arduino. You can also run your Arduino
through an external power source.
Before you can upload the code, there are some settings that you need to configure.
Choose your board - You need to designate which Arduino board you’re going to be
using. Do this by click Tools > Board > Your Board.
33
Fig 5.5 Selecting Board
Choose your processor- there are certain boards (for example Arduino pro-mini) for
which you need to specify which processor model you have. Under tools > processor >
select the model you have.
34
Choose your port - to select the port to which your board is connected, go to tools >
Port > COMX Arduino (This is Arduino’s serial port).
35
CHAPTER 6
IMPLEMENTATION AND RESULTS
6.1 Implementation
The implementation of the Water Level Indicator system involves assembling the hardware
components, integrating them with the Arduino Uno, and developing the necessary software
for automation. The ultrasonic sensor is mounted at the top of the water tank to measure the
distance from the water surface. The Arduino Uno processes the sensor data to determine the
water level percentage and displays it on the LCD screen. The relay module is connected to the
motor pump, which operates based on the water level readings. When the water level falls
below the predefined threshold, the Arduino sends a signal to the relay module, activating the
pump. Once the maximum level is reached, the relay turns off the pump, ensuring efficient
water management. The buzzer is triggered when critical water levels are detected, providing
an additional alert system
.
6.2 Results
The system was successfully implemented and tested in various conditions. The ultrasonic
sensor accurately measured the water level, and the LCD displayed real-time updates. The
motor pump operated as expected, activating and deactivating according to the set thresholds.
The buzzer effectively alerted users when the water reached critical levels. The results
demonstrate that the system efficiently automates water level monitoring and control, reducing
manual intervention and minimizing water wastage. The accuracy of the ultrasonic sensor
readings and the responsiveness of the relay-controlled motor pump validate the reliability of
the system.
36
Fig.6.1 Circuit Diagram of Water Level Indicator
This project is a Water Level Monitoring System using an Arduino Uno, Ultrasonic
Sensor, 16x2 LCD Display, 5V Relay Module, and a Water Pump. The system monitors
the water level in a tank using the HC-SR04 ultrasonic sensor and displays the level on the
LCD. When the water level drops below a certain threshold, the pump is automatically turned
ON via the relay. A buzzer alerts the user during critical levels or pump activation.
� Key Components:
Component
Arduino Uno
Function
Acts as the brain of the project, processing sensor data and controlling
output devices.
HC-SR04 Sensor Measures distance (water level) using ultrasonic sound waves.
16x2 LCD
Displays water level percentage or status messages (like "Pump
Display
ON/OFF").
37
Component
Relay Module
(5V)
Function
Controls the water pump by acting as a switch triggered by the Arduino.
Water Pump
Pumps water into the tank when level is low.
Buzzer
Gives audible alerts during low water level or pump activity.
18650 Batteries
Provide power supply to the relay and Arduino system.
Potentiometer
Used to adjust the contrast of the LCD display.
⚡ Working Principle:
1. The Ultrasonic Sensor measures the distance between the sensor and the water
surface.
2. Arduino calculates the water level percentage based on tank height.
3. The LCD displays the current water level.
4. If the water level is below a defined threshold, Arduino:
o
Activates the relay, turning ON the pump.
o
Triggers the buzzer to indicate low level.
5. Once the water reaches the required level, the system automatically stops the pump.
Connections Summary:
Ultrasonic Sensor:
o
VCC to 5V, GND to GND
o
Trig to Arduino pin (e.g., D9), Echo to Arduino pin (e.g., D10)
LCD 16x2:
o
RS, E, D4-D7 connected to Arduino digital pins
o
VSS, RW, GND, VDD for power and control
o
Potentiometer middle pin to VO for contrast
Relay Module:
38
o
IN to Arduino pin (e.g., D7), VCC and GND
o
NO/NC terminals connect to the pump’s power circuit
Buzzer:
o
Positive to Arduino digital pin, GND to Arduino GND
Power Supply:
o
18650 batteries connected to provide stable power to relay and pump
Applications:
Domestic water tank automation
Smart irrigation systems
Industrial fluid management
Rainwater harvesting automation
39
CHAPTER 7
CONCLUSION AND OUTCOME
7.1 Conclusion
The implementation of the Water Level Indicator using an ultrasonic sensor and Arduino Uno
has successfully provided an automated and efficient solution for water level monitoring and
management. The system accurately detects water levels, displays real-time information on an
LCD screen, and operates a motor pump through a relay module. The inclusion of a buzzer
further enhances alert mechanisms, ensuring timely intervention when required. The results
validate that this system significantly reduces manual effort, prevents water wastage, and
enhances resource efficiency.
The Water Level Indicator using Ultrasonic Sensor and Arduino Uno is a simple and
efficient system for monitoring water levels. It measures water height using ultrasonic waves
and displays real-time data on an LCD. A buzzer provides alerts when critical levels are
reached, preventing overflow and water shortages. This project is useful in homes, agriculture,
and industries, offering automation and reliability. Future enhancements include IoT-based
remote monitoring and solar-powered operation for sustainability.
7.2 Future Work
Future improvements to the system can include the following enhancements:
Adding IoT capabilities will enable remote monitoring and control of water levels
through a mobile application.
Implementing a GSM module can allow the system to send SMS notifications for
critical water levels.
Utilizing solar power can improve energy efficiency and make the system more
sustainable.
Integrating multiple sensors will enhance accuracy and allow large-scale applications
in industrial and agricultural setups.
40
These improvements can further enhance the reliability and scalability of the water level
monitoring system, making it a more effective solution for water conservation and
management.
7.3 Outcome
The developed system offers a cost-effective, user-friendly, and reliable solution for automatic
water level monitoring. It eliminates the need for manual checks, ensures efficient water usage,
and helps in reducing operational costs. The successful deployment of this project demonstrates
its practical applicability in residential, industrial, and agricultural settings, contributing to
improved water conservation and management.
The prototype was tested and demonstrated effective functionality.
The system successfully monitored water levels using an ultrasonic sensor and
displayed real-time data.
The project proved to be a cost-effective and reliable solution for efficient water
management in residential and industrial settings.
41
REFERENCES
[1] A. Kumar, R. Sharma, and S. Patel, “Automatic Water Level Monitoring and Control
System Using IoT,” International Journal of Engineering Research and Applications, vol.
10, no. 5, pp. 12-17, May 2020.
[2] P. Singh and M. Verma, “Smart Water Level Indicator with Motor Pump Automation,”
International Journal of Electronics and Com
munication Technology, vol. 8, no. 4, pp.
56–60, 2018.
[3] K. Nair and R. Menon, “Water Level Control Using Ultrasonic Sensor and Relay
Module,” International Journal of Emerging Technology and Advanced Engineering, vol. 9,
no. 2, pp. 34–39, 2019.
[4] L. Fernandez and J. Diaz, “Arduino-Based Water Tank Monitoring System,”
International Journal of Advanced Research in Computer Engineering & Technology, vol. 6,
no. 3, pp. 142–145, 2017.
[5] Jameel A. A. Mukred, Saed A. H. Ameen, Md. Nasir Sulaiman, “Pump Switching System
Using Ultrasonic Sensor Based Water Level Indicator,” Journal of Telecommunication,
Switching Systems and Applications, vol. 3, no. 2, pp. 21–26, 2020.
[6] R. S. Sunmonu, M. A. Sodunke, and E. A. Agboola, “Design and Implementation of an
Ultrasonic Sensor-Based Water Level Indicator and Pump Control,” Nigerian Journal of
Technology (NIJOTECH), vol. 36, no. 4, pp. 1050–1057, 2017.
[7] Madhurima Santra, Arpita Chowdhury, Anindya Pal, “Smart Wireless Water Level
Monitoring and Pump Controlling System,” International Journal of Advanced Scientific
Research and Engineering, vol. 3, no. 4, pp. 100–104, 2017.
[8] Md. Sourove Akther Momin et al., “Digital Water Level Indicator with Automatic Pump
Controlling,” International Journal of Research (IJR), vol. 3, no. 6, pp. 87–91, 2016.
[9] Saleem Latteef Mohammed et al., “Ultrasonic Sensor-Based Smart Water Level
Monitoring System,” IOP Conference Series: Materials Science and Engineering, vol. 518,
pp. 042025, 2019.
42
ANNEXURE
Code for the Water Level Indicator
#include <LiquidCrystal.h>
#define MIN 5 // Minimum distance (Tank Full)
#define MAX 24 // Maximum distance (Tank Empty)
#define TRIG 9
#define ECHO 8
#define BUZZER 10 // Buzzer connected to pin D10
#define PUMP 11 // Pump motor control pin (via relay)
const int rs = 2, en = 3, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
Serial.begin(9600);
pinMode(TRIG, OUTPUT);
pinMode(ECHO, INPUT);
pinMode(BUZZER, OUTPUT); // Buzzer pin
pinMode(PUMP, OUTPUT); // Pump control pin
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("Tank Level");
}
void loop() {
long duration;
float distanceCm, levelPercent;
// Trigger Ultrasonic sensor
digitalWrite(TRIG, LOW);
delayMicroseconds(2);
digitalWrite(TRIG, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG, LOW);
// Read Echo pin
duration = pulseIn(ECHO, HIGH);
distanceCm = duration * 0.0343 / 2; // Distance in cm
Serial.print("Distance: ");
Serial.print(distanceCm);
Serial.println(" cm");
lcd.setCursor(0, 1);
43
if (distanceCm <= MIN) {
lcd.print("Tank is Full ");
digitalWrite(BUZZER, HIGH); // Buzzer ON
digitalWrite(PUMP, LOW); // Pump OFF (Assuming LOW stops the pump relay)
}
else if (distanceCm >= MAX) {
lcd.print("Tank is Empty ");
digitalWrite(BUZZER, LOW); // Buzzer OFF
digitalWrite(PUMP, HIGH); // Pump ON
}
else {
// Calculate percentage
levelPercent = ((MAX - distanceCm) / (MAX - MIN)) * 100;
lcd.print("Level: ");
lcd.print(levelPercent, 0);
lcd.print("% ");
digitalWrite(BUZZER, LOW); // Buzzer OFF
digitalWrite(PUMP, HIGH); // Pump OFF (optional: change to HIGH if you want it ON
in this state)
}
delay(500);
}
44
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )