Department of Electronics
Department of Electronics
Department of Electronics
Aim:- To design system using 8051 for detection of water level of tank and operate
Pump Depending on Level Input.
Block diagram:
89S51 LCD
Water Sensing
Tank Electrode
CIRCUIT DIAGRAM:
PROGRAM:
//lcd connected to P2
//water level i/p are at P0.0-P0.3
#include <REGX51.H>
/*---------------------------------------------------------------------------------------*/
for(i=0;i<itime;i++)
for(j=0;j<1275;j++);
}
/*---------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------*/
void water_indi()
switch (P0)
{
case(0xFE):
for(l=0;l<9;l++)
lcdwrt(text1[l]);
break;
case(0xFC):
for(l=0;l<9;l++)
lcdwrt(text2[l]);
break;
case(0xF8):
for(l=0;l<10;l++)
lcdwrt(text3[l]);
break;
case(0xF0):
for(l=0;l<9;l++)
lcdwrt(text4[l]);
break;
/*---------------------------------------------------------------------------------------*/
void lcdini()
/*---------------------------------------------------------------------------------------*/
void main()
lcdini();
for(k=0;k<15;k++)
while(1)
water_indi();
/*---------------------------------------------------------------------------------------*/
Description:
As shown in block diagram, there are no. of blocks which contains sensing electrodes ,water
tank microcontroller 8051 and finally display unit such as 16*2 lcd display.
As shown in the circuit diagram there are four sensing electrodes are used to sense the
water level present in the water tank and one ground electrode is dipped in to the water tank ,when
water is at bottom level the electrode present at bottom sense the ground(as water is good
conductor of electricity) and microcontroller detects the level and displays it on lcd.
The sensing electrodes are connected at port pins P0.0 to P0.3,and lcd data bus is connected
to port 2,lcd control pins are connected to P3.5-RS,P3.6-RW,P3.7-En.
1. AT BOTTOM
2. AT MIDDLE
3. AT QUARTER
4. TANK FULL