Water Level Indicator and Controller using PIC Microcontroller

Water Level Indicator and Controller using PIC Microcontroller

Here is a simple, versatile project which indicates the level of water and automatically controls it by using PIC Microcontroller. The Water Level Sensing Section senses the level of water in the tank and sends it (wireless) to the Receiver Section. Receiver Section is connected to the Controlling Section, which process the received information and produces visual, sound indications and controls the operation of the motor whenever required. The project is divide into 4 sections.

1. Power Supply Section

Power Supply section provides required supply for Receiver and Controlling modules. Receiver module requires +5V power supply. Controller module requires +5v and +12v supply. Circuit Diagram:

 2.Water Level Sensing Section

ASK RF Transmitter

ASK RF Transmitter

Level Sensor module is made of with HT12E encoder and ASK (Amplitude Shift Keying) RF transmitter. This circuit can be drive using 9V battery. For more details about this transmitter, please read the article Wireless RF Transmitter and Receiver using ASK RF Module. This circuit is placed near the Water Tank and connected to the tank as show in the figure below.


Water Tank Connections

Water Tank Connections

3. Receiver Section

ASK RF Receiver

ASK RF Receiver

 

Receiver Module is made of with HT12D decoder and ASK RF receiver. The data transmitted by the Sensor module is received by this module and is given to the Controlling Module. For more details about this receiver, please read the article Wireless RF Transmitter and Receiver using ASK RF Module.

4. Controlling Section

Circuit Diagram

Water Level Indicator Controller using PIC Microcontroller

Water Level Indicator Controller using PIC Microcontroller

The soul of the Controlling Section is PIC16F877A. It process the data given by the Receiver Section. LCD Display, LED Indications and Motor status are updated according to the data. You can download the hex file and mikroC Source Code at the bottom of this article.

MikroC Code

// LCD module connections
sbit LCD_RS at RB2_bit;
sbit LCD_EN at RB3_bit;
sbit LCD_D4 at RB4_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D6 at RB6_bit;
sbit LCD_D7 at RB7_bit;

sbit LCD_RS_Direction at TRISB2_bit;
sbit LCD_EN_Direction at TRISB3_bit;
sbit LCD_D4_Direction at TRISB4_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D6_Direction at TRISB6_bit;
sbit LCD_D7_Direction at TRISB7_bit;
// End LCD module connections

char txt1[] = "Water";
char txt2[] = "Level";
char txt3[] = "Indicator";
char txt4[] = "And Controller";

char mtr1[] = "Motor ";
char mtr2[] = "OFF";
char mtr3[] = "ON";

char wtr1[] = "Level: ";
char wtr2[] = "Very Low";
char wtr3[] = "Low";
char wtr4[] = "Medium";
char wtr5[] = "High";
char wtr6[] = "Full";

void main() 
{

  int i = 0;
  int c = 16;
  int b = 0;
  CMCON = 0x07;
  ADCON1 = 0x06;
  TRISA = 0x0F;                  // set direction to be input
  PORTA = 0x00;
  PORTD = 0x00;
  PORTC = 0x00;
  TRISB = 0x00;                  //  set direction to be output
  TRISC = 0x00;                  // set direction to be output
  TRISD = 0x80;                  // set direction to be output

  PORTD.F2 = 1;
  PORTD.F7 = 1;

  Lcd_Init();                    // Initialize LCD
  Lcd_Cmd(_LCD_CLEAR);           // Clear display
  Lcd_Cmd(_LCD_CURSOR_OFF);      // Cursor off
  Lcd_Out(1,1,txt1);             // Write text in first row
  Lcd_Out(2,1,txt2);             // Write text in second row
  Delay_ms(500);
  Lcd_Cmd(_LCD_CLEAR);           // Clear display
  Lcd_Out(1,1,txt3);             // Write text in first row
  Lcd_Out(2,1,txt4);             // Write text in second row
  Delay_ms(500);

  // Moving text
  for(i=0; i<15; i++) 
  {    
    Lcd_Cmd(_LCD_SHIFT_RIGHT);   
    Delay_ms(125);
  } 

  i=0; //Motor Status OFF
 
  do 
  {    
    Lcd_Cmd(_LCD_CLEAR);    
    Lcd_Out(1,1,wtr1);    
    Lcd_Out(2,1,mtr1);    
    if(c>0)
    {
      PORTD.F2 = 1               //LCD Backlight ON
      c--;
    }
    else
      PORTD.F2 = 0;              //LCD Backlight OFF
      
    if(b>0)
    {
      PORTD.F0 = 1;              //Buzzer ON
      Delay_ms(125);
      PORTD.F0 = 0;              //Buzzer OFF
      b--;
    }
      
    if(PORTD.F7 == 0)            //Manual Backlight ON
      c = 16;
     
    if(PORTA == 0x0F)
    {
       PORTD.F1 = 1;
       Lcd_Out(1,8,wtr2);
       Lcd_Out(2,7,mtr3);
       PORTC = 1;
       if(i == 0)
       {
          c = 16;                //Backlight
          b=3;                   //Buzzer
       }
       i=1;
    }
    else if(PORTA == 0x0E)
    {
       Lcd_Out(1,8,wtr3);
       if(i == 1)
          Lcd_Out(2,7,mtr3);
       else
          Lcd_Out(2,7,mtr2);
       PORTC = 3;                 //LED Bar
    }
    else if(PORTA == 0x0C)
    {
       Lcd_Out(1,8,wtr4);
       if(i == 1)
          Lcd_Out(2,7,mtr3);
       else
          Lcd_Out(2,7,mtr2);
       PORTC = 7;                  //LED Bar
    }
    else if(PORTA == 0x08)
    {
       Lcd_Out(1,8,wtr5);
       if(i == 1)
          Lcd_Out(2,7,mtr3);
       else
          Lcd_Out(2,7,mtr2);
          PORTC = 15;              //LED Bar
    }
    else if(PORTA == 0x00)
    {
       Lcd_Out(1,8,wtr6);
       Lcd_Out(2,7,mtr2);
       PORTD.F1 = 0;              // Motor OFF
       if(i == 1)
       {
         c = 16;                  //Backlight
         b = 3;                   //Buzzer
       }
       i=0;                       //Motor Status Updated
       PORTC = 31;                //LED Bar
    }
    else
       PORTA = 0x0F;
   Delay_ms(125);


  }while(1);                     // Endless loop
}

Working

For the transmission and reception of data we have used Holtek encoder-decoder pair of HT12E and HT12D. Both of them are CMOS ICs working voltage ranges from 2.4 to 12v. The oscillator resistances are chosen according to the datasheet. When water level raises, the data pins of the encoder will be grounded corresponding to the level of water, which will be transmitted to the Receiver via ASK RF module. The received data is decoded by the decoder HT12D. LED on the receiver indicates that it is receiving data. Then the data is given to the PIC for processing.



D0 D1 D2 D3 Status
0 0 0 0 All data pins are grounded, indicates tank is Full.
0 0 0 1 Water level is below D3 and above D2, indicates High level.
0 0 1 1 Water level is below D2 and above D1, indicates Medium level.
0 1 1 1 Water level is below D1 and  above D0, indicates Low level.
1 1 1 1 Water level is below D0, indicates Very Low level.

When the water level becomes Very Low, the motor will turned ON, buzzer sounds and the LCD backlight will automatically turned ON for 5 seconds. After this, when the water level reaches Full level, the motor will automatically turned OFF, buzzer sounds and the LCD backlight will automatically turned ON for 5 seconds. During normal operation you can manually turn on LCD backlight by pressing the Push button switch. The LCD indicates the Level of water (‘Very Low’, ‘Low’, ‘Medium’, ‘High’,’Full’) and the status of the motor (‘ON’ or ‘OFF’). The LED bar will also indicate the level of water.

Download Here

You can download the hex file, mikroC source code, PCB Design, Layout, Proteus and Orcad files here.

Buy Here

  • Sale
    Out of stock
    16x2 Green Character LCD Module16x2 Blue Character LCD Module

    16×2 Character LCD Module

    0 out of 5

    16×2 Character LCD is a very basic and low cost LCD module which is commonly used in electronic devices and projects. 16×2 means it contains 2 rows that can display 16 characters. In these displays, each character is displayed using 5×8 or 5×10 dot matrix.  This module can display ASCII characters, special characters and even custom characters. It uses HD44780 compatible controller for its operation. Two variants of this LCD modules are available, one having BLACK characters on GREEN and other having WHITE characters on BLUE.

    150.00165.00 149.00159.00
  • -12%
    ASK RF Transmitter and ReceiverASK RF Transmitter and Receiver

    ASK RF Transmitter and Receiver

    0 out of 5

    ASK RF Transmitter and Receiver pair is a low cost ideal solution for remote control applications. It is able to transmit data over 100 meters range. It is available in two frequencies, 315MHz and 434MHz. Transmitter is able to operate in a wide voltage range, 3 – 12V making it ideal for battery powered applications. Receiver operates in 5V making it ideal to interface with microcontrollers.

    260.00 229.00
  • -2%
    HT12E Encoder and HT12D Decoder ICsHT12E Encoder and HT12D Decoder ICs

    HT12E HT12D Encoder Decoder Pair

    0 out of 5

    HT12E and HT12D are Encoder Decoder ICs manufactured by Holtek for Remote Control Applications. These ICs can be used with ASK RF Transmitter and Receiver modules. By using the paired HT12E encoder and HT12D decoder we can transmit 12 bits of parallel data serially. HT12D simply converts serial data to its input (may be received through RF receiver) to 12 bit parallel data. These 12 bit parallel data is divided in to 8 address bits and 4 data bits. Using 8 address bits we can provide 8 bit security code for 4 bit data and can be used to address multiple receivers by using the same transmitter.

    55.00 54.00



Share this post

  • srikanth

    Dear friend how much distnce it will work

  • More than 100m……..

  • Hirak Das

    dear friend pls tell me the crystal value
     

  • You may use 4 or 8 MHz……

  • Sallysamantha5988

    can we get the programming of this project??

  • Ace Virgil Villaruz

    where can I buy the materials needed for this project?

  • Do you mean the programmer to write program to PIC Microcontroller?

  • You can get if from a good electronics shop……..

  • Sallysamantha5988

    Yes…can we get that  programmer languange? thank you..

  • Do you mean programmer or compiler?

    The programming is done by using MikroC Compiler….
    You can download the trial version from their site : http://www.mikroe.com/mikroc/pic/

    Trial version is sufficient for this….

  • Sallysamantha5988

    ok.tqvm..

  • I have included the source code along with the zip file…………

  • Sallysamantha5988

    what others software that i need to used in this project,except for the microC pro software??because i found that i can’t open some sourcecode in the Zip file..

  • programming is done using mikroc pro…….

    the circuit can be simulated using Proteus and PCB designing is done using Orcad 9.1 whose files are included in the zip file…

  • Md.

    I completed this project in bread board , connect the all component correct connection but Transmitting or Receiving system does not work properly. Hang up always indicate Level: Full, Motor OFF. How could i solve this problem? plz help me……….

  • Check the transmitting and receiving circuit……….The LED in the receiving circuit will glow when it receives signals from the transmitting circuit……..

  • Modasser_84

    I face a new prob……when I D0 throw ground Level: Low , Motor ON. but when D1 is grounded Its showed Level: Very Low,Motor On. after that D2,D3 grounded Level:”  “, Motor:”  “……….All the connection are correct and ok…………but when I remove D1 from receiver of decoder Its work proper but D0 is showed both level: Low/Medium.and finally D2,D3 was showed correct data…… now what should i do…..plz help me..The LED in the receiving circuit is glowing……….. 

  • There are only 5 valid conditions for D0, D1, D2, D3
    as shown in the table given in the article………Please refer it……….Un-implemented inputs may generate un-predictable outputs……….

  • Modasser_84

     I understand ……..bt the receiver of decoder D1 is always shown +5 volt it doesnt generate 0 volt is it the decoder IC problem??????????? I gave implement input…..D0,D1,D2,D3 (Close)……by the reverse condition D3, D2,D1,D0 (Open) Isnt correct loop????????

  • It may be the decoder or encoder IC probelm………check with another IC …….also check for unwanted shots………..
    I don’t understand the last sentence you said….

  • sumonrashid
  • Variable C is used to light led backlight when switch is pressed or when motor on off conditions occur………b is used to sound the buzzer 3 times……….

  • bentancc

    Hi, could this project be modified to read diesel tank level instead of water?

  • No, it is dangerous……………..

  • A.Faisal

    hi. I feel curious about the tx and rx circuit. I found one RX and TX module, but the leg is not same. If i use that, still can work or not?

  • If it is ASK TX and RX you can connect HT12D and HT12E to its appropriate pins

  • A.Faisal

    ok. thank you. btw, this project is really working right? in term of rx and tx circuit.

  • Yes it is working perfectly ….. You can buy the rf transmitter & receiver online from extereme electronics or robokits…

  • A.Faisal

    Thanks. I will post it to you when its working. Btw, I’m looking forward to work with you with other project. Maybe we can work together.

  • Yes, of course……

  • Simba

    how do you pair the two or there is no need to pair the two they will automatically pair?

  • You mean transmitter & receiver? ……. Encoder and Decoder IC contains Address pins A0 – A7…… in both transmitter and receiver, status of these address pin should be same……

  • Simba

    yes I meant the transmitter and receiver. I want to use the two for wireless sensor monitoring connected to the Arduino uno. Thanks for the response

  • Tommy

    How i can change the programming using mplab??

  • FARISH

    HOW CAN I BURN THE PROGRAM TO IC….?

  • You need a PIC Programmer for writing program to pic..

  • Take the logic from mikroc and convert it to mplab..

  • Rochelle April

    Hi, would like to ask if do you have a code for this ? I want to try this in virtual breadboard. We have a finals for PIC Microcontroller, and I’m searching for easier but working one 🙂 Looking forward to your reply. Thanks and Godbless.

  • Yes you can download codes etc from above link……..

  • Rochelle April

    Hi. I don’t get the code, sorry, I’m new to vb. I’m working to understand but it’s so hard. When I try to assemble your wli.asm file you provided, it has 400errors. And I don’t know what lines causes the errors.

    And may I know please if what is its processor used?

    like the sample code below:

    processor 16f84
    #include
    __config _RC_OSC & _WDT_OFF & _PWRTE_ON
    STATUS equ 03h ;define address for the status register
    TRISA equ 85h ;define address for the tristate register for port A
    PORTA equ 05h ;define address of port A
    TRISB equ 86h ;define address for the tristate register for port B
    PORTB equ 06h ;define address of port B
    ORG 0x000
    BSF STATUS,5 ;switch to bank1
    MOVLW B’00000000′ ;set port B as output port
    MOVWF TRISB
    MOVLW B’11111′ ;set port A as input port
    MOVW TRISA
    BCF STATUS,5 ;switch back to bank0

    start
    MOVLW 01h
    MOVWF PORTB
    GOTO start
    END

    Pardon to have so much questions. Just want to understand it, hope you helps ♥ thanks.

  • farish

    what is the ‘contast 100’ in the circuit….?
    and what type of switches that we have to use in place of ‘reset’ and’manual lcd backlight’?

  • It is a variable resistor use 10K, used to adjust the contrast of LCD……. You can use micro switches ,,,

  • That is a MikroC program written for PIC 16F877A microcontroller…….

  • farish
  • You can download the entire project files from the above download link…..

  • my circuit is already operation, but my problem now. i don know how to convert the programming to mplab because we study using the mplab..i dont have the converter and programer to install the programming in pic using mikroc… can u xplain more detail step to convert the programming to me.. or if u have the programming in mplab.. can email me [email protected].. tq

  • You can write the hex file to the pic microcontroller in the downloaded zip file using a pic programmer…….if you want to convert the program to mplab……. take the logic of mikroc and write your own code……..

  • nimra

    hey, what changes will be required if motor work is excluded i want only indication in lcd

  • Remove the relay and its driving circuits……….
    LCD indications include motor on off status……. you can remove this by editing the program…

  • abhay

    wat is the crystal value???

  • 8MHz

  • steve

    hi can we use a cheaper or smaller mcu ? and how to modify the program

  • Yes, of course..
    You may use 8051
    But PIC is also cheaper, PIC16F877A costs below 3$..

  • Nibhath

    Hey Ligo,I wish to implement water level controller based on 16F877A PIC microcontroller. Important thing that detect the water level continuously using vertical float switch sensor.It gives output as resistance.I would like to know how float switch sensor apply to this system and how mikroc program for relevant change…Looking forward to your reply ASAP..thanks friend…

  • You need to use an ADC….. Since wireless communication via RF module is required… only discrete values are possible.. from 0000 to 1111… total 16 discrete values possible… If you need more accuracy it will become more complex…

  • Nibhath

    In this system has one of particular water level unlike site having system.System design to maintain that particular water level.The tank contain inlet and outlet in order to insert water into tank and eliminate water from tank.Inlet and outlet should be activate when water level goes below and above of that particular water level separately.I wish to deploy this into paddy field.Since there require predefined water level for each mtime period.Your system having discrete water level is not practical when implement to paddy field.That’s why i selected float switch.I want to know about mikroc program of control section and how it change when apply float into this system..Look forward your reply…Thanks Ligo

  • vinutha

    sir can you please provide me with the complete code for the project.. its little urgent, as ma presentation is this weekend 🙁

  • There is an option to download the complete project files… above…

  • faisal

    Hi Ligo. Long time no see. For your information, I already build up the circuit. Left things is to program the circuit into PIC. I just want to know, the 12V power source is necessary or not? because I dont see 12 V power supply connected to circuit that you created for simulation.

  • 12V is used to operate the relay that used to control the motor… If you wish to use 5V relay, then you can avoid 12V.. I think 5V relays for handling high currents are not available..

  • faisal

    i see. another thing, seeing the 5V as primary power supply for the controller circuit, is it sufficient to power up all the components eg PIC, level LED, LCD screen. FYI, i tried to make the PIC used the stand-alone power supply which is 5V, but not working. If i connected it to one source only, it lit up but somehow the display fluctuated. keep resetting.

  • Yes, that 5V power supply is enough…. You should add enough filtering capacitors to avoid ripples as shown in the power supply circuit diagram..

  • Cyn

    My proteus is working but led didn’t light up and hardware for led n LCD also didn’t light up

  • Cyn

    By the way do u hav an actual circuit for me to see the connections?

  • The above circuit is the actual one.. VDD and VSS of the pic microcontroller is not shown in that circuit diagram.. VDD should be connected to 5V and VSS should be connected to ground..

  • You might not have connected VDD and VSS of PIC microcontroller which is not show in the circuit diagram.. Actually VDD and VSS are hidden in proteus.. anyway I will modify the above circuit diagram by including VDD and VSS..

  • Faraz Khan

    Please tell me whether, can i use this RF transmitter and receiver with the above circuit? ASK RF transmitter and receiver are not available in my area.

    kindly reply soon.

  • This might be differs only in pin diagram.. I think so.. You can buy RF modules that I used from many online stores.. just search it…

  • Faraz Khan

    can i use 20 MHz crystal ??

  • Yes … ofcourse…. change the clock frequency to 20MHz in the project settings and Build it again…

  • Faisal

    hi George, I want to ask, the output on decoder circuit is on what type? HI LOW or in binary number?

  • Actually, I don’t get your question… All binary numbers are represented using HIGH and LOW (here it is 5V and 0V)…

  • prakasha

    how to dowload the code.

  • Don’t you see the above download link. You must login to download it.. Please register and login, its free..

  • Faisal

    George, one more thing, the RX will read input from each respective pins and give data to correspondence pins on decoder right? Eg: pin 10 on encoder take data from tank, and the data will be transmitted and give that data at pin 10 on decoder. Am I correct? If I’m correct, than my project actually faced problem with this thing, where, if one pin of DATA IN on encoder take reading from the tank, then, the all DATA OUT on decoder give HIGH. Hope you can help me. I did troubleshooting many times including changing ICs, TX and RX, osc value etc.

  • HT12E – Encoder – (Data In) Reads data from water tank and gives it serially to RF Transmitter……..
    HT12D – Decoder- RF Receiver Receives data transmitted by Transmitter and it is given (serial data) to HT12E- it decodes it in to parallel output (Data Out)

  • Faisal

    OK, but seem, the output is not really good, where in case LOW level is detected, but, all output at HT 12D is HIGH. so how?

  • Does the LED in the receiver circuit glows when the transmitter circuit is turned ON?
    That LED indicates that the receiver circuit is receiving data from transmitter….
    You might have burned the encoder or/and decoder by misplacing them..

  • Faisal

    Yes, it does glow. Here is another problem, why everytime it read data from RX, it always reset? Sometime, when controller read HIGH to MEDIUM, then the controller reset again, not live feed.

  • I don’t get what you said..

  • SRI

    Dear Friend What is the Configuration of PIC16F877A

  • Here is mikroc project settings.

  • Atchai

    can we use ir transmitter insteed of rf transmitter?>What’s difference between both?

  • Yes you may use….
    . IR –> Infrared
    RF —> Radio frequency..

    IR allows only Line Of Sight communication and less range.. RF has no such problems..

  • Regina Assuncion Adame

    good day.. i have a question.. where or in what pin im gonna connect the rf receiver to the pic16f877a.. sorry kinda new to this one..

  • See the labels on data pins on pic and rf receiver (HT12D)…..

  • Regina Assuncion Adame

    oh i get it now.. i will put it on RA0- RA3.. thanks sir.. i have 1more question sir.. if i wil put uart converter or max232 and rs232 to connect it to serial port of the computer and display it through visual basic instead of the LCD.. will it be working?.. thank you

  • Of course .. it will work…

  • Regina Assuncion Adame

    sir.. i edit the circuit diagram so i can interface it to the pc and visual basic.. is this correct..thanks

  • There is a small mistake…….
    RX of PIC should be connected to TX of UART Converter..
    and..
    TX of PIC should be connected to RX of UART Converter..

    Hope you got it..

  • Regina Assuncion Adame

    ooppss..thank you sir…

  • Regina Assuncion Adame

    good day sir.. i would like to ask if how far will be the maximum distance of the rf transmitter to the receiver?.. thank you

  • You can have about 100 meters range with proper antenna..

  • sophie

    that is good,but do i need two microcontrollers for receiver module and transmitter module or just one? if it only one PIC how is it connected to receiver and transmitter module.

  • sophie

    I would like to know also if i want to have multiple water tanks what should i do?

  • sophie

    how can use Proteus for simulation if the tanks are out of the site?

  • You need only one microcontroller.. .which is used in receiver module

  • you may use multiple transmitter/receiver with different frequencies..

  • We can’t do proteus simultion.. since transmitter and receiver are not available in proteus library..

  • junaid ullah

    i need a circuit with out using rf antenna
    what should i do

  • Without RF antenna?? Every RF wireless device should have an antenna to radiate energy..

  • Albin George
  • Albin George

    i need to add a manual switch to on the motor(When the water level is above medium or other case ). What changes i need to made to the code?

  • VB Code??
    This project hasn’t any interface with PC..

  • Simply connect a push button switch to a IO pin of PIC.. make that pin input … see our pic tutorials..

  • raj

    Hi Ligo, i couldnt get any thing on the LCD despite programming successfully with PICKIT2 using hex file you’ve provided.but the LEDS and buzzer are working in a continuous loop i dont understandwhat might be the reason there is nothing displayed on the LCD(rest everything including LCD backlight working,also I tried the contrast preset but nothing on the Lcd).please help.

  • There might have some connection problems.. above circuit and program is 100% working..

  • Guest

    there is no download option ….please help in getting the code..

  • vijay

    will copper wires be efficient as sensors in this project??????

  • kotelo

    can I use PIC16F887 in this Project, if yes help in getting the source code

  • kotelo

    can I use PIC16F887A in this Project, if yes help in getting the source code

  • Antu

    can i use this controller without RF transmitter? i prefer normal sensor probes eg: float switch, will it work ?

  • Antu

    i made this wlc on a breadboard and it works fine.The only problem i found was there is no dry run protection for the motor..

  • Krishna

    No…. Due to current passing in the wires.. Because of electrolysis the copper will be eaten Up with a time less than 1 week. ( I Faced the same problem) “sorry fro bad english”

  • Mangala Kulasekera

    i have difficulties with programming of ic 16f877a. can i get programmed ic.

  • sunil

    this is not a complete water level controller. sump tank sensor is missing

  • Shri Kamble

    i got the whole program of this, comment your id here 😀 😉

  • Mangala Kulasekera

    It is not available ask transmitter receiver and decoder in my country.how can I get these.

  • viju
  • You can download the entire code at the bottom of above article.. just before the ads..

    If haven’t yet done it with float..

  • Try online shopping..

  • axel
  • Download the above zip file and extract it.

  • Batman

    I use a uln2803 because is not available ask transmiter in my country,it doesn’t mather right?

  • Which Country?

  • Batman

    I need or not the ULN2803?

  • You don’t need ULN2803 for this project..

  • murthy

    hi, can i use PIC 16F877

  • Murthy kamireddi

    Hi, While programming to IC i am getting some problem, so please help me..

  • yes, just change the pic in mikroc project settings..

  • Hello,
    Please elaborate your problem….. I don’t get it..

  • Murthy kamireddi

    hi, While programming to IC i am getting some problem (see in photo attached)

  • Why did you use Manual Device Select ? PICkit 2 can automatically detect the target. .
    Uncheck Programmer >> Manual Device Select

    Try changing the PIC Microcontroller..

    And the above project is done using PIC 16F877A.. not using PIC 16F877

  • Murthy kamireddi

    ok, i will try, thank you

  • Murthy kamireddi

    I have done this project, its working successfully, thanks for this project

  • Murthy kamireddi

    ……….

  • Hello,
    Thanks for the feedback. 🙂

  • Murthy kamireddi

    Hi, Its not sensing from tank(first floor) to main controller with receiver(in ground floor), if both are in same floor its working, so what should i do.

  • I think, it is the problem of your antenna… Try using simple wire antenna or Aerial antenna..

  • Murthy kamireddi

    I have used antenna by using Copper wire(shown in attached pic)

  • Use a simple aerial antenna.. or simple wire antenna.. without these turns..

  • Murthy kamireddi

    While starting LCD display its showing “Project developed by———————–” . Is it possible to change that names in source code.

  • Yes, it is possible.. You can edit the source code..

  • Murthy kamireddi

    1) what file should i use from above RAR,…….
    ASM or MicroC.
    2) which lines i have to change

    Please give me some instructions.

  • Download and install mikroC pro for pic microcontroller… open wli.mcppi using that..
    You can find C code there and edit it. .

  • Murthy kamireddi

    Then how to convert that file to hex

  • Build the code after editing, then the new hex file will be generated.

  • axel

    I have programmed the pic successfuly using mplab ipe but when im powering up it look like the controller is freezing and i have to reset many time before getting something in the screen and it freezes again

  • Murthy kamireddi

    I have edited the same code from above RAR, but its showing some errors (i have changed name only)

  • The above project is done using mikroC pro not using MPLAB IDE. You may use MPLAB for programming the hex file.
    There is no problem with the program. It might be some hardware issues.
    See the comments below, some of them successfully completed the above project.

  • You can remove that line CMCON = 0x07;
    There is no CMCON register in PIC 16F877..

  • amat

    hello sir ,where can ifind the source code .can you give the link?

  • Satheesh

    Hi, can I use a 4Mhz crystal instead of 8Mhz. If so, do I need to change and edit the source code. Please help me how to do it, because I’m new to c programming. Thank You

  • Yes, you can use 4MHz crystal.. Just edit the MikroC project settings and rebuild the project.

  • riyaj

    sir i want the complete assembly program so kindly give me the link

  • Sorry, I haven’t the assembly code.

  • Benyameni Benyameni

    Hlw mr Ligo George i am a student at Namibia i am currentry bisy with my project bt i am failing to come up with the circuit diagram can you please help me here is the scope of it its a water level indicator project

    It mainly consist of following
    blocks:

    1. Potentiometer and pulley
    arrangement: We have to measure the water level, for this purpose we are going
    to use a pulley-float/potentiometer arrangement. Pulley will be hanged above
    the water and a float will be resting on the water surface using a rope. And
    potentiometer will be fixed at the center of the pulley. So as the water level
    goes up and down, respectively pulley and potentiometer will rotate. So
    eventually water level is converted into resistance of potentiometer. A
    constant current source is used to pass current through this potentiometer, so
    as to get a voltage drop. This voltage is given to amplifier.

    2. Amplifier: As the voltage output
    across the potentiometer is less, it has to be increased to 0 to 5 volts range.
    We are going to use linear amplifier for this purpose.

    3. Voltage to frequency converter:
    The main part of our project is microcontroller (89s51) which reads only
    digital input (0V & 5V) But the output of Amplifier is in analog form, so
    it has to be converted into digital format, for this purpose we are going to
    use Voltage to Frequency converter to convert analog output from amplifier into
    the digital output to be given to microcontroller

    4. Microcontroller: This is the CPU
    (central processing unit) of our project. We are going to use 89s51, because it
    belongs to the 8051 family. The various functions of microcontroller are like:

    I. Reading the digital input from Volt to Freq converter which is derived from Potentiometer and pulley arrangement II. Sending this data to LCD so that the person operating this
    project should read the values of Water level. III. Storing the data into
    EEPROM memory and display it later using keypad IV. Sending the values of
    temperature and light to the computer using serial port

    .

    6. LCD: We are going to use 16×2
    alphanumeric Liquid Crystal Display (LCD) which means it can display alphabets
    along with numbers on 2 lines each containing 16 characters.

  • No need to use Voltage to Frequency converter.. use Analog to Digital Converter.

  • Benyameni Benyameni

    can u plz provide me with a circuit diagram

  • Sorry, I haven’t any circuit diagram,, check our adc tutorials.

  • Benyameni Benyameni

    thank u sir Ligo

  • Benyameni Benyameni

    How are u Mr Ligo George I am doing the water level indicator project i attached the broke diagram but i am stuck with the circuit diagram now i found the almost similar project with mine bt this one include measuring water level and temperature i took the circuit diagram of it but now i want to remove the temperature component but i am falling to do it please help me remove the than i will be left only with the components of water level in the circuit here is the circut attached please u can even draw it on paper and scan it and upload it i want to simulate it using proteas software.

  • Benyameni Benyameni

    block diagram

  • Sorry, I don’t get what you are talking about.

  • zara

    can someone please list all the components /equipment for this project

  • twentyone21

    Hi. Im doing a simple WIRELESS water tank project with pic18F4515 using mplab but i dont where to start i dont have schematic diagram can you help me with my project? my project needs only 2 LED (if the water its highest level the tank will automatically switch off) and we have to use float switch. please help me

  • Use above project as reference..

  • amat

    Hello Sir ,can you list up the component that use in this project?

  • poni

    Hi sir, i have a project on water level with water pump. i dont know how to connect water in the tank to the motor with the pic16f887. thank you

  • Charishma Yerramsetti

    sir,can we use ARM(lpc2148) microcontroller in the place of PIC?

  • Note it from the above circuit diagrams

  • It is given in the above circuit..

  • Yes,, but you need to program it.

  • Ryandude

    Hi sir, im doing this project now and i have a question. Is it only 22pFarad capacitor can be used in oscillator or we can use other value for it if not available. What will happen to the program if im not using a 22pFarad capacitor?

  • It will work without 22pF…

  • manu

    Your project is nice but there is some problems in working time. RF communication is common through anywhere your device is caching all rf frequencies in surrounding….please try to modify that in usart communication…..

  • Here, it is not a big problem as the RF signals are already encoded and decoded……
    If the problem still persists, it can be solved by proper programming..

  • Er Nitin Ahuja

    sir, if we are using two set of rf module in same place they are not working. one rf reciever become off . they are getting interference from each other. how to remove it.

  • You can use 433Mhz and 315MHz transmitter receiver pairs… as they are different frequencies they will not interfere.

  • Er Nitin Ahuja

    are u tested it…sir…..???

  • yess

  • samantha perera

    pls tell me the maximum distance between transmitter & receiver

  • hema

    hey, by the way this have contacts in the water, which will corrode the elements and stop functioning later. there is another one without any connections with the liquid.
    Any way good attempt. 4Sn.

  • It will be about 100 meter with proper antennas.

  • You may use floating switch..
    Magnetic reed switch, tilt switch… etc..

  • Cherovlet Comaro

    Good day sir,
    I have tried to understand your code one line by another but I found it difficult to do it because you don’t put comment next to you code for each lines.
    I hope you can help me to understand you code better by putting more comments.
    Kindly regards.

  • Article updated…. try now..

  • Didymus Nota

    Hi sir how can you write a code to run a stepper motor using micro c

  • koushik pramanik

    can i use with out wireless device? i want to use a 5 core cable?

  • Yes, you may use 5 core cable with ground..

  • Er Nitin Ahuja

    sir, i want to display uart data(from gps module) on lcd 16*2… pls check the code in mikroc & 16f877a microcontroller

  • Er Nitin Ahuja

    pls chek the code sir…..i am sending uart data via UART terminal at mikroc. at virtual terminal of uart, data is coming correctly,but on lcd it is not diaplaying

  • yusman

    Sir, what components should be replaced if I want to use float switches to detect the water level and without having to use Any ASK rf transmitter and amplifier? And would that be possible for the system to run?

  • Hello, your doubt is not related to above article, please use our forum for that :
    https://electrosome.com/forums

  • You needn’t replace any components. You can connect float switches directly.

  • Wasim Sheikh
  • Yes, you can do it.
    Sorry, we don’t have code.

  • Zameer Ahmed

    Hi George,
    which file is related to pcb design and Layout.
    Please let me know

  • *.MAX files.. they are OrCAD files..

  • Ian

    Is is possible to have the receiver unit hook up to wi-fi set up so the tank level information can be accessed on-line?

  • You may do it using wifi modules……

  • Tom

    If I wanted to use some float switches, that change from NO to NC or vice versa in place of bare wires, where would the two wires from these switches be connected? Thanks!

  • connect it to.. ground and sensing pin in the transmitter.

  • Diveshjain

    Can i replace pic micro controller with 8051 or AT89s52 micro controller

  • RAM

    pls give me the main circuit PCB DESIGN

  • Yes, you can;.. but you should do the programming of AT89s52..

  • All PCB files are available in the zipped folder.

  • sana reddy

    Lcd display is not showing any display and led is not glowing but code was sucessfully executed so where is the problem i can’t understand please help me.

  • In HARDWARE or PROTEUS ?
    The above project is 100% working.. you can see the comments below. Some of them posted the photos of finished items.

  • Divesh jain
  • sana reddy

    thanks for providing code .At first time after simulation it is showing display in reverse no change in output

  • Sorry, we don’t have any ppt.

  • Sorry, I don’t understand your question.
    The above project is 100% working. You can see the completed photos of some users here.

  • Jefff

    Hello, can I use different value resistors for the oscilators than the ones in the diagram ?

  • You mean oscillator resistors for HT12E and HT12D ?
    You can use 51K MFR and 1M resistors.

  • Nidheesh

    What if i used 10Mhz crystal insted of 8MHz?

  • You can change it in MikroC Project Settings. Don’t forget to rebuild the project after changing.

  • Nidheesh

    Can I use HC-SR04 Ultrasonic Sensor for this?

  • It might not be a good option.

  • PanDan

    Hello sir can I add a water temperature sensor?

  • Vishwa

    Hi, Can you tell me the purpose of using HT12E & HT12D?

  • Yes ofcourse you can.

  • For encoding and decoding signals to a single line for transmission.

  • kushan

    how to connect (which pin) pB switch for manul motor on/off,and need to edit code for that?

  • Adam

    Dear Ligo
    i need to ON and OFF on pin from pic for 5 min ON and OFF for 2hours. will it possible, if possible can provide the code.

  • Adam

    i need to ON and OFF, PORTD.F3 from pic for 5 min ON and OFF for 2hours. will it possible, if possible can you please provide the code.

  • Sambarta Banerjee

    Sir wont anyone feel any electric shock when I dip the +5V into the water when Im using pump and at the same instant someone uses the water?

  • You can connect switch to any of the remaining IO pin but you should add it in the program.

  • 5V will not provide any electric shocks.

  • Adam

    Hi Sir
    Could please tell me how to make ON and OFF any pin from Pic as 5min ON and 2hours OFF, when did the coding, level indicator stop working

  • prashant

    from where to get the floating switch.. have searched abt and confused which kind of floating switch shuold work better ?

  • Sorry, I didn’t understand you question.

  • enerpadanaV

    Hello I use MPLAB IDE and MPLAB ipe to compile and progammare the pic , I wanted to know if the hex file in the document is ready to be loaded in the pic ?

  • yes, it is ready to be loaded.

  • Shivendra Kr. Sahu

    When we take on the use of a metal contact, so he is very perishable. What do you suggest for him?

  • Vaishali

    sir, i want to know where the motor is connected in the circuit?

  • You can use floating sensors or use ac sensing method.

  • Motor is connected in series with the relay.

  • Vaishali

    Thank you sir.
    I am new to mikroC programming so i want to know how to understand the program given by you.
    if you have any tutorial or handouts or if you can suggest me a website from where i can understand the program. please reply as soon as possible.

  • You need to learn MikroC programming for understanding it.
    PIC Microcontroller MikroC Tutorials : https://electrosome.com/category/tutorials/pic-microcontroller/mikroc/

  • suresh

    Hi,
    I did this project successfully but i would like to add something more like ds1307 clock and display time on screen and motor should not on between 6pm to 9 pm plus suction water empty protection if you can make it for me please modify the circuits and codes

  • Sorry, it is very difficult for us to customize program for each and everyone. If you want something like that, please hire one of our engineers and pay for it. It will help us to live.

  • Manu

    sir we are not using lcd display…suppose we load same program cn i get output or not

  • HASHIM ASHRAF

    HC-SR04 working perfectly for me in the water tank

  • Yes, the same program will work without LCD also.

  • jayjay

    sir, how high should this be if i were to install it from the ground for a flood warning purpose?

  • kishyenraj

    what type of sensor do you use?

  • It depends on the level you want to detect. Make sure that the circuit is above that level.

  • You can use a simple conductor with low corrosion.

  • divya

    can i get the algorithm for water level indicator in dams

  • Hi,
    Can you please explain in detail ?

  • divya

    i need a algorithm to check water level in dam

  • divya

    i need an algorithm for water level indicator in dam

  • Mira Zaini

    hi sir, can i change the PIC16F7787A to PIC18F4550?

  • amer

    Water Level Indicator and program pic 16F876

  • Yes, you can change it. But why you need 18F4550 for a water level controller ? In my openion 16F877A is more than enough for it.