# Converting variable capacitance value to variable DC voltage level

I need a simple method to convert a small variable capacitance value into considerable variable DC voltage.

• Capacitance value range = 0nF ~ 14nF
• DC value range needed = 0V ~ 6V

What I've tried is shown below. However final output should be a pure DC level without any ripples for a fixed Cx. But the following circuit seems to be still have ripples or noises.

1. Is there any improvements to be made for this circuit to get a pure DC output?
2. Are there any other methods/circuits to do this task?

• Ro=100k
• Oscillator frequency is about 71.78 Hz (t1=7mS, t2=6.93mS)
• Cx is the variable capacitor (Range 0nF~14nF)
• It's unreasonable to expect no ripple. Also are you expecting the result to be linear i.e. 0.428V per nF? – Andy aka Oct 31 '13 at 10:21
• Non linearity is ok. – user2835684 Oct 31 '13 at 10:45

Maybe a linear ramp 555 circuit with an adjustable threshold and a timer chip would do. Here's the linear ramp using the 555: -

"C" in the circuit above could be the capacitor under test. The smaller the value the quicker the ramp. You can use the 555 output rising high to reset-trigger a counter and the counter value can be "frozen" when the ramp reaches a certain level. A precision comparator connected to the ramp would tell you the ramp has reached a certain level.

If you connect the output of your counter to a DAC and latch the DAC output when the comparator triggers (say 2/3 of way up the ramp) you have a linear, capacitor_to_voltage generator. Adjust R2 to give you the desired range of capacitance you need.

You could also use 7 segment displays to output the counter in hexadecimal.

The counter needs to be running a lot faster than the ramp to give you decent resolution. Anyway, the formulas are on the picture.

• This would be a perfect solution. However I already have a flash type ADC and I'm planing to use that. Adding a low pass filter at opamp output gave me a reasonable noise reduction. Thank you for the detailed explanation I'll try this method later. – user2835684 Nov 1 '13 at 11:20

You sortof have the right idea, but your circuit isn't right. Putting a capacitor directly on the output of a opamp is a bad idea and doesn't do what it seems you want it to do.

Cx and R0 form a high pass filter so that with the right frequency you get amplitude out as a function of the Cx over the range you care about. However, you don't just want to amplify this AC, you need to amplitude detect it. Here is a simple amplitude detector I have used a number of times:

Vref is a reference voltage that should be two junction drops or a little more above ground.

The emitter of Q1 is a one-way voltage source. It will produce significant current if you try to drive it below Vref minus one junction drop, but is essentially open circuit above that.

C1 makes the DC level of the AC input irrelevant, and allows the circuit to find its own DC level on the right side of C1. As the AC input voltage goes lower, it tries to drive the right side of C1 low. When that gets below the voltage threshold on the emitter of Q1, the voltage on the right side of C1 will stay there and C1 will get charged up instead. This continues until the bottom of the AC waveform. When the AC input goes high again, the right side of C1 will track it since there is little pulling it low. This raises the base voltage of Q2, which is in emitter follower configuration. That charges up C2 to the difference between the top and the bottom of the AC input.

This process repeats every AC cycle. The time constant of C2 x R1 is intended to be long compared to a single AC cycle, so the voltage on C2 stays reasonable constant between the AC positive peaks where it is charged up. R2 and C3 provide additional low pass filtering to smooth the output signal.

R3 can be omitted in some implementations, but provides a predictable amount of bleed current trying to pull the right side of C1 low. This is part of what decides how quickly the circuit can respond to a sudden drop in AC amplitude. The R1 x C2 time constant and the R2 x C3 time constant are also important to the overall response.

Amplitude detecting AC is always a tradeoff because you have to decide how fast is not fast enough or too fast. If too fast, you see the amplitude variations of each cycle. If too slow, bandwidth of the modulated signal is lost. The usual solution is to make sure the carrier frequency is many times the highest signal frequency of interest.

For example, commercial AM radio goes down to around 550 kHz carrier but contains signals at most up to 10 kHz. The 55x difference leaves plenty of room to be responsive to the 10 kHz signal without responding to individual 550 kHz carrier cycles.

• I've obtained reasonable stable DC value at the output by adding a low pass filter at the opamp output. Putting a capacitor directly on the output of the opamp was the fault. Thank you for your detailed explanation. – user2835684 Nov 1 '13 at 11:27
• @user: Then you are only getting detection by accident, probably because you are powering the opamp from only a positive supply (it is completely unpowered in your schematic! We can't tell how you are powering it.). It therefore clips the negative portions of the AC waveform, with the resultant DC level being dependent on the AC amplitude. However, relying on characteristics of opamps near their supply limits is not a good idea unless this is clearly defined in the datasheet. You should use a real detector. – Olin Lathrop Nov 1 '13 at 13:20
• I used LM324 single powered opamp IC. And also 555 signal generator gives only a positive square wave. However I was able to convert capacitance into some sort of DC value even it is highly nonlinear. Thank you for your advices. – user2835684 Nov 1 '13 at 17:53

Add a very aggressive low-pass filter on the output. "C" (why does this not have a number?) isn't quite achieving this because it's driven from the low-impedance output of the opamp, which is trying to keep pace with your low speed oscillator. Add a resistor between the opamp output and "C", of maybe 10k-100k, so that it forms a low pass filter with C.

Increasing the oscillator frequency would help as well.

• You have completely missed the point that the output as it is now is the same AC that is fed in. Low pass filtering that will only result in the average AC level of 0. The OP needs to amplitude detect the AC. Only then does it make sense to apply a low pass filter. – Olin Lathrop Oct 31 '13 at 14:23
• Yes there was a problem at op amp output. Adding a 10k resistor before the capacitor worked for me. Also I increased the frequency. Thank you all. – user2835684 Nov 1 '13 at 11:13

This is the modified circuit. But the output is highly non linear.

Following graph shows the practically measured Vout values for different Cx values.

Now the remaining problem is high capacitance values don't give considerable voltage change. And that will reduce the accuracy.