Saturday, 12 July 2014

Water Presence Sensor Using PIC16f887 and RF Transmitter Receiver.

Hello and welcome to my blog,

RF Transmitters and Receivers are quite easy to use and cheap now a days. Today, I will teach you how to design your own Water Presence/Level Sensor which can transmit up to 100mtrs. I have designed this sensor keeping in view the need to wireless transmission from the Water Container to the end where the user need indication.

The PIC used in this sensor is PIC 16f887. The reason I have used an upper class of microcontroller for this small project is to enable you to play more. For example, you can upgrade to sensor to display the current level of water using an LCD. Also, you can try interfacing a GSM Module to the same project. If you want to share any idea, I am here to help!  To see how you can interface a 16 x 2 LCD to  PIC 16f887 micro controller, please visit http://pictronics.blogspot.com/2014/06/issues-interfacing-and-lcd-to-pic.html

Pin Configuration for BC547
First of all, I will show you how you can design a cheap and simple water detection sensor. The sensor is designed in such a way that the microcontroller senses the water presence for 15 secs. As soon as This can be done by using a simple NPN Transistor. You need to submerge two probes in water container in which you want to detect water presence. Apply a +5V supply to one of the probes and attach the other probe to the base of the NPN transistor. The transistor I have used is BC547. The datasheet for this transistor can be view at http://www.fairchildsemi.com/ds/BC/BC547.pdf


Transistor Based Water Detection Sensor.
By this, when ever the probes will be submerged in the water in the container, the base of BC547 will become high and turn the Transistor ON. Now this signal is ready to be transmitter by using a transmitter. 

For this, the circuitry used is the same as the used in the RF Remote Controller. This high output from the transistor is fed to the input of PT 2262 IC which is encoder for RF Transmitter. The data sheet and specifications of this IC is given at https://www.futurlec.com/Others/PT2262pr.shtml. Please refer to the data sheet for more information regarding this IC.

PT 2262 generates a specific bit code against the output of the transistor fed to the input of one of the pins of PT2262. This code is transferred over the RF transmitter receiver. The RF Transmitter/Receiver I have used in this project is FS1000A which is 315 MHz cheap, easy to use and easily available everywhere.

 FS 1000A is can transmit easily upto 100 meter. Although, the transmission distance is greatly effected by some of the very important factors that includes supply voltage and antenna design.

Please note that the original transmitter does not comes with the antenna and you will have to build or buy one from you own and believe me, a simple wire jumper coiled form to will work.
Specifications for FS1000A
The complete circuit diagram for the transmitter section is given as under. Don't forget to use the proper oscillation resistance for PT2262 IC which is 4.7MOhms.

Now, we shall move to the Receiver Section, The bit code transmitted over the transmitter is received at the other end which is now ready to be decoded, this is done using the pair IC of PT2262 which is PT2272. The output of PT2272 will give high output whenever there is an input signal from the Receiver. The program for the microcontroller is written in the MikroC IDE. 
Please see the attachment for code and proteus simulations. The Proteus Simulation does not contains the RF Transmitter and receiver as we cannot virtually test a RF Tx/Rx. The circuit diagram for the Receiver section is given as under. 

The controller will count for 10 secs of the input is high. After that, it will turn an LED on to indicate that probes are submerged for 10 secs. 

Please don't hesitate to contact me if you have any query. 

To download Circuit Diagram, Proteus Simulation and .hex file for MikroC, please click here.

Happy Playing!!

Mohammad Bin Islam

No comments:

Post a Comment