Water level monitoring using Ultrasonic Sensor | Water Tank level monitoring

(Last Updated On: September 12, 2020)

Water level monitoring

Description:

In this tutorial, you will learn how to make a Water level monitoring system using Arduino, ultrasonic sensor, and some LEDs. The LEDs are used to show the percentage of water available in the Water tank. This is a beginner’s level project explaining the basics. While the recent version of the water level monitoring system is based on the Nodemcu esp8266 wifi module to monitor the water level on my cell phone and also control the water pump from anywhere around the world, So the IoT version of the Water level monitoing system entirely depends on this tutorial. So I highly recommend you should read this article to the end. This Tutorial covers

  1. Ultrasonic Sensor based Water Level Monitoring System Circuit Diagram Explanation
  2. Ultrasonic Sensor Interfacing with Arduino
  3. Water level monitoring Arduino Programming and finally
  4. testing


The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno:
Mega 2560:
HC-SR04 Ultrasonic Sensor:

Other Tools and Components:

Super Starter kit for Beginners

Two Channel / 200 MHz Digital Oscilloscope

Variable Supply:

Digital Multimeter:

Soldering iron kit: “best”

PCB small portable drill machine:

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

HC-SR04 Ultrasonic Sensor:

Water level monitoring

This is the HC-SR04 Ultrasonic Sensor. As you can see the pins are clearly labeled with VCC, trigger Echo and ground. I have a very detailed getting started tutorial on how to use the HC-SR04 ultrasonic sensor with Arduino. You can simply search for the Ultrasonic Sensor, you will get a complete list of all the projects in which I have used the Ultrasonic Sensor.


Water level monitoring Circuit Diagram:

Water level monitoring

This circuit is designed in cadsoft eagle 9.1.0 version. if you want to learn how to make a schematic and pcb then watch my tutorial.

As you can see the circuit diagram of the water level monitoring system is really simple. The trigger pin of the ultrasonic sensor is connected with pin number 7 of the Arduino. While the echo pin of the ultrasonic sensor is connected with pin number 6 of the Arduino.

the VCC and GND pins of the ultrasonic sensor are connected with the Arduino’s 5v and ground pins. These are the 5 led’s which will be used to display the percentage of water available in the water tank. The first led will show 20%, the second led will show 40%, and so on. So the last led will show 100%.

These are the current limiting resistors which are connected in series with these 2.5v LEDs. I have a very detailed tutorial on how to calculate the value of the current limiting resistor.


Soldering & Interfacing:

For the Soldering and Interfacing watch video tutorial gave at the end of this Article.

Water level monitoring Arduino Programming:

 

The trigger pin is connected with pin number 7 and the echo pin is connected with pin number 6 of the Arduino.

Then defined pins for the led’s which are connected with analog pins A0 to A4. Total of 5 led’s are used in this project. if you want you can increase and decrease the number of led’s as per your requirement.

As you know my friends every Arduino and Mega program has at least two functions, which are the void setup and void loop functions. Void means that these functions are not returning any value while the empty parenthesis means that these functions are not taking any arguments as the input.


The trigger pin is set to output while the echo pin is set to input. Set all the leds to output using the pinMode function. Turn off all the led’s using the digitalWrite function.

defined two variables with the names duration and distance. Turns on the trigger pin for 1000 microseconds and then turn it off. . then using this formula we find the distance in centimeters. The rest of the programming is very simple and is only consists of the if conditions. The led’s are turned on and turned off depending on the distance of the water level from the ultrasonic sensor. The Values used in these if conditions can be changed as per your requirement. The type of the ultrasonic sensor I am using is capable of measuring the distance up to 5 meters.


Watch Video Tutorial:

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply