Water Level Control Using 8051
Water Level Control Using 8051
Microcontroller 8051
By-
Aman Khandwe
19111006
5th sem
TABLE OF CONTENTS-
1. Introduction.
2. Working.
3. Circuit diagram.
4. Algorithm.
5. Program.
Introduction
A water level controller is a device that regulates water levels in a range of systems such as
water tanks, pumps, and swimming pools. The primary purpose of a water level controller is to
manage water flow.This device monitors the tank's water level and automatically turns ON the
motor when the tank is empty and it turns OFF the motor when the tank is full. Water Level
Controller Using 8051 Microcontroller Project will aid in the automated operation of a water
motor by sensing the water level in a tank.Here we will be discussing about how this device
works specifically how it detects and control the water level in tank.
Working
● The AT89C51 Microcontroller is the core of the Water Level Controller Using 8051
Microcontroller project. The water level sensors are linked to the transistors P2.0 and
P2.7 they are connected to the base of the transistors through corresponding current
limiting resistors , the collector terminals of the transistors are linked to VCC, while the
emitter terminals are connected to the terminals P2.0 and P2.7.
● P2.7 represents the LOW level sensor , P2.0 represents the HIGH level sensor and the
pump motor is connected to P1.5 .
● If the tank is empty then thru P2.7 output the P1.5 will turn the motor on and when the
tank is full then thru P2.0 output the P1.5 will stop the motor.
Circuit Diagram
Fig.1-Circuit Diagram
Algorithm
1. First configure the controller pins P2.0 and P2.7 as inputs and P1.5 as output.
2. Continuously check the water level input pins P2.0 and P2.7.
3. If the sensor is dipped in water then the port pin goes LOW(0) else its HIGH(1).
4. If the low level sensor is out of water then turn on the motor pump by setting P1.5 as
high.
5. Else check the high level sensor status.
6. If high level sensor is dipped in water the turn off the motor pump by clearing P1.5 bit.
7. Else repeat steps 4 to step 7.
Program
ORG 0000H
SETB P2.0 ; make P2.0 input pin , high level sensor
SETB P2.7 ; make P2.7 input pin , low level sensor
CLR P1.5 ; make P1.5 output pin , motor control
UP: JNB P2.7 , L1 ; Check if low level sensor is out of water
SETB P1.5 ; Motor ON
L1: JB P2.0 , L2 ; Check if full level sensor is in water
CLR P1.5 ; Motor OFF
L2: SJMP UP
Thankyou
________________________________