This article discloses you how to identify and control the water level in an overhead tank or whatever other holder. This framework screens the water level of the tank and consequently switches ON the engine at whatever point tank is vacant. The engine is exchanged OFF when the overhead tank or holder is FULL. Here the water level of the tank is demonstrated on LCD (Liquid precious stone Display). Utilizing this framework, we can stay away from the flood of the water. We have as of now perceived How water level marker circuit functions utilizing AVR Microcontroller as a part of the prior post. In any case, here we are planning the circuit which is utilized to recognize and control the water level naturally in overhead tank utilizing 8051 microcontroller.

In this framework water using so as to detect should be possible an arrangement of 4 wires which are put at various levels in tank. DC supply test is set at the base of the tank.

Water Level Controller using 8051 Circuit Principle:

This system mainly works on a principle that “water conducts electricity”. The four wires which are dipped into the tank will indicate the different water levels. Based on the outputs of these wires, microcontroller displays water level on LCD as well as controls the motor.


Circuit Components:
  • At89c51 controller
  • At89c51 programming board.
  • 16*2 LCD
  • 5V Relay
  • Bc547 (NPN) transistors – 5
  • Resistors (1K) – 4
  • Resistor – 330 ohm
  • AC Motor
  • Pot – 10k
  • Programming cable
  • Connecting wires

Water Level Controller using 8051 Circuit Design:

The main heart of this project is AT89C51 microcontroller. The water level probes are connected to the P3.0, P3.1, P3.2, and P3.3 through the transistors. Port P2 connected to the data pins of LCD and control pins RS, RW and EN of LCD are connected to the P1.0, P1.1, and P1.2 respectively.
Initially when tank is empty, LCD will display the message EMPTY and motor runs automatically. When water level reaches to quarter level, now LCD displays QUARTER and still motor runs. For further levels, LCD displays the messages HALF and ¾ FULL.
When tank is full, LCD displays FULL and motor automatically stops. Again motor runs when tank is empty.
Related Post: Also read the interesting concept about How water level alarm circuit works using 555 Timer.

Algorithm for Water Level Controller Circuit:

  • First configure the controller pins P3.0, P3.1, P3.2 and P3.3 as inputs and P3.4 as output.
  • Now initialize the LCD.
  • Continuously check the water level input pins P3.0, P3.1, P3.2, and P3.3
  • If all the pins are low then display tank is empty on LCD and make P3.4 pin high to run the motor automatically.
  • High pulse on the pin P3.0 indicates quarter level, display the same thing on LCD.
  • If P3.1 is high then water level is half.
  • High pulse on P3.2 indicates 3/4th full of the tank.
  • If P3.3 is high then tank is full, now make P3.4 pin is low to turn off the motor automatically.

    How to Operate Water Level Controller Circuit using 8051 Microcontroller?

  • Initially burn the program to the controller.
  • 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.
  • Place the 4 water level indicating wires into the small tank.
  • Switch on the supply, now the motor will run automatically as there is no water in the tank.
  • Now pour the water, when it reaches to quarter level then LCD displays QUARTER on LCD.
  • For further levels it will displays HALF and ¾ FULL on LCD.
  • Still if you pour the water then LCD displays FULL and motor turns off automatically when the tank is full.
  • Switch off the motor supply and board supply.
Get an idea about How to Interface 7 Segment Display with 8051 Microcontroller
The Code:
#include<reg51.h>
sbit rs=P1^0;   
sbit rw=P1^1;   
sbit e=P1^2;       
sbit quat=P3^0; // Quad water level
sbit half=P3^1; // half level of tank
sbit quat_3=P3^2; // three -fourth level of tank
sbit full=P3^3;     //full level of tank
sbit motor=P3^4;  //pin connected to motor

void delay(int k) //delay function
{
int i,j;
for(i=0;i<k;i++)
  for(j=0;j<1275;j++);
}

void write(int j)
{
rs=1;  //selecting rs pin to data mode
rw=0;  //selecting rw pin to write mode
P2=j;  //putting value on the pins
e=1;  //high pulse
delay(1);
e=0;    // low pulse
return;
}

void cmd(int j)  //command function
{
P2=j;  //put the data on pins
rs=0;  //selecting rw pin to command mode
rw=0;  //selecting to write
e=1; 
delay(1);
e=0;
return;
}

void puts(char *a) // function to display string on LCD'
{
unsigned int p=0;
for(;a[p]!=0;p++)
write(a[p]);
}

void lcd_init(void) // function to initialise the LCD
{
cmd(0x38);
delay(1);
cmd(0x0c); //LCD turning on cmd
delay(1);    
cmd(0x01); //clear lcd cmd
cmd(0x80); // starting point of LCD
}

void main()
{
lcd_init();      //LCD intialization
quat=half=quat_3=full=1; //configuring as input pins
quat=half=quat_3=full=0; //lowering input pins
motor = 0;
while(1)
{
  if(quat==0&&half==0&&quat_3==0&&full==0)   //when tank is empty
  {
   cmd(0x80);           // to move the cursor to starting point of LCD
   puts("EMPTY   ");      // dispalys empty on lcd
        motor=1;                            // start motor
  }
  else if(quat==1&&half==0&&quat_3==0&&full==0)    // when tank is quater
  {
   cmd(0x80);
   puts("QUATER   ");     // dispalys Quarter on lcd
  }
  else if(quat==1&&half==1&&quat_3==0&&full==0)    // when tank is half
  {
    cmd(0x80);
   puts("HALF    ");      // dispalys half on lcd
  }
  else if(quat==1&&half==1&&quat_3==1&&full==0)    // when tank is three-fourth
  {
   cmd(0x80);
   puts("3/4 FULL   ");     // dispalys 3/4 full on lcd
  }
  else if(quat==1&&half==1&&quat_3==1&&full==1)    // when tank is full
  {
   cmd(0x80);
   puts("FULL    ");    // dispalys full on lcd
   motor=0;            // to stop the motor
  }

}
}

How to Operate Water Level Controller Circuit using 8051 Microcontroller?

  1. Initially burn the program to the controller.
  2. Now give the connections as per the circuit diagram.
  3. While giving the connections, make sure that there is no common connection between AC and DC supplies.
  4. Place the 4 water level indicating wires into the small tank.
  5. Switch on the supply, now the motor will run automatically as there is no water in the tank.
  6. Now pour 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 you pour the water then LCD displays FULL and motor turns off automatically when the tank is full.
  9. Switch off the motor supply and board supply.
Get an idea about How to Interface 7 Segment Display with 8051 Microcontroller

Post a Comment

  1. How should i connect relay to a motor in proteus.Motor is not getting turned OFF when the Tank is FULL

    ReplyDelete

 
Top