Hello folks, you can check the level of a water tank easyly with a capacitive sensor. In a PIC, comparing two different times is a simple task. Consider two different monoflops, one is for reference and the second for measure. The tripping time depends on the R and C values. In both monoflops R is constant. In the reference monoflop C is a trimmer. In the measure monoflop C is the capacitive sensor. Both monoflops are triggered at the same time. As the reference time is constant, the time difference depends only on the capacitive sensor. The capacitive sensor is made of two coaxial tubes (copper, aluminium etc.)The inner tube is isolated with shrinking tube, plasic coating or something else. The tubes forms the two electrodes from a capacitor. The capacitance depends now on the material (water or air) between the electrodes. The epsilon of air is 1. The epsilon of water is 80. So the capacity of the sensor and the measure monoflop time is 80 times higher with filled tank compared to the empty tank. The time difference is linear to the hight of the water level. If the monoflops are triggered repeatedly you can exor the outputs and you get a pwm-signal which depends on the water level. After some RC-filtering you also get an analog value for a meter that shows the water level. There are some MicroChip application notes for resistance measure with a digital pin, so a 12C5xx is enough for this task. Of course it is possible to do this also with CMOS. There is a humidy measurement sensor from Philips (formerly Valvo) which is a capacitive sensor. There you can find a application note of this topic. It is also possible to measure another fluid then water (different epsilon) the principle will be the same. Hope this helps Thomas -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu