Water is very essential in our daily life. As we know the earth is made of 3 parts of water. But only 3% of this is fresh water. So we have to stop the wastage of water. There are many ways where water gets wasted. One of these is overflowing of tank or reserver of multiplexes, houses, flats, etc. We have an excellent solution to this problem. In this project, we are going to make an Arduino based Water Tank Level Controller System. This project is going to be very interesting.
Principle Behind Arduino Based Water Level Controller
The principle of the Arduino based water level controller is very normal. This project is based on Arduino and ultrasonic sensors.
Ultrasonic sensors are working on the basis of ECHO. We all know ultrasonic sensor works using sound waves. Sound waves get transmitted in the environment and received back to the sensor as ECHO.
We just need to calculate the time of both sound waves travelling time. When they strike obstacles and return to the sensor. After calculation, we have the distance in the result. We used this concept to control the water tank. The water pump is automatically turned on when the water level is low and turned off when the level is high.
Must Read Water Tank Overflow Alarm
Project

Circuit Diagram

Components Required
- Arduino
- Ultrasonic Sensor HC-SR04
- 16×2 LCD Display
- 5V Relay Module
- BC547 NPN Transistor
- Resistors (1K, 10K, 100 (x2))
- Red LED
- Green LED
- 5V HI-Link AC-DC Converter (For PCB Use Only)
- Veroboard
- 5V Power Supply
About Parts
Arduino UNO

Arduino Uno is a microcontroller board based on the ATmega328P chip. It has 14 digital I/O pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header and a reset button. It contains everything needed to support the microcontroller, simply connects it to a computer with a USB cable or power it with a DC supply.
HC-SR04 Ultrasonic Sensor Module

This is a sensor that can measure the distance of an object from the sensor position by ultrasonic sound waves. It sends ultrasonic waves of 40 KHz in the medium. If the waves are reflected on the object and bounce back to the sensor, it calculates the distance by calculating the travelling 111time and speed of sound.
Circuit Connection of Water Level Controller using Arduino
The circuit is the same as the diagram. You just need to fix the ultrasonic sensor module at the top of the tank. So that the module can measure the water surface and collect the data from the tank. When the water level is low about 30 cm, the Arduino turns on the pump and the LCD display shows “LOW WATER LEVEL” and the Led starts glowing.
When the space in the tank is about 12cm the pump will turn off and the LCD display shows “TANK IS FULL“. The buzzer starts beeping at this time and the LED turns off at this moment.
PCB Design
For removing messy wiring and give a clean look, I designed a PCB prototype for this project. It is also helpful for troubleshooting that runs great without any errors. To design this PCB board, I used EasyEDA as it is too easy to use. For ordering PCB for this, I prefer PCBWay.
Gerber file for Water Tank Level Controller Gerber.
PCB View


Order PCB From PCBWay
There are so many forums or communities for electronics online in today’s technical world, and one of the famous ones for PCB manufacturing is the PCBWay. PCBWay is a place that brings manufacturers and customers together. They have more than a decade of experience in this field of fabrication, prototyping and assembling PCBs. PCBWay have proved their focus to their customers’ needs in terms of cost-effectiveness, delivery, and quality.
Monthly Submission for PCBWay
Great opportunity for showing your creativity in electronics right now. PCBWay’s Open Source Community is a platform for sharing creative electronic projects and insightful knowledge for global project makers.
You can express your own ideas about electronics and also receive feedback from the community that is ready for you! Whenever you have some useful and practical ideas on how to design or develop an electronic project, or anything that you think should be discussed at PCBWay. By writing articles on your own unique ideas, you can earn reward points basis on your project as well as earn money. You are always welcome to post articles about electronic projects in their community. For detailed information just check out this link and start a fresh beginning. Monthly Submission for PCBWay.
How PCB Manufacturing Process Done in PCBWay
Standard quality for any product needs to be maintained using some parameters. PCBWay gives that opportunity by quality control in designing and manufacturing. At first, they ensure accuracy, clarity, validity of the PCB files that we sent to them.
Then all the boards will go through the most stringent tests other than the basic visual check. They adopt most of the testing and inspecting equipment used in the industry, such as Flying Probe Tester, X-Ray Inspection Machines, and Automated Optical Inspection (AOI) Machines. PCBWay are having 50+ new engineers on the daily basis around the world using PCBs for their work, who trust for their reliable quality. They produce high-quality pink, orange, grey, even transparent solder mask. Moreover, according to people’s needs, they can also provide Black core PCB. Check it out for a High-Quality PCB solder mask. There are some pictures below of the new colours of solder musks.
Working Principle of Water Tank Level Controller
The working of this circuit is very simple. We use an ultrasonic sensor that detects the reflection of sound waves from the water surface. At first, we trigger the ultrasonic sensor to transmit the signal and then wait for the ECHO. Arduino calculates the time between triggering and receiving ECHO. We know sound travels with a 340 m/s speed in the air. So we use,
Distance = (Travel time / 2) × Speed of Sound
Now we have the distance between the sensor and the water level in the tank. Now we need to calculate the length of the water tank. Then subtract the resulting distance. Now we have the water level. The Arduino converts it into a percentage. The LCD Display shows the percentage of water present in the tank every moment.
By this process, we can control the water level. The second part is when the water level is low and the relay activates the pump and the pump starts to fill up the tank. When the tank water level gets high the pump turns off automatically.
Arduino Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | #include <LiquidCrystal.h> #define trigger 10 #define echo 11 #define motor 8 #define buzzer 12 LiquidCrystal lcd(7,6,5,4,3,2); float time=0,distance=0; int temp=0; void setup() { lcd.begin(16,2); pinMode(trigger,OUTPUT); pinMode(echo,INPUT); pinMode(motor, OUTPUT); pinMode(buzzer, OUTPUT); lcd.print(" Water Level "); lcd.setCursor(0,1); lcd.print(" Indicator "); delay(2000); } void loop() { lcd.clear(); digitalWrite(trigger,LOW); delayMicroseconds(2); digitalWrite(trigger,HIGH); delayMicroseconds(10); digitalWrite(trigger,LOW); delayMicroseconds(2); time=pulseIn(echo,HIGH); distance=time*340/20000; lcd.clear(); lcd.print("Water Space In "); lcd.setCursor(0,1); lcd.print("Tank is: "); lcd.print(distance); lcd.print("Cm"); delay(2000); if(distance<12 && temp==0) { digitalWrite(motor, LOW); digitalWrite(buzzer, HIGH); lcd.clear(); lcd.print("Water Tank Full "); lcd.setCursor(0,1); lcd.print("Motor Turned OFF"); delay(2000); digitalWrite(buzzer, LOW); delay(3000); temp=1; } else if(distance<12 && temp==1) { digitalWrite(motor, LOW); lcd.clear(); lcd.print("Water Tank Full "); lcd.setCursor(0,1); lcd.print("Motor Turned OFF"); delay(5000); } else if(distance>30) { digitalWrite(motor, HIGH); lcd.clear(); lcd.print("LOW Water Level"); lcd.setCursor(0,1); lcd.print("Motor Turned ON"); delay(5000); temp=0; } } |
Good project. Thanks for the insight. I have also been working on the same project.
Très intéressant
I’ll want you to suggest other more rugged sensor other than HC-SR04 Ultrasonic Sensor Module, that can sense distance from 0 to 2 meters that can be used with your project. Thanks
In the AC supply 1,2. Which one is (+) and which one is (-)?
What should be the input of the main ac supply?
230VAC
In the AC supply 1,2. Which one is (+) and which one is (-)?
Do the components have to be soldered to the pcb board?
Yes for avoiding loose connection, the components need to be soldered on the pcb or vero board or any prototype board.
Can I use this experiment with a fuel tank?
Yes, you can.