Published: 2012-08-01 | Category: [»] Engineering.
Last Modified: 2014-07-11

In a [»] previous article, I have presented a way to read capacitances down to the femto-farad level. Using this as a prerequisite, I will describe here how to measure fluid levels through the property of liquids composition to alter the capacitance of a given conductive plates pair.

Fluid levels may also be measured by a piezoelectric pressure sensor through the recording of the hydrostatic pressure of the fluid. However, the pressure measured that way is influenced by the velocity field (and hence, the flow rate) which ultimately results in an over-estimate of the liquid level. Also, measuring liquid levels by its capacitance has the advantage of being cheaper and do not require buying a pressure sensor which might not be available at your local vendor. Still, these piezoelectric sensors have higher bandwidths (about 1 kHz compared to ~20 Hz for our system), they have better linearity response when the fluid is at rest and they are much easier to calibrate. Each technique then has its advantage and disadvantages; the choice is up to you!

How it works

The overall concept of liquid levels measurement through capacitance values is to create a capacitor using two conducting surfaces and to fill the gap between these by the liquid we which to measure the level of. The capacitance will vary depending on the immersion level in a linear pattern between two boundaries Ca and Cb because we have a situation that is like having two separate capacitors in parallel: one in the air (or else, depending on your setup) and the other in the liquid. Since parallel capacitors add up we measure the contribution of both the upper phase and lower phase.

The capacitor itself (with vacuum between both conducting surfaces) has a capacitance value of Cx. When filled with some chemical, the capacitance is changed by a factor ε called the dielectric constant. So the capacitance of the system filled only with air is Cairair*Cx and the capacitance of the system completely filled with the liquid is Cliquidliquid*Cx. If the capacitor construction is constant along its length (it does not have conical shape or else), and if we cut the capacitor in half we expect each halves to have a vacuum capacitance of Cx/2 right? Put differently, a fraction ξ of the capacitor has a capacitance of ξ*Cx.

Combining these two properties (cumulative effect of the contribution of both the filled/unfilled parts and the regularity of the capacitor) we can say that for a liquid level fraction of ξ, we are measuring a capacitance value equals to the contribution of both parts:

Measuring the capacitance for a completely filled (ξ=100%) and completely unfilled (ξ=0%) system will give the two boundaries Cb and Ca we were talking about previously. Any intermediate level will simply be a linear combination of Ca and Cb. With some maths:

And hence the previous equation becomes

which can eventually be re-arranged as

The wonderful thing with this phenomenon is that it works with any chemicals as long as the separation hypothesis holds. Put differently, it will work for any two immiscible fluids! It works not only for liquid/air couples but also for systems like oil/water etc. This is a great advantage over hydrostatic pressure methods!

Concerning the resolution of the probe, we know that we are limited to a minimum capacitance value of ∆C (about 0.1-0.5 pF with our capacimeter depending on the electrical pollution of the room where we operate). Since we are measuring C(ξ) with an accuracy of ∆C, the resolution of ξ will be about 2∆C/(Cb-Ca). Using the dielectric constants ε and vacuum capacitance value Cx we get:

And the only way to increase accuracy is to increase the value of Cx (∆C is fixed by our sensor) since the dielectric constants are properties of chemicals and we cannot change them. We should then try to build the capacitor with the largest value and, when possible, avoid using two fluids which have too close dielectric constants.

Now let's get our hands dirty!

It's now time to get our hands dirty by assembling a prototype and check if our maths were corrects.

I have used a crystal-clear 50 mm diameter, 60 cm long PVC tube covered with aluminium foil on its outside. An internal 8 mm copper electrode tube was fixed in the centre of the PVC tube and isolated from the fluid using flexible 10 mm PVC tubing. I first tried without the flexible tubing but the results were catastrophic as the whole water started acting like a conductor itself and the results were just unusable for liquid level measurements. The assembly is given on Figure 1. The setup presented here has the big advantage of having a coaxial form which is less sensitive to surrounding perturbations (i.e.: moving next to the tank should not affect the reading).

Figure 1 - Tank assembly.

Once everything is in place and well glued with a lot of silicone (really, a lot), the tank capacitance is filled with water by known amounts. The capacitance was recorded after each water addition and a graph was then plotted on Figure 2.

Figure 2 - Tank capacitance.
Results Analysis

Let's now try to make some sense with the data.

Clearly, the capacitance-volume relationship is relatively linear with a globally satisfying linear fitting (r2=0.9977) and an average 1.5% deviation to the model which is expected given the resolution of the sensor in a noisy environment. On that side, we can say that the device is working fine. But what about the boundary values for Ca and Cb? Do they match our expectations?

At first glance, we may consider that our capacitor behaves as a simple coaxial capacitance which is known to be:

Using our assembly values we would then expect the capacitance to range from about 15 pF to 1.14 nF depending on the water level. This is clearly not the case since we are more like 50-150 pF!

To explain that, we have to refine our capacitor assumptions with some more advanced maths. Figure 3 represents a transversal section cut of our capacitor with the outer aluminium shell followed by the PVC tube, the empty space designed to be filled, a second PVC tube, some air gap and the copper electrode.

Figure 3 - Transversal section cut of the capacitor.

Considering a perfectly radial electrical field (that is, we neglect border effects at the top and bottom of the capacitor), we may write Gauss law as

The electrical field magnitude at a distance r from the centre for the whole length l of the capacitor is then

Knowing that

We have

And so,

Finally, by definition,

The integral can then be split over the various materials:

Which gives a formula for the capacitor:

Using our assembly values we now find a capacitance range going from 15 pF to 86 pF (air/water). The span is then about 71 pF compared to the 100 pF obtain experimentally. This is much closer to what we observed and the small difference can probably be explained by the relatively high impact of r4/r5 air gap on the calculation. Also, there is a slight difference between the Ca value between theory and experiment (15 pF vs. 50 pF) which I believe is due to the capacitance of the wires going from the probe to the sensor.

Reminding that we wish to increase the value of as much as possible, I would now recommend using the finest PVC shell diameter available and to avoid as much as possible air gaps (you may even try to fill the gaps with fluids having a high dielectric constant such as water).


As a conclusion, we have seen that the probe works relatively well with its 1.5% linearity error. It is also easy to build and cheap too. Compared to hydrostatic pressure method, it has a lower bandwidth but is more reliable with high flow rate outputs.

Finally, its property to measure levels between any two immiscible fluids makes it very promising for future experiments. One may imagine, for instance, an oil/water separation unit which keep the interface at a fixed level by actuating on some valve to release the water and collect oil at the top.

But don't ask me, it's up to you now!

[⇈] Top of Page

You may also like:

[»] Measuring Small Capacitances

[»] Split Power Supply with the TC962

[»] In-line Absorption and Fluorescence Sensor

[»] Building a Flow-Controlled Aspiration Pump

[»] Counting Bubbles with Laplace Pressure