Searching \ for 'Measuring Capacitance' in subject line. ()
Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=measuring+capacitance
Search entire site for: 'Measuring Capacitance'.

Truncated match.
'Measuring Capacitance'
1997\11\09@230124 by

Greetings from New Zealand

Could some one please tell me how to measure capacitance
using a PIC. Can  I power-up the probes for a very short time
(few u secs) and measure the resistancs with out polarising?

I have seen some discussion on measuring Conductivity using
a PIC in early August. I would like to use a similar setup to
measure water table depth.

Many Thanks

Jagath
>Could some one please tell me how to measure capacitance
>using a PIC. Can  I power-up the probes for a very short time
>(few u secs) and measure the resistancs with out polarising?
>
>I have seen some discussion on measuring Conductivity using
>a PIC in early August. I would like to use a similar setup to
>measure water table depth.
>
>Many Thanks

Hi Jagath,

just to make sure - capacitance and conductivity (the reciprocal of
resistance) are two different things.

For capacitance measurement, you can use some type of RC oscilator and count
the frequency by PIC. If you want to measure capacitance of probe dipped in
water, short pulse will reduce the polarising effect, but only experiment
would answer whether or not to a negligible level. If you can arrange pulse
of opposite polarity to compensate the first one, it would be even better.

If you want to measure water depth on your table, than maybe a ruler will
do... ;-)
Seriously - the counductivity measurement is done with a low AC voltage
without any DC component. AC voltage of several hundred milivolts with
frequency about 1kHz is applied to the conductivity probe (two wires/sticks
in the water), resulting current is converted to voltage, rectified,
smoothed out and measured. The probe should be made from inert material to
avoid (both regular and electrochemial) corrosion. The conductivity is
proportional to the specific conductivity of the water, area of the
electrodes and inversely proportional to their distance. To calculate depth
from conductivity measurement, you would have either to assume, that the
specific counductivity is constant or get its value from an independent
measurement.

AFAIK, the depth measurement is better done with higher frequency (MHz),
effectively measuring the capacitance of the probe. Since water and air
differ in dielectrical constant a lot (80 and 1), the capacitance change is
significant. But I haven't done that. Also if you need to recognize just two
level (enough and not enough), you can use for instance selfheated termistor.

Regards

Josef
> >Could some one please tell me how to measure capacitance
> >using a PIC. Can  I power-up the probes for a very short time
> >(few u secs) and measure the resistancs with out polarising?
> >
> >I have seen some discussion on measuring Conductivity using
> >a PIC in early August. I would like to use a similar setup to
> >measure water table depth.

Jagath,

If you are trying to measure conductance, ignore this message.

If you are really trying to measure capacitance, there are two good
ways to go about it with a PIC.  I've had a lot of luck with applyang
a variant of APP NOTE AN512.  The app note is designed to measure
resistance by charging through a known capacitance and then checking
the time to trigger a schmidt trigger input on TMR0.  You can also
measure a capacitance by charging it through a known resistance.  I
had to go through a whole lot of calibration and noise reduction
techniques, though.  Capacitors and leads are also antennae, and
antannae slurp up noise.

My code ended up using some fuzzy techniques to "weight" each reading
and add up the wieghts over a certain time period.  Since then I've
learned how to use median filters, and that's how I'd approach it
today.

I'd show you the actual code, but it's patent pending and also