Arduino Water Level Monitoring System
Arduino Water Level Monitoring System
ON
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE AND ENGINEERING
Submitted By
K.NEERAJA (228R1A0534)
A.TEJASWINI (228R1A0509)
A.PRADEEP (238R5A0501)
K.JEEVAN KUMAR (228R1A0532)
2023-2024
CMR ENGINEERING COLLEGE
(UGC AUTONOMOUS)
(Accredited by NBA, Approved by AICTE NEW DELHI, Affiliated to JNTU, Hyderabad)
Kandlakoya, Medchal Road, Hyderabad-501 401
CERTIFICATE
This is to certify that the project entitled “ MEASURING WATER LEVEL USING
ARDUINO” is a bonafide work carried out by
K.NEERAJA (228R1A0534)
A.TEJASWINI (228R1A0509)
K.JEEVAN KUMAR (228R1A0532)
A.PRADEEP (238R5A0501)
In partial fulfilment of the requirement for the award of the degree of BACHELOR OF TECHNOLOGY
in COMPUTER SCIENCE AND ENGINEERING from CMR Engineering College, UGC Autonomous,
affiliated to JNTU, Hyderabad, under our guidance and supervision.
The results presented in this Real-Time Research Project have been verified and are found to be satisfactory.
The results embodied in this project have not been submitted to any other university for the award of any
other degree or diploma.
This is to certify that the work reported in the present project entitled “MEASURING WATER
LEVEL USING ARDUINO ” is a record of bonafide work done by us in the Department of
Computer Science and Engineering, CMR Engineering College, JNTU Hyderabad. The reports are
based on the project work done entirely by us and not copied from any other source. We submit our
project for further development by any interested students who share similar interests to improve the
project in the future.
The results embodied in this project report have not been submitted to any other University or Institute
for the award of any degree or diploma to the best of our knowledge and belief.
K.NEERAJA (228R1A0534)
A.TEJASWINI (228R1A0509)
K.JEEVAN KUMAR (228R1A0532)
A.PRADEEP (238R5A0501)
ACKNOWLEGMENT
We are extremely grateful to Dr. A. Srinivasula Reddy, Principal and Dr. Sheo Kumar,
HOD, Department of CSE, CMR Engineering College for their constant support.
I am extremely thankful to Mr.K.VIJAYA BABU, Assistant Professor, Internal Guide,
Department of CSE, for his constant guidance, encouragement and moral support throughout the
Project.
I will be failing in duty if I do not acknowledge with grateful thanks to the authors of the
references and other literatures referred in this Project.
I express my thanks to all staff members and friends for all the help and co-ordination extended
in bringing out this Project successfully in time.
Finally, I am very much thankful to my parents who guided me for every step.
K.NEERAJA (228R1A0534)
A.TEJASWINI (228R1A0509)
A.PRADEEP (238R5A0501)
ABSTRACT
This project explores the development and implementation of a measuring water level system using
an Arduino Uno microcontroller, an HC-SR04 ultrasonic sensor, and a 16x2 LCD display. The
primary objective is to provide an accurate, real-time water level monitoring solution that is both
cost-effective and easy to deploy. The HC-SR04 ultrasonic sensor is utilized for its capability to
measure distances accurately by emitting ultrasonic waves and measuring the time it takes for the
echo to return. This distance data is then processed by the Arduino Uno to calculate the water level.
The measured water level is subsequently displayed on a 16x2 LCD screen, providing a clear and
immediate visual representation of the water level status. This system can be applied in various fields,
including water tanks, reservoirs, and irrigation systems, where monitoring and maintaining optimal
water levels is crucial. The project demonstrates the integration of simple electronic components to
create an effective water level monitoring solution, highlighting its potential for scalability and
adaptability to different water management needs. Key benefits of this system include low cost, ease
of assembly, and the capability for real-time monitoring, making it a practical solution for both
domestic and industrial applications. The project emphasizes the importance of accurate water level
measurement in resource management and aims to contribute to more efficient water usage and
conservation.
CONTENTS
TOPIC PAGE NO
ABSTRACT vi
1. INTRODUCTION
2. LITERATURE SURVEY 5
6.RESULTS 27
7.CONCLUSION 31
8. FUTURE ENHANCEMENTS 32
9. REFERENCES 33
1.INTRODUCTION
Efficient water management is crucial for a variety of applications ranging from domestic water tanks
to large-scale irrigation systems. Accurate water level measurement is fundamental in ensuring the
effective use of water resources, preventing overflows, and avoiding dry conditions that could damage
pumps or other equipment. Traditional methods of monitoring water levels, such as manual checking
or using mechanical floats, can be cumbersome, inaccurate, and not suitable for real-time monitoring.
This project aims to address these challenges by developing a water level measuring system using
readily available and cost-effective components: the Arduino Uno microcontroller, the HC-SR04
ultrasonic sensor, and a 16x2 LCD display. The Arduino Uno serves as the central processing unit of
the system, handling the data acquisition from the ultrasonic sensor and controlling the display of
information.
The HC-SR04T ultrasonic sensor is an integral component due to its capability to measure distances
accurately through the use of ultrasonic waves. It sends out an ultrasonic pulse and measures the time
it takes for the echo to return. This time difference is used to calculate the distance to the water
surface, which directly correlates to the water level in the tank or reservoir.
The 16x2 LCD display is employed to provide a user-friendly interface, allowing for immediate and
clear visualization of the water level data. The display shows real-time water level measurements,
enabling users to monitor the water level at a glance without the need for additional devices or
software.
1
By integrating these components, this project presents a comprehensive solution to water level
monitoring challenges. It highlights the potential of using modern microcontroller technology and
sensors to enhance traditional water management practices. The following sections will detail the
design, implementation, and testing of the water level measuring system, demonstrating its
effectiveness and potential applications.
The problem addressed by this project is the inefficiency and inaccuracy of traditional water level
monitoring methods, which often rely on manual checks or mechanical floats. These conventional
approaches are labor-intensive, prone to errors, and do not provide real-time data, leading to potential
issues such as water wastage, overflow, and damage to pumps or other equipment. In many cases, the
lack of timely and precise water level information can result in suboptimal water resource
management, impacting both domestic and industrial applications. This project aims to solve these
issues by developing an automated water level measuring system using an Arduino Uno, HC-SR04T
ultrasonic sensor, and a 16x2 LCD display, which provides accurate, real-time water level data and a
user-friendly visual interface, thus improving efficiency and effectiveness in water management.
2
1.4 Existing System and Disadvantages:
1.4.1 Existing System
The existing water level measuring system utilizing Arduino Uno, HC-SR04 ultrasonic sensor, and a 16x2
LCD display provides a cost-effective and accessible solution for real-time water level monitoring. However,
this system does have its drawbacks. Moreover, the accuracy of ultrasonic sensors can be compromised by
environmental factors such as temperature fluctuations and obstacles in the sensor's path, leading to
inaccuracies in measurements. Additionally, the 16x2 LCD display, while providing real-time monitoring,
offers limited space for displaying detailed information or trends over time, limiting the system's usability.
Furthermore, the lack of connectivity options for remote monitoring or data logging restricts the system's
potential for broader applications.
Advantages:
1. Cost-effective: Arduino Uno and HC-SR04 are relatively inexpensive components, making
this project affordable.
2. Ease of programming: Arduino platform offers a beginner-friendly environment for
programming, making it accessible to hobbyists and beginners.
3. Real-time monitoring: With the LCD display, users can see the water level in real-time
without needing to connect to a computer or smartphone.
4. Customization: The project can be customized and expanded with additional sensors or
features, depending on the requirements.
1.4.2 Disadvantages:
1. Limited range: HC-SR04 has a limited range, typically up to a few meters. This limits the
depth of water bodies that can be effectively measured.
2. Inaccuracy: Ultrasonic sensors can be affected by environmental factors such as temperature,
humidity, and obstacles in the path of the sound waves, leading to inaccuracies in
measurements.
3. Limited display: A 16x2 LCD display may not provide sufficient space to display detailed
information or trends over time, limiting the usability of the system.
4. Limited connectivity: While the project provides real-time monitoring through the LCD
display, it lacks connectivity options for remote monitoring or data logging, which may be
desired in some applications.
3
1.5 Proposed System with features
The proposed water level measuring system using Arduino Uno, HC-SR04 ultrasonic sensor, and a
16x2 LCD display aims to significantly enhance the existing setup by addressing its limitations and
incorporating advanced features. Key improvements include automatic calibration routines to adjust
for environmental factors, thereby increasing measurement accuracy. Additionally, the display will
be upgraded to a larger or more detailed interface, such as graphical LCD, for better visualization of
trends. Enhanced power management will ensure longer battery life for remote deployments. These
enhancements will create a more accurate, reliable, and versatile water level monitoring system
suitable for a wide range of applications.
Features of water level measuring :
The proposed water level measuring system aims to enhance the existing setup by integrating
additional features and improvements to address its limitations. Using the Arduino Uno, HC-SR04
ultrasonic sensor, and a 16x2 LCD display, the system will be optimized for greater accuracy,
reliability, and usability. Key features of the proposed system include:
By incorporating these features, the proposed system will offer a more robust, accurate, and versatile
solution for water level measurement, making it suitable for a wider range of applications and
providing users with greater insights and control over their water resources.
4
2. LITREATURE SURVEY
[1] Charles A, “IOT BASED WATER LEVEL MONITORING SYSTEM USING LABVIEW”,
International Journal of Pure and Applied Mathematics, Volume 118 No. 20 2018, 9-14 ISSN: 1311-
8080 (printed version); ISSN: 1314-3395 (on-line version). This paper illustrates a solution of water
scarcity faced by many societies and world in 21st century. The proposed paper focused on IOT based
monitoring system, implementation, management of water distribution in large areas. The monitoring
system was implemented by Ultrasonic sensors and Node MCU. This is non-contact water level
management. By the system, water is transferred to several tanks from the ground water or dam, there
water is pumped to tanks by motors. Each pump connected to each tank by solenoid valves, used to
control the water flow to each tanks. The solenoid valves get turned on by USB6009 (DAQ Assist)
with LABVIEW. The main function of DAQ is sending digital pulses to get valves ON. Ultrasonic
sensors that measures the distance of water level in the tank & the data is displayed in the IoT devices.
The received date is sent to google cloud platform. We can also retrieve the data from the webpage
that will display in LAB VIEW front panel. Network of sensors has been used to buffer efficient
water circulations. The included NI-DAQmx driver and configuration utility simplify configuration
and measurement.
5
to be a key technology enhancement for 4G LTEAdvancedsystems, and is anticipated to maintain
itsdominance in 5G systems as well.
[3] Neena Mani, Sudeesh T.P, Vinu Joseph, Titto V.D, Shamnas P.S, “Design and Implementation
of a Automated Water Level Indicator”, International Journal of Advanced Research in Electrical,
Electronics and Instrumentation Engineering 2014 Vol 3 Issue 2, February 2014. Water level
indicator is widely used in many industries and houses .In this paper a programmed microcontroller
is the basic component for the water level indicator. AT mega 32A microcontroller is helps to indicate
the level of water or any other conducting liquid.. With the help of an lcd display we can see all the
level of the water contained in a tank or in any other vessels. A liquid level sensor (transistor circuit)
detects the present level of the liquid in the tank in terms of the voltage across transistor and feeds it
to the microcontroller and the microcontroller generates a corresponding output text which in then
displayed in the LCD. If the water level is full, then the circuits beeps through the buzzer notifying
that the water level is full. The circuit is divided into two parts. First one is the microcontroller section
which is kept on the breadboard and second is the transmitter section and its base is kept inside the
water tank. The collector terminals of each of these transistors are connected to a +5 volt level. The
emitter terminals are connected to input pins of PORT A of the microcontroller. The microcontroller
continuously monitors the state of each of these input pins. If the first pin, which is the one
corresponding to the quarter level of the tank is high then LCD displays “quarter”. If both the first
and second pins are high, then LCD displays “half full”. Similarly if the first three pins are high then
we infer from the LCD that the water level is three quarters of the tank. Likewise a high on all four
pins displays the message “full”. Once the water tank is full, the buzzer produces a short audible
sound warning the user to switch off the motor.
[4] Jadhav, G. J, “Design and Implementation of Advanced ARM Based Surveillance System using
Wireless Communication, International Journal of Advance Research in Computer Science and
Management Studies” Vol 2, 2014. This proposed paper is focused on the notion of water level
monitoring and management within the context of electrical conductivity of the water. More
specifically, It illustrates investigation of the microcontroller based water level sensing and
controlling in a wired and wireless environment. Water Level management approach would help in
reducing the home power consumption and as well as water overflow.it can indicate the amount of
water in the tank that can support Global Water types including cellular dataloggers, satellite data
transmission systems for remote water monitoring system. At the first stage of design a water level
sensor is been made for sensing water level accurately. Microcontroller is used to control the overall
system automatically that reduces the design and control complexity. Microcontroller takes input
from the sensor unit which senses the water level through inverter. After processing input variables,
6
resultant output decides the water pump’s action (on/off) with respect to current water status of the
tank. The main intension of this research work was to establish a flexible, economical and easy
configurable system which can solve our water losing problem. We have been used a low cost PIC
16F84A microcontroller in this system which is the key point to reduce.
[5] Priya B. Patel, Viraj M. Choksi, Swapna Jadhav, M.B. Potdar, “Smart Motion Detection System
using Raspberry Pi”, International Journal of Applied Information Systems (IJAIS), Vol10 – No.5,
February 2016. The paper illustrates to make a smart surveillance system which can be monitored by
owner remotely. As it is connected with the system with IOT, system will send the notifications when
an intrusion is detected inside the room. It is required to develop and implement affordable low cost
web-camera based surveillance system for remote security monitoring. Authorized user can access to
their monitoring system remotely via internet with the use a mobile phone and monitor the situation
on application. This project describes the use of low-cost single – board computer Raspberry Pi with
wireless internet. This work is focused on developing a surveillance system that detects stranger and
to response speedily by capturing and relaying images to admin office based wireless module and
thus activate the alert system both at intruder location and office admin. Surveillance System consists
of mainly two parts: A. Hard-wired surveillance systems: These systems use wires to connect the
cameras, motion detectors, power supply and LAN cable with the pi., Remote Access Systems. 2.
USB Camera, Raspberry Pi, Android device, PIR sensor whose sensitivity range up to 20 feet (6
meters) 110 degrees * 60 degrees. Softwares like Python, NOOBS, PUTTY, RASPBIAN OS are to
be used. Therefore this kind of real time Surveillance system has great prospect of in building a
secured digital world.
[6] S. M. Khaled Reza, Shah Ahsanuzzaman Md. Tariq, “Microcontroller Based Automated Water
Level Sensing and Controlling: Design and Implementation Issue”, Proceedings of the World
Congress on Engineering and Computer Science 2010 Vol I WCECS 2010, October 20- 22, 2010,
San Francisco, USA. This paper introduces the notion of water level monitoring and management
within the context of electrical conductivity of the water. More specifically, It investigate the
microcontroller based water level sensing and controlling in a wired and wireless environment. From
the users perspective, it is required to reuse such valuable resource in a mobile application. Finally,
It proposes a web and cellular based monitoring service protocol would determine and senses water
level globally. To implement the system we should use some necessary parts such as PIC 16F84A
microcontroller, Crystal Oscillator, 2 capacitor having capacitance 22 pF and 27 pF, inverter, LED,
water tank, water level sensor, water pump, transistor, inductor and some capacitor should be
implemented. When the water is decreasing from the tank by home use, the display LED should start
to become OFF one after another from the top to bottom. If all the LEDs becomes OFF that means
7
the tank becomes empty again and the water pump should becomes automatically ON again exactly
after the last LED becomes OFF. These operations should automatically perform as a cycle. This
article focuses on displaying the available local connections and the stored remote connections
through the internet& Designing interactive application software for remote PC or mobile should
display data in table format or in the graphical interface for integration of the wireless water level
monitoring.
8
3.HARDWARE AND SOFTWARE SPECIFICATIONS:
3.1 HARDWARE REQUIREMENTS:
ARDUINO UNO:
The Arduino UNO is a standard board of Arduino. Here UNO means 'one' in Italian. It was named as
UNO to label the first release of Arduino Software. It was also the first USB board released by
Arduino. It is considered as the powerful board used in various projects. Arduino.cc developed the
Arduino UNO board.
Arduino UNO is based on an ATmega328P microcontroller. It is easy to use compared to other
boards, such as the Arduino Mega board, etc. The board consists of digital and analog Input/Output
pins (I/O), shields, and other circuits.
The Arduino UNO includes 6 analog pin inputs, 14 digital pins, a USB connector, a power jack, and
an ICSP (In-Circuit Serial Programming) header. It is programmed based on IDE, which stands for
Integrated Development Environment. It can run on both online and offline platforms.
9
Let's discuss each component in detail.
• ATmega328 Microcontroller- It is a single chip Microcontroller of the ATmel family. The
processor code inside it is of 8-bit. It combines Memory (SRAM, EEPROM, and Flash),
Analog to Digital Converter, SPI serial ports, I/O lines, registers, timer, external and internal
interrupts, and oscillator.
• ICSP pin - The In-Circuit Serial Programming pin allows the user to program using the
firmware of the Arduino board.
• Power LED Indicator- The ON status of LED shows the power is activated. When the power
is OFF, the LED will not light up.
• Digital I/O pins- The digital pins have the value HIGH or LOW. The pins numbered from D0
to D13 are digital pins.
• TX and RX LED's- The successful flow of data is represented by the lighting of these LED's.
• AREF- The Analog Reference (AREF) pin is used to feed a reference voltage to the Arduino
UNO board from the external power supply.
• Reset button- It is used to add a Reset button to the connection.
• USB- It allows the board to connect to the computer. It is essential for the programming of
the Arduino UNO board.
• Crystal Oscillator- The Crystal oscillator has a frequency of 16MHz, which makes the
Arduino UNO a powerful board.
• Voltage Regulator- The voltage regulator converts the input voltage to 5V.
• GND- Ground pins. The ground pin acts as a pin with zero voltage.
• Vin- It is the input voltage.
• Analog Pins- The pins numbered from A0 to A5 are analog pins. The function of Analog pins
is to read the analog sensor used in the connection. It can also act as GPIO (General Purpose
Input Output) pins.
3.1.2 The technical specifications of the Arduino UNO are listed below:
o There are 20 Input/Output pins present on the Arduino UNO board. These 20 pis include
6 PWM pins, 6 analog pins, and 8 digital I/O pins.
o The PWM pins are Pulse Width Modulation capable pins.
o The crystal oscillator present in Arduino UNO comes with a frequency of 16MHz.
o It also has a Arduino integrated WiFi module. Such Arduino UNO board is based on the
10
Integrated WiFi ESP8266 Module and ATmega328P microcontroller.
o The input voltage of the UNO board varies from 7V to 20V.
o Arduino UNO automatically draws power from the external power supply. It can also
draw power from the USB.
• In-built LED Pin 13: This pin is connected with an built-in LED, when pin 13 is
HIGH – LED is on and when pin 13 is LOW, its off.
• Along with 14 Digital pins, there are 6 analog input pins, each of which provide
10 bits of resolution, i.e. 1024 different values. They measure from 0 to 5 volts
but this limit can be increased by using AREF pin with analog Reference()
function.
• Analog pin 4 (SDA) and pin 5 (SCA) also used for TWI communication using
Wire library.
• Arduino Uno has a couple of other pins as explained below
11
• AREF: Used to provide reference voltage for analog inputs with
analogReference() function.
• Reset Pin: Making this pin LOW, resets the microcontroller.
friendly interface for real-time data visualization. The term LCD stands for liquid crystal display. It
is one kind of electronic display module used in an extensive range of applications like various circuits
& devices like mobile phones, calculators, computers, TV sets, etc. These displays are mainly
preferred for multi-segment light-emitting diodes and seven segments. The main benefits of using
this module are inexpensive; simply programmable, animations, and there are no limitations for
displaying custom characters, special and even animations, etc.
12
CONNECTING WIRES :
Jumper wires are essential components in building the water level measurement project. They provide
the necessary connections between the different electronic components on the breadboard and
facilitate communication between the Arduino Uno and other hardware elements . They facilitate the
flow of signals and power throughout the system, enabling communication and control between
different parts of the circuit.
The HC-SR04 ultrasonic sensor uses sonar to measure distance to an object. It offers excellent range
accuracy and stable readings in an easy-to-use package. It operation isnot affected by sunlight or
black material like sharp range finders are (soft materials like cloth can be difficult to detect).
Working Voltage: 5V (EC). Static Current: Less than 2mA. Output Signal: Electric frequency signal,
high level 5V, low level 0V. Sensor Angle: Cot more than 15 degrees. Detection Distance: 2
to 450 cm. High Precision: Up to 0.3cm. Input Trigger Signal: 10us TTL impulse. Echo Signal:
Output TTL PWL signal mode of connection, VCC, trig (T), echo(R), GCE. The basic operation
principle is below, use BD port TRBG to trigger ranging. Bt needs 10 us high level signal at least
module will send eight 40 kHz square wave automatically and willtest if there is any signal returned.
Bf there is signal returned, output will be high level signal via BD port ECHD. The duration of the
high level signal is the time from transmitter to receiving with the ultrasonic. Testing distance =
duration of high level xsound velocity (340m/s) / 2.
13
Fig 5:Ultrasonic Sensor
14
3.2 SOFTWARE SPECTICATIONS:
ARDUINO IDE:
The Arduino IDE is an open-source software, which is used to write and upload code to the Arduino
boards. The IDE application is suitable for different operating systems such as Windows, Mac OS X,
and Linux. It supports the programming languages C and C++. Here, IDE stands for Integrated
Development Environment.
The program or code written in the Arduino IDE is often called as sketching. We need to connect the
Genuino and Arduino board with the IDE to upload the sketch written in the Arduino IDE software.
The sketch is saved with the extension '.ino.'The Arduino IDE will appear as:
Toolbar Button:
The icons displayed on the toolbar are New, Open, Save, Upload, and Verify.
It is shown below:
Upload:
The Upload button compiles and runs our code written on the screen. It further uploads the code to
the connected board. Before uploading the sketch, we need to make sure that the correct board and
ports are selected.
We also need a USB connection to connect the board and the computer. Once all the above measures
15
are done, click on the Upload button present on the toolbar.
The latest Arduino boards can be reset automatically before beginning with Upload. In the older
boards, we need to press the Reset button present on it. As soon as the uploading is done successfully,
we can notice the blink of the Tx and Rx LED.
If the uploading is failed, it will display the message in the error window.
We do not require any additional hardware to upload our sketch using the Arduino Bootloader. A
Bootloader is defined as a small program, which is loaded in the microcontroller present on the board.
The LED will blink on PIN 13.
Open
The Open button is used to open the already created file. The selected file will be opened in the current
window.
Save
The save button is used to save the current sketch or code.
New: It is used to create a new sketch or opens a new window.
Verify
The Verify button is used to check the compilation error of the sketch or the written code.
Serial Monitor
The serial monitor button is present on the right corner of the toolbar. It opens the serial monitor.
It is shown below:
When we connect the serial monitor, the board will reset on the operating system Windows, Linux,
and Mac OS X. If we want to process the control characters in our sketch, we need to use an external
terminal program. The terminal program should be connected to the COM port, which will be
assigned when we connect the board to the computer.
File
When we click on the File button on the Menu bar, a drop-down list will appear. It is shown below:
16
Quit
The Quit button is used to close all the IDE windows. The same closed sketch will be reopened when
we will open the Arduino IDE.
Edit
When we click on the Edit button on the Menu bar, a drop-down list appears. It is shown below:
17
Let's discuss each option in detail.
Undo
The Undo button is used to reverse the last modification done to the sketch while editing.
Redo
The Redo button is used to repeat the last modification done to the sketch while editing.
Cut
It allows us to remove the selected text from the written code. The text is further placed to the
clipboard. We can also paste that text anywhere in our sketch.
Copy
It creates a duplicate copy of the selected text. The text is further placed on the clipboard.
Find...
It is used to find the specified text. We can also replace the text. It highlights the text in the sketch.
The window will appear as:
18
Tools
When we click on the Tools button on the Menu bar, a drop-down list appears. It is shown below:
19
IDE 2.x):
1. Download and install the Arduino Software IDE:
•Arduino IDE 1.x.x (Windows, Mac OS, Linux, Portable IDE for Windows and Linux, ChromeOS).
•Arduino IDE 2.x
2. Connect your Arduino board to your device.
3. Open the Arduino Software (IDE).
The Arduino Integrated Development Environment - or Arduino Software (IDE) - connects to the
Arduino boards to upload programs and communicate with them. Programs written using Arduino
Software (IDE) are called sketches. These sketches are written in the text editor and are saved with
the file extension .ino.
Using the offline IDE 1.x.x
The editor contains the four main areas:
1. A Toolbar with buttons for common functions and a series of menus. The toolbar buttons allow
you to verify and upload programs, create, open, and save sketches, and open the serial monitor.
2. The message area, gives feedback while saving and exporting and also displays errors.
3. The text editor for writing your code.
4. The text console displays text output by the Arduino Software (IDE), including complete error
messages and other information.
The bottom right-hand corner of the window displays the configured board and serial port.
Now that you are all set up, let’s try to make your board blink!
20
5. Connect your Arduino or Genuino board to your computer.
6. Now, you need to select the right core & board. This is done by navigating to Tools > Board >
Arduino AVR Boards > Board. Make sure you select the board that you are using. If you cannot
find your board, you can add it from Tools > Board > Boards Manager.
7. Now, let's make sure that your board is found by the computer, by selecting the port. This is
simply done by navigating to Tools > Port, where you select your board from the list.
8. Let’s try an example: navigate to File > Examples > 01.Basics > Blink.
21
9. To upload it to your board, simply click on the arrow in the top left corner. This process takes a
few seconds, and it is important to not disconnect the board during this process. If the upload is
successful, the message "Done uploading" will appear in the bottom output area.
10. Once the upload is complete, you should then see on your board the yellow LED with an L next
to it start blinking. You can adjust the speed of blinking by changing the delay number in the
parenthesis to 100, and upload the Blink sketch again. Now the LED should blink much faster.
22
4.BLOCK DIAGRAM AND WORKING
BLOCK DIAGRAM :
HC SR-04 module wired with Arduino UNO board and LCD screen
WORKING :
The working principle of the water level measuring system utilizing Arduino Uno, HC-SR04T
ultrasonic sensor, and 16x2 LCD display revolves around the accurate measurement of distances
using ultrasonic waves and the real-time display of this data. Initially, the HC-SR04T ultrasonic
sensor emits ultrasonic waves toward the surface of the water in the tank or reservoir. These waves
then reflect off the water surface and return to the sensor. By measuring the time taken for the waves
to travel to the water surface and back, the sensor calculates the distance to the water level. The
Arduino Uno, acting as the central processing unit, receives this distance data from the sensor and
converts it into a meaningful water level measurement. This measurement is then displayed on the
16x2 LCD display, providing users with immediate visual feedback. Through this process, the system
enables real-time monitoring of water levels, facilitating timely decision-making and efficient
management of water resources.
23
Working Principle of Ultrasonic Module HC-SR04 :
The ultrasonic sensor works on the principle of SONAR and RADAR system which is used to
determine the distance to an object. An ultrasonic sensor generates the high-frequency sound
(ultrasound) waves. When this ultrasound hits the object, it reflects as echo which is sensed by
the receiver as shown in below figure 1. By measuring the time required for the echo to reach to
the receiver, we can calculate the distance. This is the basic working principle of Ultrasonic
module to measure distance.
24
5.CODE IMPLEMENTATION
As usual, start the code by including all the required libraries. Here, we are only
using LiquidCrystal.h and Wire.h libraries. It is used for controlling the LCD module using
an Arduino board with the help of built-in methods defined inside the library. This library can
be used for both the 4-bit mode and 8-bit mode wiring of LCD.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
Then in the next line, define the pins of Arduino that are interfaced to LCD
Then define the trigger pin and echo for the ultrasonic sensor. We have connected the trigger
pin to the D2 pin of Arduino and the echo pin to the D3 pin of the Arduino.
#define TRIG 11
#define ECHO 12
Inside the setup() function, define the trigger pin as an output and the echo pin as an Input
and also start the serial communication at 9600 for showing the results on the serial monitor
and initialize the interface to the LCD screen and specifies the dimensions.
void setup() {
25
In the loop, first set trigger pin to LOW State for 2 µs to make sure that the trigger pin is clear. Then
set the trigger pin high for 20 us to send an ultrasonic wave. We will use the pulseIn() function to
read the travel time and store that value into the variable “duration”. In the end, we will print the
value of the distance on the Serial Monitor.
void loop() {
Serial.print("Distance ");
Serial.print(distance);
Serial.println(" ");
lcd.clear();
lcd.print("Water Level:");
lcd.setCursor(0,1);
lcd.print(distance,1);
lcd.setCursor(6,1);
lcd.print(" ");
delay(100);
26
Testing the Waterproof Ultrasonic Sensor JSN SR-04T
Once your code and hardware are ready, connect Arduino to the laptop and upload the code. After
that, open the serial monitor at a baud rate of 9600, and put something in front of the sensor.
Calculated distance will be displayed on LCD display.
Code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
void loop() {
27
delayMicroseconds(20);
Serial.print("Distance ");
Serial.print(distance);
Serial.println(" ");
lcd.clear();
lcd.print("Water Level:");
lcd.setCursor(0,1);
lcd.print(distance,1);
lcd.setCursor(6,1);
lcd.print(" ");
delay(100);
28
6.RESULT
The implementation of the water level measuring system using Arduino Uno, HC-SR04T ultrasonic
sensor, and 16x2 LCD display yielded accurate and reliable results in real-time monitoring of water
levels. The HC-SR04T sensor effectively measured the distance between the sensor and the water
surface, providing precise data that the Arduino Uno processed to calculate the actual water level.
This data was continuously updated and displayed on the 16x2 LCD screen, ensuring that users had
immediate visual access to the current water level.
The system demonstrated high accuracy and responsiveness, adjusting the displayed water level
almost instantaneously as the water level changed. This real-time capability proved essential for
applications requiring constant monitoring, such as in water tanks, reservoirs, and irrigation systems.
Additionally, the project highlighted the system's reliability in maintaining consistent performance,
with minimal maintenance required for the sensor and microcontroller setup.
Overall, the project successfully met its objectives, showcasing the feasibility and effectiveness of
using an Arduino-based system for water level measurement. The results indicated that this approach
provides a cost-effective, user-friendly solution for accurate water level monitoring, with potential
for further enhancements such as remote monitoring and data logging through IoT integration.
29
Fig 2:LCD Displaying Water Level
30
7.CONCLUSION
In conclusion, the water level measuring IoT project successfully demonstrated the integration of
hardware components with Arduino Uno to monitor water levels in real-time. By utilizing the HC
SR04 ultrasonic sensor, accurate distance measurements were obtained, allowing for precise
determination of water levels. The data was efficiently displayed on the 16*2 LCD display, providing
users with immediate feedback.
This project not only showcased the capabilities of Arduino Uno in conjunction with sensors but also
highlighted the practical application of IoT technology in environmental monitoring. The simplicity
and affordability of the setup make it accessible for various applications, from home water tanks to
industrial reservoirs.
Overall, this endeavor underscores the potential of IoT solutions in addressing critical issues like
water conservation and management. Through continued innovation and development, such projects
can contribute significantly to creating more sustainable and efficient water systems for the future.
31
8.FUTURE ENHANCEMENT
1. The future scope of the water level measuring IoT project using Arduino Uno, HC SR04, and
a 16*2 LCD display is vast and promising. Here are several avenues for future exploration
and enhancement:
3. Data Logging and Analysis: Implementing data logging capabilities enables the storage of
historical water level data. Analyzing this data over time can reveal patterns, trends, and
anomalies, providing valuable insights for predictive maintenance and efficient resource
management.
5. Cloud Integration: Leveraging cloud platforms like AWS, Azure, or Google Cloud can
facilitate data storage, analysis, and collaboration. Cloud integration enables scalability,
reliability, and accessibility of the water level monitoring system across different locations
and devices.
8. Integration with Smart Home Systems: Integrating the water level monitoring system with
existing smart home ecosystems enables seamless integration and interoperability with other
IoT devices and applications.
9. Power Efficiency: Optimizing power consumption through sleep modes, power management
techniques, or renewable energy sources can prolong the system's operation and reduce
environmental impact.
10. Security and Privacy: Implementing robust security measures, such as encryption protocols
and authentication mechanisms, ensures the integrity and confidentiality of data transmitted
and stored by the water level monitoring system.
32
9.REFERENCES
[1] Charles A, “IOT BASED WATER LEVEL MONITORING SYSTEM USING LABVIEW”, International
Journal of Pure and Applied Mathematics, Volume 118 No. 20 2018, 9-14 ISSN: 1311-8080 (printed version);
ISSN: 1314-3395 (on-line version).
[2] S. V. Manikanthan and T. Padmapriya “Recent Trends In M2m Communications In 4g Networks And
Evolution Towards 5g”, International Journal of Pure and Applied Mathematics, ISSN NO: 1314-3395,
Vol115, Issue -8, Sep 2017.
[3] Neena Mani, Sudeesh T.P, Vinu Joseph, Titto V.D, Shamnas P.S, “Design and Implementation of a
Automated Water Level Indicator”, International Journal of Advanced Research in Electrical, Electronics and
Instrumentation Engineering 2014 Vol 3 Issue 2, February 2014.
[4] Jadhav, G. J, “Design and Implementation of Advanced ARM Based Surveillance System using
Wireless Communication, International Journal of Advance Research in Computer Science and
Management Studies” Vol 2, 2014.
[5] Priya B. Patel, Viraj M. Choksi, Swapna Jadhav, M.B. Potdar, “Smart Motion Detection System
using Raspberry Pi”, International Journal of Applied Information Systems (IJAIS), Vol10 – No.5,
February 2016.
[6] S. M. Khaled Reza, Shah Ahsanuzzaman Md. Tariq, “Microcontroller Based Automated Water
Level Sensing and Controlling: Design and Implementation Issue”, Proceedings of the World
Congress on Engineering and Computer Science 2010 Vol I WCECS 2010, October 20- 22, 2010,
San Francisco, USA.
[7] R. S. SUNMONU, M. A. SODUNKE, O. S. ABDULAI & E. A. AGBOOLA “DEVELOPMENT
OF AN ULTRASONIC SENSOR BASED WATER LEVEL INDICATOR WITH PUMP
SWITCHING TECHNIQUE”, International Journal For Research In Electronics & Electrical
Engineering ISSN: 2208-2735
ADDITIONAL REFERENCES:
• This tutorial explains how to create a water level indicator using an HC-SR04 ultrasonic
sensor, an Arduino Uno, and an LCD display.
• Arduino Project Hub: Water Level Indicator
Circuit Digest: Water Level Indicator using Ultrasonic Sensor and Arduino
• This guide covers the complete setup, wiring, and code for measuring water level with an
ultrasonic sensor and displaying the result on an LCD.
• Circuit Digest: Water Level Indicator
33