Continue to Site

# capacitance measurement with PIC

Status
Not open for further replies.

#### 16F676

##### Member level 2
Hi, Friends
Anybody can Explain how capacitance being measured in PIC based capacitance meter.

#### kender

##### Advanced Member level 4
In short, there is an RC oscillator made with a capacitance, which you're trying to measure. The frequency of the oscillator depends on the capacitance. Then the frequency is fed into the frequency to voltage converter (F/V converter). Out of the F/V converter comes the analog voltage, which can be measured by the A/D converter on a PIC.

Points: 2

### 16F676

Points: 2

#### manu

##### Full Member level 3
kender said:
In short, there is an RC oscillator made with a capacitance, which you're trying to measure. The frequency of the oscillator depends on the capacitance. Then the frequency is fed into the frequency to voltage converter (F/V converter). Out of the F/V converter comes the analog voltage, which can be measured by the A/D converter on a PIC.

You could make it more reliable and low cost, use a constant currect source ( 1 signal transistor, 1 zener diode and 2 resistors ), and charge your capacitor. Next you take measurements with the ADC at constant time intervals.

Vs = ( I * t ) / C

Vs in volts, I in amperes, t in seconds and C in farads

### 16F676

Points: 2

#### rmitoday

##### Newbie level 4
Can you post an example circuit?

#### 16F676

##### Member level 2
thanks to all
Please post an example diagram "manu"
actually I need to measure very low capacitances
is it possible with your method?

#### manu

##### Full Member level 3
Yes, that's possible for any value of capacitance, but you might varies your charge current to measures correctly with your ADC a full range of capacitors, from 1pF to 10 000µF.

Considering that components are perfect ( Vz and Vbe are constant ) :

Ir1 = ( Vz-Veb ) / R1

D1 can be standard silicium diode, or a zener diode.

in this case, Vc = ( Ie * t ) / C

Have fun

### 16F676

Points: 2

#### haytham

##### Full Member level 4
Hi
U can used capacitinace as a frequency signal. PUT your variable capacitance in as OSC circuit like 555 timer circuit and based on the frequncy of oscillation which can be measured by PIC through PIC counters modules or PIC interrupt pins, you can calculate your capacitance simply. Also if you are carfule enogh in choosing your oscillator components value you can get a very easy transform equation.

Thanks
Haytham

### 16F676

Points: 2

#### 16F676

##### Member level 2
thanks all for the coments.
My aim is to measure the volume of water in a tank by immersing an insulated wire and measure the capacitance of internal conductor to the water.
your suggessions are appreciated.

#### manu

##### Full Member level 3
Here is attached an example of an oscillogram of voltage across the pins of the capacitor, the "Standard I/O pin" supply the constant current generator with a 50% duty cycle signal.

My aim is to measure the volume of water in a tank by immersing an insulated wire and measure the capacitance of internal conductor to the water.

You also can use a "J' shaped tube that you connect to a standard pressure sensor ( MPX2xxx ), this pressure sensor is placed on the bottom of your tank.

But your solution might be a good idea, I will try

Points: 2