Water Level Indicator is a simple mechanism to detect the water level in a tank or any other water container. The sensing is done by using a set of 2 probes which are placed at 2 different levels on the tank walls. Level 2 represents the “Level High” condition while level 1 represents the “level low” condition.

Here we are have used PIC16F877A  IC. For simulation, we used Proteus software and for coding, we used MPLAB IDLE which is developed by microchip technology for PIC microcontrollers.

water cntrler.PNG  

In proteus, we have used two push-button for indicating water low and water high.

Button1 is for indicating water low and Button2 is for indicating water high. When push button1 is pressed the particular pin will get high and LCD will display the message “water low” similarly when push button2 is pressed the particular pin gets high and LCD will display the message “water high”.

Here were when push button2 is pressed an interrupt is generated which stops the main code and interrupt subroutine is run ie a water high message on the LCD display.

In practically you can use two wires in the place of push-button. One wire is placed at the base of the tank whose other end is connected to PORTB 6th pin i.e RB5 where our button1 was connected and 

The second wire is placed at a certain height of the tank whose other end is connected to PORTB 1st pin i.e RB0 which is also an external interrupt pin where our button2 was connected. So when water gets in contact with the wire the particular pin gets high and the message is displayed on LCD.