You are on page 1of 2

WATER LEVEL CONTROLLER:

 Switching ON of water pump is made when level goes under a preset limit.
 The pump is not started when water level in the tank on ground is low.
 The level sensor probes for tank are interfaced to Port2 through transistors.
 The probes for sensing HALF and FULL levels are placed with equal spacing one by one above
bottom positive probe.
 When water increases to FULL level, current flows into Q2 transistor and makes it ON. The low
collector voltage will make P2.0 as low. This means the tank is full. When water level goes below
FULL level probe, the Q2 becomes open and collector voltage is made high. This makes P2.0
high means tank is not full.
 The same is applicable for HALF sensor probe.
 The pump is made ON by making P0.3 low and triggering DPDT relay.
 LED D5 is used to indicate motor is ON.
 LED’s D1, D2, D3 are used to indicate level of tank.
Program:

MAIN: MOV P2, #0FFH ; Indicate P2 as input


MOV A, #00H
ACALL WATER_LEVEL ; Check level of water tank
MOV A, P2 ; Move the current status of P2 to A
CJNE A, #0FEH, DN1 ; Check whether the tank is full
SETB P0.1
SETB P0.2
CLR P0.0 ; Glows FULL level LED
SETB P0.3 ; Motor will remain OFF
DN1: MOV A, P2
CJNE A, #0FDH, DN2 ; Check whether the tank is HALF
SETB P0.0
SETB P0.2
CLR P0.1 ; Glows half level LED
SETB P0.3
DN2: MOV A, P2
CJNE A, #0FFH, MAIN ; check whether the tank is empty
SETB P0.0
SETB P0.1
CLR P0.2 ; Glows the empty LED
JB P0.4, MAIN ; Check whether tank on ground is low
CLR P0.3 ; Switch motor ON
SJMP MAIN
WATER_LEVEL: JB P0.4, DN3 ; If Ground tank is empty
SET P0.5
SJMP DN4
DN3: SETB P0.3 ; ON the pump (motor)
CLR P0.5 ; LED D4 is ON
DN4: RET
END

You might also like