This isn't the best answer since it really involves another chip but have a look at the Qprox QT114 chips series. If you need a data sheet email me off list and I'll send you one. Gary. -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of cdb Sent: Thursday, January 30, 2003 9:15 PM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: waterlevel (on/off) on a PIC pin On Fri, 31 Jan 2003 01:25:58 +0200, Peter L. Peres wrote: My (probably wrong) calculations show that a 2mm wire in a 10mm i.d. tube, 20 cm long, should give about 0.5 pF in air and 41 pF in water, with the capacitance changing linearly with water level. Neglecting the influence of the paint dielectric, which is supposed to be very thin. I used the plate capacitor formula for this (not the one for cylindrical caps) so the numbers are slightly off. I tried this method in my rain detector, from a circuit published in Circuit Cellar and Elektor sometime ago. Just couldn't get it to work, the 'capacitor was to be the frequency determining component of the astable. I also tried detecting a pulse duration difference between wet and dry with a timer working out the wet threshold. In the end I've gone back to the astable resistive probe technique and causing an interrupt on RB0. As a supplementary question, what precautions might work as far as protecting the PIC from lightning? I've pondered with a opto isolator between the HC4093 output and the Pic pin plus or a MOV on the actual sensor board or some form of back to back Zener Diode arrangement. I don't mind if the opto or the gate disappear in smoke, but the Pic is just that wee bit more expensive. Any ideas? Colin -- cdb, bodgy1@optusnet.com.au on 31/01/2003 I have always been a few Dendrites short of an Axon and believe me it shows. Light travels faster than sound. That's why some people appear bright until they speak! -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body