Вы находитесь на странице: 1из 10

P a g e |1

TOPIC: Liquid/Water Level Indicator with Alarm using


8051 Microcontroller

DESCRIPTION/OBJECTIVE OF THE PROJECT:


This article illustrates the construction and working of a liquid/water level indicator.
Such an indicator is used in tanks to indicate the level of liquids and alert us when the tank is
full. So by this circuit we can monitor the various levels of the tank and can avoid spillage of
water and also we can configure our supplies according to the various levels of tank. Such
module or circuit can be installed in big buildings where manual monitor of tanks is difficult
and its indicator can be placed at some centralized place.

METHODOLOGY:
This water level indicator circuit works on the principle that water conducts electricity. A
wire connected to VCC and four other wires are dipped in tank at different levels namely
quarter, half, three-fourth, full and their output are taken on pins P3.0, P3.1, P3.2, P3.3 via a
transistor BC547. Port P2 is connected to data pins of LCD and P1.0, P1.1, P1.2 are
respectively connected to RS, RW, and EN pins of LCD.

Initially when the tank is empty LCD will show the message VACANT. As the tank starts
filling up wire at different levels get some positive voltage, due to conducting nature of
water. This voltage is then fed to their corresponding pins on controller. When level reaches
to quarter level, LCD displays the message QUARTER. On further rise of level, HALF and 3/4
QUARTER are displayed on LCD. When tank gets full LCD shows the message FULL CLOSE
TAP. A buzzer is also provided to produce a alert the user when the tank gets filled. This
buzzer can be made off by pressing the switch connected between pin 15 of controller and
VCC.

HARDWARE & SOFTWARE TO BE USED:

LCD (LM016L)
AT89C52 Microcontroller
Switches
LED
Resistors (10K)
Capacitor (33pF,10microF)
Crystal oscillator
Voltage regulator(7805)
Potentiometer
Keil
P a g e |2

Proteus
Connecting wires
Bread Board

Algorithm for Water Level Controller Circuit:


First configure the controller pins P1.0, P1.1, P1.2 and P3.0, P3.1, P3.2, P3.3, P3.4 as
inputs and P3.4, P2.0, P2.1, P2.2, P2.3, P2.4, P2.5, P2.6, P2.7 as output.
Now initialize the LCD.
Continuously check the water level input pins P3.0, P3.1, P3.2, P3.3 and P3.4
If all the pins are low then display tank is vacant on LCD automatically.
High pulse on the pin P3.0 indicates Filling Start, display the same thing on LCD.
If P3.1 is high then water level is Quarter.
High pulse on P3.2 indicates Half full of the tank.
If P3.3 is high then tank is 3/4th full.
If P3.3 is high then tank is Full and LED glows.

Procedure:-
1. Initially I burn the program to the controller.
2. Now i give the connections as per the circuit diagram.
3. While i giving the connections,there is no common connection between AC and DC
supplies.
4. I Place the 4 water level indicating wires into the small tank.
5. Switch on the supply.
6. Now Ipour the water, when it reaches to quarter level then LCD displays QUARTER on LCD.
7. For further levels it will displays HALF and ¾ FULL on LCD.
8. Still if I pour the water then LCD displays FULL and LED turns on automatically when
the tank full.
P a g e |3

I/O Port Pin and microcontroller connection diagram:

LCD Connection diagram:


P a g e |4

CIRCUIT DIAGRAM:

Keil CODE:
ORG 00H
RS EQU P1.0; //REGISTER SELECT PIN
RW EQU P1.1; //READ/WRITE PIN
EN EQU P1.2; //ENABLE PIN
QUAT EQU P3.0; //PIN CONNECTED TO QUATER LEVEL OF TANK
HALF EQU P3.1; //PIN CONNECTED TO HALF LEVEL OF TANK
QUAT_3 EQU P3.2; //PIN CONNECTED TO THREE -FOURTH LEVEL
OF TANK
FULL EQU P3.3; //PIN CONNECTED TO FULL LEVEL OF TANK
SPKR_ON EQU P3.5
SPKR_OFF EQU P3.4; // PIN TO OFF SPEAKER
SETB SPKR_OFF
SETB FULL
SETB QUAT_3
SETB HALF
SETB QUAT
CLR SPKR_OFF
CLR FULL
CLR QUAT_3
CLR HALF
CLR QUAT
SETB SPKR_ON
ACALL LCD_INIT
START:JB QUAT,NEXT
JB HALF,NEXT
JB QUAT_3,NEXT
JB FULL,NEXT
JB SPKR_OFF,NEXT
ACALL LCD_INIT
ACALL VACANT
SJMP START
NEXT:
JNB QUAT,NEXT2
JB HALF,NEXT2
JB QUAT_3,NEXT2
JB FULL,NEXT2
JB SPKR_OFF,NEXT2
ACALL LCD_INIT
ACALL FILLING_START
SJMP NEXT
NEXT2:
JNB QUAT,NEXT3
JNB HALF,NEXT3
JB QUAT_3,NEXT3
JB FULL,NEXT3
JB SPKR_OFF,NEXT3
ACALL LCD_INIT
ACALL QUARTER
SJMP NEXT2
NEXT3:
JNB QUAT,NEXT4
JNB HALF,NEXT4
JNB QUAT_3,NEXT4
JB FULL,NEXT4
JB SPKR_OFF,NEXT4
ACALL LCD_INIT
ACALL HALF_FILL
SJMP NEXT3
NEXT4:
JNB QUAT,NEXT5
JNB HALF,NEXT5
JNB QUAT_3,NEXT5
JNB FULL,NEXT5
JB SPKR_OFF,NEXT5
ACALL LCD_INIT
ACALL THREE_FOUR_FULL
SJMP NEXT4
NEXT5:
JNB QUAT,NEXT6
JNB HALF,NEXT6
JNB QUAT_3,NEXT6
JNB FULL,NEXT6
JNB SPKR_OFF,NEXT6
ACALL LCD_INIT
ACALL FULL_FILL
SETB SPKR_ON
SJMP NEXT5
NEXT6:
JB QUAT,L2
LJMP START
L2:JB HALF,L3
LJMP START
L3:JB QUAT_3,L4
LJMP START
L4:JB FULL,L5
LJMP START
L5:JB SPKR_OFF,L6
LJMP START
L6:JB SPKR_ON,L7
LJMP START
L7: CLR SPKR_ON
SJMP NEXT6
VACANT:
SETB P1.5
MOV DPTR,#M1
V1: CLR A
MOVC A,@A+DPTR
ACALL DATA1
ACALL DELAY
INC DPTR
JZ V2
SJMP V1
V2:
RET
FILLING_START:
SETB P1.5
MOV DPTR,#M6
FS1: CLR A
MOVC A,@A+DPTR
ACALL DATA1
ACALL DELAY
INC DPTR
JZ FS2
SJMP FS1
FS2:
RET
QUARTER:
MOV DPTR,#M2
Q1: CLR A
MOVC A,@A+DPTR
ACALL DATA1
ACALL DELAY
INC DPTR
JZ Q2
SJMP Q1
Q2:
RET
HALF_FILL:
MOV DPTR,#M3
H1: CLR A
MOVC A,@A+DPTR
ACALL DATA1
ACALL DELAY
INC DPTR
JZ H2
SJMP H1
H2:
RET
THREE_FOUR_FULL:
MOV DPTR,#M4
AA1: CLR A
MOVC A,@A+DPTR
ACALL DATA1
ACALL DELAY
INC DPTR
JZ TF2
SJMP AA1
TF2:
RET
FULL_FILL:
CLR P1.5
MOV DPTR,#M5
F1: CLR A
MOVC A,@A+DPTR
ACALL DATA1
ACALL DELAY
INC DPTR
JZ F2
SJMP F1
F2:
RET
DELAY:
MOV R0,#0FFH
D1: MOV R1,#08H
D2: DJNZ R1,D2
DJNZ R0,D1
RET
LCD_INIT:
MOV A,#80H
ACALL CMD
ACALL DELAY
MOV A,#38H
ACALL CMD
ACALL DELAY
MOV A,#0EH
ACALL CMD
ACALL DELAY
ACALL CMD
ACALL DELAY
RET
CMD:
ACALL DELAY
MOV P2,A
CLR RS
CLR RW
SETB EN
ACALL DELAY
CLR EN
RET
DATA1:
ACALL DELAY
MOV P2,A
SETB RS
CLR RW
SETB EN
ACALL DELAY
CLR EN
RET
ORG 400H
M1: DB "VACANT______<0%>",0
M2: DB "QUARTER____<25%>",0
M3: DB "HALF_______<50%>",0
M4: DB "3/4 FULL___<75%>",0
M5: DB "FULL__<100%> OFF",0
M6: DB " FILLING START ",0
END
P a g e | 12

ADVANTAGES:
Human effort is reduced as the system controls the motor automatically based on
the water level.
This system consumes less power.
Simple and more reliable.

APPLICATIONS:
Automatic Water level Controller can be used in hotels, factories, homes
apartments, commercial complexes, drainage ,etc.
It will automatically START the pump set as soon as the water level falls below the
predetermined level and shall SWITCH OFF the pump set as soon as tank is full.
Fuel level indicator in vehicles.
Liquid level indicator in huge containers in the companies.

CONCLUSION:
Automatic water pump control system employs the use of different technologies in its
design, development, and implementation. The system used microcontroller to automate
the process of water pumping in an over-head tank storage system and has the ability to
detect the level of water in a tank, switch on/off the pump accordingly and display the
status on an LCD screen. This research has successfully provided an improvement on
existing water level controllers by its use of calibrated circuit to indicate the water level .

Вам также может понравиться