Recently I make a project of water level controller with Arduino in which I control my water tank motor when tank full with water motor automatically off when water level down the motor star and filling the tank. today I tell you how to make Automatic water level controller with LCD display. this is the upgraded version of my previous project for more details read my previous article link mention below in this article.
How to make Automatic water level controller with LCD display:
In this guide, I will tell you how to make automatic water level controller using Arduino with the display of statistic of the water level. you can make a controller with the display screen to control your water tank motor. How is it work? in coding I set the limit of minimum and maximum water level surface using ultrasonic sensor when the water level reaches to the minimum motor will turn off when the water level goes down( depth of tank/maximum level ) motor will on and start filling tank automatically and also you can see the statistic on the display screen.
For this project, you need some hardware components to archives the goal.
Hardware Components:
- Arduino UNO/mega board.
- breadboard.
- ultrasonic sensor HC-SR 04.
- LCD Display 1602
- 10k resister.
- Some jumper wires may be required.
- Relay module: to on/off motor
Source Code:
Download source code and upload to Arduino board with IDE tool.
DownloadSource 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 | /* water level controller with display by mrmodder.com HC-SR04 Ping distance sensor: VCC to arduino 5v GND to arduino GND Echo to Arduino pin 9 Trig to Arduino pin 8*/ /* LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 * LCD D4 pin to digital pin 5 * LCD D5 pin to digital pin 4 * LCD D6 pin to digital pin 3 * LCD D7 pin to digital pin 2 * LCD R/W pin to ground * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3)*/ #include<LiquidCrystal.h> // include the library code for lcd LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // #define echopin 9 // echo pin #define trigpin 8 // Trigger pin int maximumRange = 50; long duration, distance; void setup() { lcd.begin(16,2); Serial.begin (9600); pinMode (trigpin, OUTPUT); pinMode (echopin, INPUT ); pinMode (4, OUTPUT); pinMode (13,OUTPUT); } void loop () { { digitalWrite(trigpin,LOW); delayMicroseconds(2); digitalWrite(trigpin,HIGH); delayMicroseconds(10); duration=pulseIn (echopin,HIGH); distance= duration/58.2; delay (50); Serial.println(distance); lcd.clear(); lcd.setCursor(0,0); lcd.print("water level :"); lcd.print(distance); delay(100); } if (distance >= 25 ){ digitalWrite (7,HIGH);// connect to relay(motor) digitalWrite (13,HIGH); lcd.setCursor(0,1); lcd.print("Motor Started"); delay(100); } else if (distance <=5) { digitalWrite (7,LOW); // connect to relay(motor) digitalWrite (13,LOW); lcd.setCursor(0,1); lcd.print("Tank is full"); delay(100); } } |
Now you have to upload source code to your Arduino board if you never use Arduino IDE tool before this project you have to do some settings in Arduino IDE tool regarding your Arduino board if you don’t know how to setup IDE tool you can read my previous project which includes all steps to use Arduino IDE properly and you can also learn How to make Home Automation using Arduino UNO mega in this project I made home automation internet of things (IOT) with Arduino using relay module and ethernet shield.
If you need any help to make this project let me know below in comment box I will help to achieve your goal 🙂
Caution: when you use AC250 make sure all safety measures 🙂
If you like my work don’t forget to mention in comment and share this project with others also share on your social profile 🙂
Faizan Hamayun
Hello;
I am new in this field i need a simple single LED flasher/Solid circuit that accepts 3 types of input signal from a circuit one is positive +5v to gnd and other is -5v to gnd when +5 signal input to arduino it should solid ON and when -5v signal input the LED starts flashing LED at rate of 2sec and when no signal (below 2v) LED off.Please reply at [email protected]
admin
if you know coding I mean c++ you can make it with Arduino easily currently I am not working any led type project sorry bro you can google it however in future if I work on it I will give you code
Luyanda
How to add keypad and buzzer in this project to select required water level and buzzer beeps when water level is empty
admin
what the purpose of keypad? you can add reset button and buzzer by changes in the code.
Unni
How to add a buzzer to the circuit what is the changes or how to set up the code for adding buzzer and to which pin should I connect it.
Unni
How to change the code for buzzer
Uttam Dutta
It is Wonderful project with explanation.
Is it possible to set the level by a external potential meter or key pad so that we can change the setting without changing the code.. can you help me out