Ultrasonic Water Level Indicator
by Nirubxn in Circuits > Arduino
421 Views, 10 Favorites, 0 Comments
Ultrasonic Water Level Indicator
Have you ever been in a situation when you open your water tap and there's nothing coming? When your tanks are empty, we will not know unless and until the water inside the tank drains entirely. Also, every year, a very large amount of fresh water is being wasted because we often forget to turn of our water pump or we don't really know how much water has been filled unless we see in the tank. In order to fix these problems, I have made a very simple and cheap water gauge display with a simple ultrasonic sensor and an Arduino Nano.
Supplies
1) An Arduino nano
2) A breadboard
3) An ultrasonic sensor
4) Jumper wires
5) SSD1306 OLED display
Why an Ultrasonic Sensor ?
An ultrasonic sensor will sense the distance by using sound. So, I have used an ultrasonic sensor in order to measure the distance that varies based on the level of water in the tank. The main reason why I used an ultrasonic sensor is that its simple to install and most importantly, we don't have any problem with corrosion that we face in a sensor that senses the water level underwater.
Connection to the Ultrasonic Sensor
An ultrasonic sensor will have 4 terminals. VCC, Trig, Echo and Gnd. The VCC and Gnd are self explanatory. While the Trig pin connects to D9 and Echo pin connects to D10.
Connection to the SSD1306 OLED Display
The OLED display will have Gnd, VCC, SCK and SDA. The Serial Clock (SCK) connects to A5 of the Arduino. The Serial Data (SDA) connects to A4.
Code
Once the connections are made, upload the code given below. Make adjustments based on your tank's height in the variable "TANK_HEIGHT_CM". Currently, it is set to 30cm.
Downloads
Enjoy!
Now, you can sit relaxed, knowing that you can see the amount of water left in your tank and also, save some water.