# How to measure the Capacitance of this circuit

## Homework Statement

Hi, I have virtually no background in electronics and I have been given the following task.

I have to measure the capacitance of the (real) circuit below (using labview, but it is the theory of how to do this that I am interested in). I am not able to use the obvious method, which is to apply a DC voltage, switch it off and fit the drop in current to an exponential decay function.

2. The attempt at a solution

So I have decided to use the relationship C=i/(dv/dt). Apply an alternating voltage and record the current and voltage waveforms, the voltage waveform is then differentiated to give a dv/dt waveform. Then each data point in the current waveform is divided by the corresponding data point in the dv/dt waveform to give the capacitance. (since the division is done element-wise I get a value of capacitance for every point in the waveform/array and just average them to give a more accurate capacitance value, but this is not important)

The problem I have is that the capacitance measurements seem to vary when the input frequency changes, as shown in the graph below. I think I have also seen a change in the capacitance measurement with changing the amplitude of the input voltage.

3. Questions - although I would appreciate any ideas on this

a. Does anyone know why this might happen? - It has been suggested that complex impedance (something which I do not have a good understanding of) is to blame, that there is a phase difference between the current and voltage that needs to be corrected for? - perhaps you could explain this?

b. Can anyone suggest another way to measure the capacitance of this circuit by studying only the current and voltage? (prefereably taking into account of the impedence)

c. Do you think the equation is correct for describing this circuit? - What about the resistor?

d. Can you explain the different sections of the graph? - I think the rise at low frequencies may be due to the capacitor blocking low frequencies and the drop at high frequencies may be due to the capacitor not having enough time to charge when the voltage switches direction....

As I said at the start I have no background in electronics, I have never had a lesson or lecture on it and it was not taught to me at high school, I have really struggled to get to my current understanding of this situation - please don't assume I know what I'm talking about.

Related Introductory Physics Homework Help News on Phys.org
gneill
Mentor
In a capacitor, a sinusoidal current leads the voltage by 90 degrees. With inductors it's the opposite -- the voltage leads the current by 90 degrees.

The other thing about both components is that their impedance varies with frequency. Impedance is a way of specifying the voltage versus current relationship for a component that embodies the concept of frequency dependence and voltage/current phase shift. The impedance of a component is specified in the form of a complex number. Complex numbers have the "angle" quality that is needed.

The real part of the impedance is normal resistance. The imaginary part is called the reactance. Resistors have only a real component. Capacitors and inductors (if they are ideal) have only imaginary (reactance) components. That is, there values lie along the imaginary axis at +/- 90 degrees to the real axis.

The reactance values for inductors are positive values. Those for capacitors, negative. For a circuit, if you calculate the overall impedance and it has both resistive and reactive components (real and imaginary), then you can draw a right angle triangle with these components as legs. The angle of the resultant (hypotenuse) with respect to the real axis will be the phase shift you'll see between the voltage and current waveforms.

How does this help you? Well, if you were to set a constant voltage at a given frequency across this circuit and measure the magnitude of the current that results, you could calculate the magnitude of the impedance (|Z| = |V|/|I|). With the magnitude of the impedance and a known value for one of the components, you should be able to work out the value of the other component (the capacitor). For extra points, do it for a range of frequencies and plot the impedance versus frequency curve. This will also give you plenty of data to perform an error analysis. If you're ambitious, also plot the phase shift (between voltage and current) versus frequency.

For a parallel circuit, impedances add just like parallel resistances. Say you have Zr for the resistor (in this case Zr = 10G Ohms) and Zc (currently unknown) for the capacitor. Then the parallel combination of the two will be Z = Zr*Zc/(Zr + Zc). For a given frequency (and thus a fixed value for Xc), |Z| = R*|Xc|/(R + |Xc|).

For each value of |Z| that you determine, you can find the corresponding Xc and thus a value for the capacitance. Average, deviate standardly, amaze your friends.

The reactance of a capacitor C at frequency f is given by Xc = 1/(2*pi*f*C).

gneill
Mentor
...On the other hand, if you do want to go the i = C dv/dt route, recognize that the total current supplied to the circuit will divide into the resistor and capacitor branches. The instantaneous resistor current will be simply the instantaneous voltage divided by the resistance. The current in the capacitor branch will be Ic = C dv/dt , and since v(t) = V*sin(w*t), then dv/dt will be d(V*sin(w*t))/dt. So Ic(t) = C*V*cos(w*t).

If you take data over a cycle (or two) you'll have voltage and total current versus time. Do the math to subtract the resistor current at each instant, leaving the capacitor current at each instant. Apply Ic(t) = C*V*cos(w*t) to find C.

gneil. Thank you very much for your help with this. That must have taken you a long time to write out so clearly.

I have learnt a lot just reading that through, but I am still digesting everything you have said and will probably have some follow up questions soon.

For now, are you (or anyone else) able to tell me if the following solution is sensible: -

1. determine the total resistance of the circuit by applying a DC voltage in steps and taking the gradient of the I-V curve (I forgot to mention that the value of the resistor is unknown at the start of the experiment)

2. apply an AC voltage of frequency 'f'

3. determine the value of |Z| by dividing the largest value in the voltage waveform by the largest value in the current waveform

4. calculate the value of C using the following equation: C = sqrt[ (w2/R2) - (w/R|Z|2) ] ..... I'm not sure about this equation, it was derived by taking the impedance of the whole circuit to be 1/Z = 1/Z1 + 1/Z2 where Z1=R and Z2 = 1/iwc. Can someone check this for me please as I don't have a scanner to scan in my derivation.

Please let me know if you think this method will work.

I think the phase shift method you have suggested is excellent, my only concern is that I am not sure yet how accurately the software can measure the difference in phases - they are very noisy, high-frequency traces and I think it may cause problems even if averages are taken for many wavelengths.

Many thanks, you have been a huge help already.

gneill
Mentor
For now, are you (or anyone else) able to tell me if the following solution is sensible: -

1. determine the total resistance of the circuit by applying a DC voltage in steps and taking the gradient of the I-V curve (I forgot to mention that the value of the resistor is unknown at the start of the experiment)
Sure. After the capacitor charges to the applied voltage, it draws no more current. What current is left is strictly going through the parallel resistance. So R = V/I.

2. apply an AC voltage of frequency 'f'

3. determine the value of |Z| by dividing the largest value in the voltage waveform by the largest value in the current waveform

4. calculate the value of C using the following equation: C = sqrt[ (w2/R2) - (w/R|Z|2) ] ..... I'm not sure about this equation, it was derived by taking the impedance of the whole circuit to be 1/Z = 1/Z1 + 1/Z2 where Z1=R and Z2 = 1/iwc. Can someone check this for me please as I don't have a scanner to scan in my derivation.
I think you want

$$C = \frac{\sqrt{R^2 - |Z|^2}}{\omega R |Z|}$$

Please let me know if you think this method will work.
It should work fine.

Thank you, I'm not sure I see how that equation is derived, I will just try to write my own out in LaTeX.

The LaTeX in preview post is broken so I don't know how this will come out.

My derivation is as follows: -

$$\frac{1}{Z} = \frac{1}{Z1} + \frac{1}{Z2} = \frac{1}{R} + \frac{1}{i \omega C} = \frac{i \omega C}{R i \omega C} + \frac{R}{R i \omega C} = \frac{R + i \omega C}{R i \omega C}$$

$$Z = \frac{R i \omega C}{R + i \omega C} = \frac{R \omega C}{i R - \omega C}$$

$$Z*Z = |Z|^2 = \frac{R \omega C}{-\omega C + i R} . \frac{R \omega C}{-\omega C - i R} = \frac{R^2 \omega^2 C^2}{\omega^2 C^2 + R^2}$$

$$|Z|^2 \omega^2 C^2 - |Z|^2R^2 = R \omega C^2$$

$$\frac{|Z|^2 \omega}{R} - \frac{|Z|^2 R}{\omega C^2} = 1$$

$$\frac{R}{\omega C^2} = \frac{\omega}{R} - \frac{1}{|Z|^2}$$

$$C^2 = \frac{\omega^2}{R^2} - \frac{\omega}{R |Z|^2}$$

$$C = \sqrt{\frac{\omega^2}{R^2} - \frac{\omega}{R|Z|^2}}$$

Can anyone see where I went wrong?

Last edited:
gneill
Mentor
The LaTeX in preview post is broken so I don't know how this will come out.

My derivation is as follows: -

$$\frac{1}{Z} = \frac{1}{Z1} + \frac{1}{Z2} = \frac{1}{R} + \frac{1}{i \omega C} = \frac{i \omega C}{R i \omega C} + \frac{R}{R i \omega C} = \frac{R + i \omega C}{R i \omega C}$$
$$\frac{1}{Z2} = {i \omega C}$$

Thank you, I see what I have done wrong.

I have now corrected it and have a value of capacitance that varies with frequency - how can I use this to find the value of the capacitor?

gneill
Mentor
Thank you, I see what I have done wrong.

I have now corrected it and have a value of capacitance that varies with frequency - how can I use this to find the value of the capacitor?
Umm, by experimentally determining values to plug into the expression, as discussed in previous posts?

I'm sorry to not grasp this very simple concept.

The value of the capacitor is a fixed quantity, however as I vary the input voltage the capacitance of the circuit varies as roughly a y = c/x function. The equation describes the capacitance as being frequency dependent, should the impedance cancel this out to give a constant value of capacitance?

Thank you for continuing to post.

gneill
Mentor
The capacitance is constant. Its impedance varies with frequency. Neither capacitance nor its impedance varies with voltage applied to the capacitor. The other factors in the formula will always conspire to yield the same value for C.

You developed the expression for the capacitance so that you could take measured values from the circuit and plug them in to find the capacitance.

Here's a simple DC analogy. The charge on a capacitor is given by Q = C*V. If you rearrange the formula as C = Q/V, and in the lab you measure values for Q and V, it does not mean that capacitance is changing for different voltages applied; the measured charge will compensate to yield the same value for C.

Hi

I understand, I was thinking the same thing.

I think I have found the source of the problem: I don't think we can just simply find the complex conjugate by replacing the 'i' with a '-i' because it is in the denominator. If you manipulate the fraction Z =.... to get the 'i' on the top, when you get to the end of the derivation you are left with a 4th order polynomial of C.

It would take a really long time to type out the derivation, I will do so when I can, but in the mean time can you tell me what you think of a different approach: can we use the phase angle 'phi' to determine the capacitance? am I right in thinking that there is a relationship along the lines of: Capacitance = R*tan(phi)?

I'm sure it is not this simple. Can you suggest any other methods to get the capacitance out of this circuit using only the input and output?

Thank you (again)

gneill
Mentor
Hi

I understand, I was thinking the same thing.

I think I have found the source of the problem: I don't think we can just simply find the complex conjugate by replacing the 'i' with a '-i' because it is in the denominator. If you manipulate the fraction Z =.... to get the 'i' on the top, when you get to the end of the derivation you are left with a 4th order polynomial of C.

It would take a really long time to type out the derivation, I will do so when I can, but in the mean time can you tell me what you think of a different approach: can we use the phase angle 'phi' to determine the capacitance? am I right in thinking that there is a relationship along the lines of: Capacitance = R*tan(phi)?

I'm sure it is not this simple. Can you suggest any other methods to get the capacitance out of this circuit using only the input and output?

Thank you (again)
There are all sorts of ways to do it, each more complicated than the last. Measuring the magnitude of the current versus frequency for a fixed voltage is probably easiest, and offers the benefit of good measurement accuracy. Measuring accurate phase angles off of an oscilloscope or plot might be less accurate. But you certainly can do that.

The impedance of the RC parallel circuit looks like:

$$\frac{R}{1 + i \omega R C}$$

so the phase angle will be:

$$\theta = atan(-\omega R C)$$

When you're measuring the phase from the plot, make sure that you're measuring in the right direction. Remember, current leads voltage in a capacitive circuit. You might be able to check that you're getting it right by sweeping the frequency from a low value up to your target value and watching how the current curve shifts. The maximum phase shift possible will be -pi/2.

The expression I gave previously for the capacitance given a measured value for the magnitude of the impedance (max voltage over max current) will work for the voltage/current method.