An idiot's guide to capacitance

Paging engineer_comp_geek

For a few years now I’ve been flying airplanes that measure fuel levels with capacitance probes. I’m very comfortable with DC voltage, current, and resistance - I can easily explain those in layman’s terms using a pneumatic system as an analog. I understand the basic concept of AC power, and the difference between AC and DC. Things get a little hazy when we start talking about why I’d want three phases or why I might or might not have/want a neutral, but I digress. The reason I’m here is that I just can’t seem to get my head around capacitance in a way that it sticks. I’ve poked around online a bunch of times, but most of the references I find tend get very mathy very quickly. I realize that comes with the territory, but I’m not sharp enough to distill a concept from an equation. Can anybody try to dumb it down a few pegs for a simpleton?

Also, the new airplane I’m training on is equipped with compensators which calibrate the capacitance probes by measuring the permittivity of the fuel. As I understand it, this is a measure of how easily the fuel can be polarized by the imposition of an electric current. Am I in the right ballpark? How is this value applied to correct the output from the capacitance probes? Thanks for any help, I’m a little out of my league here…

A capacitor consists of two plates separated by a dielectric.
The dielectric constant, along with the separation and area of the plates determines the capacitance.
I suspect what is being calibrated is the fuel’s relative permittivity i.e. - dielectric constant.

The model for a capacitor is, as **beowulff **notes, two metallic plates held parallel to each other around an insulating material. One of the leads connects to one plate and the other connects to the other plate, but there is no direct electrical connection between the two plates.

When you hook up a DC source, like a battery, to the two leads, the battery starts shoving electrons into one of the plates. This makes that plate slightly negatively charged. This slight negative charge means that, despite the fact that the second plate is not connected to the first plate, electrons are going to start flowing out of the second plate simply because they feel the negative charge of the first plate repelling them. So the second plate becomes positive.

Naturally, this can not go on forever. Eventually the battery pushes so many electrons into the first plate that they push back enough that no more electrons flow in and the current stops. But if we replace the battery with an AC source, where the electrons go back and forth at a set frequency the situation can go on indefinitely.

A dielectric is just a material that goes in between the plates. When the electric field between the plates of the capacitor is strong enough, it can polarize this material, and this increases the number of electrons that can be shoved into the plate by cancelling out some of the electric field of the shoehorned-in electrons. Different materials have different polarizabilities, so you can tell the difference between some materials by how a capacitor with same configuration of plates is affected by swapping out its dielectric with it.

To think of capacitance in a pneumatic analog, think of it as a stopper in a pipe, but it’s not fixed in place, it’s held in place by a spring so that it can move some down the length of the pipe. As you apply pressure to the fluid in the pipe, you’ll get a small amount of flow while that spring stretches, but then with a fixed pressure, the flow will soon stop. If you remove the pressure you’re applying, that spring will cause the flow to go the other way, for an amount equal to how much flow it allowed earlier while you were charging it up.

The amount of fluid that can flow with a given applied pressure is related to the stiffness of the spring, right? That’s the capacitance - a larger value of capacitance is the same as a squishier spring that can move farther with the same force. A tiny little capacitance is equivalent to a spring that doesn’t let the stopper plate move very far (lets very little current flow at a given pressure/voltage).

If you apply an alternating pressure, then for very high frequencies, that spring will be sitting near its neutral position most of the time, and will have little effect on the flow.

Bill Beatty (who posts here sometimes) has this article, and many other useful ones on his website. Pay close attention when you navigate because he has some fringe science pages too.

Inductors and capacitors kinda sorta work the same but kinda sorta backwards from each other.

A simple inductor is just a coil of wire. Run current through it, and a magnetic field is formed, turning it into an electromagnet. It takes energy to form this magnetic field, and when you remove the current, the field collapses, and turns into current flowing out of the coil.

A simple capacitor is just two plates of metal close together, but not touching. If you apply a voltage to the plates, the plates charge up and an electric field forms. Like the magnetic field of an inductor, this field takes energy to form, and if you remove the voltage (but still have a circuit connected to it) the energy is released back into the circuit.

Capacitors and inductors can both be used to filter off noise. If you put an inductor in series with a load, it’s going to resist changes in current, since any additional current applied will go into forming a greater magnetic field, and if the current drops, the magnetic field will start to collapse and will release current to compensate for it.

To do the same thing with a capacitor, you put it in parallel with your load. As the voltage increases, it’s going to charge up the capacitor, and if the voltage decreases, the capacitor will release the stored energy and supply voltage to the load. This is how capacitors filter rectified AC into DC in a power supply. Capacitors may also be used to keep the memory powered in your programmable remote control while you change the batteries, so it doesn’t lose its settings and have to be reprogrammed. Capacitors can only store a finite amount of energy, so leave the batteries out of your remote long enough and it will completely lose its memory and you’ll have to reprogram it.

The relationship between voltage and current in a capacitor and inductor, as you’ve discovered, isn’t as simple as it is in a resistor. In a capacitor, the current that flows is proportional to the rate of change of the voltage.

The math formula is i=C dv/dt

And unfortunately, that brings you right into calculus. The important thing, if you aren’t good at math, is that the current flow is proportional to how much the voltage changes. If the voltage isn’t changing, no current flows. If the voltage changes a lot, more current flows (that’s the capacitor either charging up or discharging).

The formula for inductors is similar. v=L di/dt

Notice that the current in a capacitor is proportional to the rate of change of the voltage, but the voltage in an inductors is proportional to the rate of change of the current. This is what I meant when I said they are kinda sorta backwards from each other.

If you take the derivative of a sine wave you get a cosine wave, and a cosine wave is just a sine wave shifted by 90 degrees (if you don’t get the math just trust me on this one). Specifically, the derivative of A sin (wt) = Aw cos (wt). That probably doesn’t mean much to you, so let me explain it. A is the amplitude. w is the frequency (w is 2pif, where f is the frequency). So if you take the derivative of a sine wave, you get a cosine wave (which is a sine wave shifted by 90 degrees) that is also scaled by the frequency. This is important, because it basically means that if you apply a sine wave voltage to a capacitor, the current that flows is also a sine wave that is shifted by 90 degrees and scaled by the frequency. In other words, if you ignore the phase shifting bit, you’ve basically made a frequency dependent resistor of sorts. At lower frequencies, less current flows. At higher frequencies, more current flows.

If you remember a simple voltage divider from your DC circuits, you put two resistors in series, and apply a voltage to them, and the voltage will divide across them. Replace one of the resistors with a capacitor, and now the voltage will divide proportional to the frequency. Depending on which way you hook it up, you can make the voltage increase with frequency or decrease with frequency. Take your high frequencies and run them into a small amplifier circuit with a volume control on it, and take the low frequencies and run them into a different amplifier with a different volume control on it, and then add those two signals together, and you’ve got one volume knob that controls the low frequencies and one volume knob that controls the high frequencies. In other words, you’ve just made the bass and treble knobs on a stereo.

That phase shifting bit of the sine and cosine relationship is useful too. If you have a fixed frequency, like in an AC power system, capacitors will phase shift the current in one direction and inductors will phase shift the current in the other direction. Basically, if you have a sine wave, capacitors and inductors both charge during one part of the wave and release it during another. However, capacitors are charging while inductors are discharging, and vice-versa, so they can balance each other out. Motors are an inductive load (because of their coils), so residential loads tend to be slightly inductive due to vacuum cleaners, refrigerator motors, etc. and industrial loads will also often be very highly inductive due to very big motors being used. Power transmission is at its most efficient when the capacitance balances out the inductance. That way, the capacitors discharge and charge up the inductors, and then the inductors discharge and charge up the capacitors, over and over. And since they both balance each other out, the power company doesn’t have to waste any current from their generators charging and discharging the capacitors and inductors. The generators only end up supplying the resistive part of the load, and since they don’t have to do extra work charging and discharging your temporary storage capacitors and inductors, that’s as efficient as it gets.

That’s a lot to all take in at once, but basically, while the math is a bit hairy, capacitors are used for things like temporary energy storage, a frequency dependent impedance, or a phase shifter. Hopefully you’ll get that much out of that long winded discussion.

Another important concept is what happens if you stick something in between the metal plates of a capacitor? Depending on the material, you can make it easier for the capacitor to store more energy. The material in between is called the dielectric. Ceramic disk capacitors will have a piece of ceramic in between the plates. Electrolytic capacitors will have a gooey electrolyte. Capacitors in power systems will often be filled with oil. There are a lot of other materials that can be used as well.

Since a capacitor is a pretty simple thing, you get naturally occurring capacitance as well. The capacitance and inductance of a piece of wire affects power transmission, for example. The capacitance and inductance of circuit traces creates unintentional resonant circuits which can easily pick up radio stations and create noise in your computer speakers.

There are different types of capacitance meters. Some work by charging and discharging the capacitor, and measuring how long it takes to do so. Others work by passing a high frequency through the capacitor and measuring the voltage that develops (taking advantage of that frequency variable dependence with the sine wave I mentioned above). I’m not sure how your airplane probe works, but I suspect they are measuring how much charge is stored, so measuring the fuel is basically measuring the permittivity of it as if it were the dielectric.

Hope this helps, but I think I might be hitting you with too much at once. Feel free to ask for explanations for what you don’t understand.

To go along with what ecg posted, here’s a decently technical but math-free article from a probe mfr that compares capacitive probes (electric field) and eddy-current probes (magnetic field) in the same function. It does a decent job explaining how one works. The application there is measuring displacement with a known dielectric, but you can imagine that if you were to already know the distance, you can measure the dielectric, and thereby determine the material.

Wow, thank you so much! I’ll be back this evening for some questions.

In application, I’ve been told that on circuit boards (those little ceramic buds?) are capacitors. The hold back current in the whole crazy loop of feeds to the microcircuitry below?

Yeah, you’re probably talking about capacitors. They’re often used to filter the noise from the power supply, caused by the supply itself, and from other circuits constantly changing how much power they pull. The capacitor helps filter out the noise to a more even voltage. Since the capacitor charges up, you can think of it in this case like a tiny little battery, taking in power from a source that may be variable, and providing a more constant power output.

Actually, they supply current.
Think of “filter” capacitors (there are many other applications for them, but you are talking about “filtering”) as electron reservoirs. They supply current when the power supply can’t keep up (i.e. - under sudden heavy load).

A sort of classic example of load balancing is in old cameras with a flash. You couldn’t draw enough current from the battery fast enough to make the flash bright and sudden, so the battery was used to charge a giant capacitor instead, and then when it was time for the flash to go off, it got its power by discharging the capacitor. Which is why you needed to wait a few seconds between flashes – the battery needed time to recharge the capacitor.

I try not to think too much “how” a capacitor works in the physical/physics sense, and instead focus on a) the function of the capacitor, and b) variables that affect capacitance.

As for a), a capacitor can “do” quite a few things by virtue of its time-domain definition (i = C dv/dt):

  1. One of two components in a 1st-order RC or RL filter.
  2. Filter high frequency noise on power supply rail. (Really just a low pass RC filter.)
  3. *Quickly *supply current to a load when the load impedance suddenly decreases. (The power supply may be too “slow” to supply fast/dynamic current.)
  4. Block DC, while allowing AC to pass. (Really just a high-pass RC filter.)
  5. Frequency-dependent impedance.

In reality, these are all one-in-the-same.

When used as a sensor, we are measuring the change in the capacitor’s capacitance value as a function of force, or liquid level, or humidity, or whatever. When used as a sensor, either the dielectric constant is changing or the distance between the plates is changing.

Remember that naturally occurring capacitance that ecg mentioned? The close proximity of signal lines to power on a circuit board results in noise getting into the power. Get enough noise into the power, and the digital circuits can’t tell the difference between static and actual signals, and they start misbehaving. All of those little capacitors serve to filter out the would-be troublesome stuff.

That’s not really what happens. The impedance of the power realis is far too low for them to be affected by logic signals. What happens is this: each time a transistor switches, it takes a small amount of current. When millions switch at the same time (like in a microprocessor, or GPU), all that current can cause the supply rails to droop or the ground rail to “bounce.” The bypass capacitors prevent those upsets from becoming a serious problem.

Well they do have to filter out ‘ringing’ and stuff too. In my favorite example of capicitance or possibly inductance, we had a floppy disk drive attached to a machine with a really long ribbon cable, probably about five feet. The drive wouldn’t work with the cable laid out flat, but if it was folded over accordion style and secured with a couple of rubber bands it would work just fine.

And this thread just reminded me, what the hell happened to my capacitance meter? Those things are invaluable when you’re trying to pick out a cap from an assortment with the weird way they can get marked, or not be marked at all.

It is worth mentioning that adding a high-quality (low-ESR) capacitor can sometimes *cause *unwanted ringing at certain frequencies. Ironically, the solution is to use a capacitor with higher ESR.

We have an el-cheapo capacitance meter here in our lab, but it’s almost useless. Unless you’re designing a precision timing circuit or a precision active filter, you usually don’t care about the precise capacitance value of a capacitor. For most “regular” applications of capacitors (bypass, blocking, etc.), a tolerance of ± 20% is good enough. Of far more importance in my line of work is a capacitor’s ESR and leakage resistance. I use an Agilent impedance analyzer to measure these things. The analyzer also allows me to measure the complex impedance as a function of frequency. Which can be important in high frequency circuits, as a capacitor becomes an inductor above a certain frequency…

I’m just looking for something to identify capacitors. The little ones are marked terribly. You don’t know what the multiplier is, and often the markings are missing or unreadable.

ETA: Please tell me more about a capacitor becoming an inductor at high frequencies.

Everything is an inductor.
Everything is a capacitor.
Everything is a resistor.

At high frequencies, the inherent inductance of the leads and plates of a capacitor start to dominate. This is one reason why there is such a drive to miniaturize electronics - it reduces all of these “parasitic” effects.

To expand on what **beowulff **said, a capacitor is modeled as an ideal capacitor with series resistance (ESR), series inductance (ESL), and a parallel resistor (leakage resistance of dielectric). And that’s a *simple *model. A more accurate model includes frequency dependence of each of these, plus an additional parallel RC circuit to model losses due to dielectric absorption.

At any rate, at low frequencies the reactive component of the impedance due to capacitance dominates over the reactive component due to ESL, and the capacitor is a capacitor. If you keep increasing the frequency, the capacitor’s impedance will keep decreasing until you reach the resonant frequency, wherein the reactive component of the capacitance cancels the reactive component due to ESL. When you go *above *the resonant frequency, the reactive component due to ESL dominates over the reactive component of the capacitance, and it literally becomes an inductor.

This is why you often see a high-valued bypass capacitor (e.g. 100 μF aluminum electrolytic) in parallel with a small-valued capacitor (e.g. 0.1 μF ceramic). The former has a large ESL, and thus doesn’t “look like” a capacitor at high frequencies; it may do a good job of injecting quick current to the load when the load impedance quicky drops, but it sucks at filtering out high frequency garbage that may be on the rail. The latter has a low ESL, and thus continues to “look like” a capacitor at higher frequencies, and thus it is better at filtering the HF noise. By connecting them in parallel, they cover a much wider frequency band, obviously. I have even seen some designs that place three of four capacitors in parallel (e.g. 100 μF + 0.1 μF + 0.001 μF).