Posted by Circuits Arena on Tuesday, 20 March 2018
Water Level Controller By using 8051 Microcontroller is the artlcle explaining Water Level Controller The water level controller, which uses the 8051 microcontroller project , helps automatically control the water...
Water Level Controller
The water level controller, which uses the 8051 microcontroller project, helps automatically control the water motor by detecting the water level in a tank. In this article, you will learn how to detect and control the water level in a tank or other container. This system monitors the tank water level and automatically turns ON the Motor when the tank is empty.
The Motor is turned OFF when the top tank or tanky is full. Here the water level of the tank is shown on the LCD screen (liquid crystal display). With this system, we can also avoid overflowing the water. Here we are designing the circuit which is used to detect and control the water level automatically in the overhead tank using 8051 Microcontroller.
Components Required for Water Level Controller using 8051 Microcontroller
- AT89C51 Microcontroller (or any 8051 based Microcontroller)
- 8051 Programmer (Programming Board)
- 11.0592 MHz Quartz Crystal
- 2 x 33pF Capacitor
- 2 x 10KΩ Resistor (1/4 Watt)
- 10µF Capacitor
- Push Button
- 1KΩ x 8 Resistor Pack (for Pull – up)
- 16 x 2 LCD Display
- 5V Relay
- 4 x 2N2222 (NPN) Transistors
- DC Motor (for demonstration)
- 10KΩ Potentiometer
- 1N4007 PN Junction Diode
- Programming cable
- Connecting wires
- Power Supply
- Keil µVision IDE
- Will Software (for burning code)
- Proteus (for circuit diagram)
The heart of the Water Level Controller using 8051 Microcontroller project is the AT89C51 Microcontroller. The water level probes are connected to the P0.0, P0.1, and P0.2 through the transistors (they are connected to the base of the transistors through corresponding current limiting resistors). P0.0 for LOW level, P0.1 for HALF Level and P0.2 for HIGH Level.
The Collector terminals of the Transistors are connected to VCC and the Emitter terminals are connected to PORT0 terminals (P0.0, P0.1, and P0.2).
PORT1 of the microcontroller is connected to the data pins of LCD and the control pins RS, RW and EN of the LCD Display are connected to the P3.6, GND, and P3.7 respectively.
For demonstration purpose, we have used a simple DC Motor Pump. It is connected to the Relay and the input to the relay is fed from P0.7 through a transistor.
Algorithm for Water Level Controller Circuit
First configure the controller pins P0.0, P0.1 and P0.2 as inputs and P0.7 as output.
Now, initialize the LCD.
Continuously check the water level input pins P0.0, P0.1 and P0.2.
If all the pins are low, then display tank as “EMPTY” on the LCD and make P0.7 pin HIGH to run the motor automatically.
If the level is low i.e. if P0.0 is HIGH, display the water level as “LOW” and continue to run the motor.
A HIGH pulse on the pin P0.1 indicates that water has reached half level. So, display the same thing on LCD and run the motor normally.
If P0.2 is HIGH, then the water level in the tank is FULL.
Now, make the P0.7 pin as LOW to turn off the motor automatically.
How to Operate Water Level Controller Circuit using 8051 Microcontroller?
- Initially, write the program for Water Level Controller in Keil µVision IDE and generate the .hex file.
- Burn the program (.hex file) to the microcontroller using external programmer and Willar Software.
- Now give the connections as per the circuit diagram.
- While giving the connections, make sure that there is no common connection between AC and DC supplies (if you are using an AC Motor)
- Place the 4 water level indicating wires into the small tank (3 probes for three different levels and fourth one for common supply)
- Switch on the supply. Now, the motor will run automatically as there is no water in the tank. (It will turn on even if the water level is LOW).
- Now pour the water, when it reaches LOW level, then LCD displays LOW.
- For middle level, it will display as HALF on the LCD.
- Still if you pour the water, then the water level reaches full and the LCD displays FULL and also the motor is turned OFF automatically.
- Switch off the motor supply and board supply.