Capacitive liquid level sensors for conductive/non-conductive liquids - Page 1
Forum section: electronics / projects

author: e100
author_rank: Frequent Contributor
timestamp: November 08, 2013, 10:27:58 am
content: As in salt water = conductive, oil = non-conductive.At the circuit level, is there any difference between the capacitive level sensors marketed for conductive liquids vs. those marketed for non-conductive liquids?Obviously there will be differences in the dielectric constants, but it that all?None of the manufacturer's docs provide much explanation.Mike

author: Maximus
author_rank: Contributor
timestamp: November 10, 2013, 12:21:08 am
content: I don't think a capacitive sensor would work with conductive fluids. That would just create a resistor not a capacitor.Caps need a non-conductive material between the plates so charges build up on the plates rather than flow from one to the other.I would imagine you could still determine the amount of conductive fluid between the plates based on the resistance between them (the resistance would decrease as the fluid level rises). You would need to use an ohm meter to determine the fluid level rather than a capacitance meter.

author: nowlan
author_rank: Frequent Contributor
timestamp: November 10, 2013, 02:18:20 am
content: Isnt water conductive (barring rodi).Pretty much every sensor ive seen works with water.I may be confusing the sensors that sit on the side of the tank between perspex however.

author: jmaja
author_rank: Frequent Contributor
timestamp: November 12, 2013, 07:28:03 am
content: That's interesting! What kind of "sensor" would be necessary for measuring liquid level in a 80 liter tank, which is about 1 m high and made out of plastic? Would just two wires be enough? How should they be placed? On same side of the tank? How far apart?XMEGA AVR seem to have a "QTouch-ADC", which uses just one pin and an internal ADC capacitor. Would this work with just one wire?

author: peter.mcnair
author_rank: Contributor
timestamp: November 12, 2013, 09:43:19 am
content: Years ago I built a rain gauge (I was looking at effect of weather on propagation of satellite signals) - as I recall I used two parallel aluminium strips (1 inch wide approx)held apart (about 1 cm) by nylon screws and each strip sealed with self-amalgamating rubber tape (I think it's important not to electrolyse a liquid if it's conductive(!)).You need the plates to have a large surface area (A) and be close together (d) to get maximum capacitance (and even then the capacitance is relatively small)...the formula C = e0 A/d gives the capacitance C in air (e0 = 8.854 x 10-12 F/m, area A in square metres and d in metres, C in farads); multiplying by the relative permittivity of the liquid (e.g. water 80, ethanol 24 etc), gives the capacitance in the liquid.I built a simple capacitance to voltage converter which in those days was hooked up to a BBC microcomputer...

author: Maximus
author_rank: Contributor
timestamp: November 12, 2013, 10:29:19 am
content: So a capacitor made out of conductive liquid would behave like an ideal capacitor with a resistor in parallel? And if so would the value of the resistance change along with the value of the capacitance?

author: jmaja
author_rank: Frequent Contributor
timestamp: November 12, 2013, 11:07:24 am
content: I can't put anything inside the tank. I need to measure capacitance changes through the plastic wall (a few mm).I did some testing with a multimeter. I put the test leads on a wooden surface about 1 cm from each other. It showed 0.010 nF. When I put a 3 liter glycol (dielectric constant 37) canister on top of the leads it showed about 0.013 nF and about the same with a 5 liter water (80) canister. I couldn't see any difference which way I put the canister on top of the leads. The shortest side is about 10 cm and the longest about 30 cm.Then I tried using just one lead unplugging the other one. I got readings between 0.003 and 0.010 nF, but nothing happened while putting a canister on top. Then I connected the other lead to earth and got 0.005 nF and putting a canister on top doubled that to 0.010 nF.Is this the level of capacitance I would need to measure or can I easily get more?

author: peter.mcnair
author_rank: Contributor
timestamp: November 12, 2013, 11:31:36 am
content: Quote from: Maximus on November 12, 2013, 10:29:19 amI think that - for a conductive liquid and non-insulated electrodes - an equivalent circuit would indeed look like a capacitor with a resistance in parallel - the latter representing the conductivity of the liquid.In the case of water, if the applied voltage is more than 1.23 V then the bonds between the hydrogen and oxygen atoms will break and bubbles will form on the electrodes which will affect the resistance; I think that under these conditions the equivalent circuit resistance would be non-linear - the resistance will probably change with temperature and applied voltage and applied voltage waveform - amongst other things. Not sure about how these things would affect the capacitance part of the equivalent circuit. Also I guess a capacitance meter which doesn't mind having a (possibly changing) resistance across the capacitance being measured would be required. Interesting stuff...

author: jmaja
author_rank: Frequent Contributor
timestamp: November 13, 2013, 09:29:43 am
content: Regarding conductive fluids I found from this:http://media.digikey.com/pdf/Data%20Sheets/Quantum%20PDFs/QT114%20%28QProx%29.pdfNote that external electrodes used with conductivesolutions (i.e. aqueous liquids) do not measure thepermittivity of the fluid: they actually measure thepermittivity of the vessel wall, between 2 plates: theelectrode (plate 1) and the fluid (plate 2, effectively avariable-area ground plate): if the fluid were to be replacedwith mercury the signal would be unchanged.Aqueousprobes should be 100% insulated, even on the cut end of awire probe. The slightest pinhole of exposed metal anywhereon an immersed part of the probe will immediately convertthe probe into a bare-metal probe (see Section 2.2.5).

author: e100
author_rank: Frequent Contributor
timestamp: November 14, 2013, 06:04:28 am
content: Quote from: jmaja on November 13, 2013, 09:29:43 amReading this explains the behavior that I had been seeing with a self built concentric cylinder sense/ground electrode arrangement which was slow to respond to drops in water level.Essentially the entire fluid is the second (ground) electrode and when the water level drops a thin film of water sticks to the insulated inner sense electrode which causes it to read high even though there is a visible air gap to the surrounding metal ground electrode.This also means that the ground electrode can be any size and shape as long as it is always in contact with the water which physically extends it in all dimensions. I guess the concentric cylinder arrangement is often used because it gives the best interference shielding for the sense electrode when less than fully submerged.

author: jmaja
author_rank: Frequent Contributor
timestamp: March 09, 2014, 09:38:14 am
content: Quote from: DiligentMinds.com on November 26, 2013, 04:40:17 pmI finally tried this using a 200 ml bottle and two vertical 20 mm wide aluminium folios. The capacitance was using a DMM about 50 pF for empty bottle, about 100 pF for full bottle and 75 pF for a half filled.I also tried to use AVR XMega ADC for this. I connected one folio to ADC pin and the other to GND (without GND it didn't work). Then I charge the "capacitor" to Vcc or GND and start taking samples after setting the pin back to input. The voltage measured starts from about Vcc or GND and then after tens of samples it is about 550 mV. For full bottle the 11th sample was 1.70 V (Vcc) or 376 mV. For an empty bottle it was 1.49 V or 410 mV and for half filled 1.57 V and 400 mV. The standard devitation was 50-60 mV for all these. Thus by charging to Vcc I get a clear difference between a full and empty bottle and somewhat measurable difference between full and half. The bottle is about 20 cm high. What I really want to measure is about 1 m high.Is there a better way to measure this capacitance with XMega using just one pin? A 3.5 digit DMM seemed to work better even with 2 nF as the smallest scale.

author: jmaja
author_rank: Frequent Contributor
timestamp: March 09, 2014, 07:49:35 pm
content: It seems to work quite nicely with the following:1. Zero the "capacitor" by outputting GND to the pin2. Wait long enough (I use 10 ms now, depends on the RC time constant)3. Change pin to input and activate pullup for a short time (1-10 us depending on the RC time constant)4. Measure voltage (without pullup) and calculate C based on known R and t.Now I get 41 - 95 pF and 1.1-1.9 V for the small bottle using 470 ohm resistor and 1 us time. The standard deviation is only a few mV thus not much averaging is needed. The capacity vs. liquid level is not completely linear, but it is monotonic. Rockin the bottle splashes water and higher capacitance is shown for a while (seconds or minutes). I tried 2 us pullup (can only be used for full bottle) and the calculated capacitance changed only 2%. I also tried heating up the XMega to ~100 C and the measured capacitance changed about 20%. Most of the change came while very hot so this is not a problem for small changes. Probably the internal pullup "resistor" is changing.For higher capacitances (or resistances) longer pullup is needed. I tried with a 100 k resistor and full bottle. The results were clearly non-linear with short pullup times. At 1 us I got only 45 pF, but 8-12 us gave 95 pF +- 5%.

author: Niklas
author_rank: Frequent Contributor
timestamp: March 09, 2014, 09:22:41 pm
content: Have you been thinking about having two capacitors, one referenced to the bottom and the other one from the top, like a capacitive slider? Instead of taking absolute measurements, both measurements would be weighted to a relative result instead. That might cancel out offsets, drift etc.

author: jmaja
author_rank: Frequent Contributor
timestamp: March 09, 2014, 10:38:14 pm
content: Quote from: Niklas on March 09, 2014, 09:22:41 pmNo. Can you be more specific? I didn't quite get what you mean by bottom and top referenced. I know touch sliders do something like that, but they have just one finger somewhere. Not all the way from bottom to liguid level.Just when I thought this would work like a charm I decided to tilt the bottle. I maybe had a bit wet hands. The result was that the capacitance went to 130 pF for an empty bottle. That is more than the full bottle. I lead it sit for at least an hour and it actually got worse and read 140 pF. I got the same reading with DMM, so its not about my circuit nor code. I also measured the resistance between the folios and it was more than 20 Mohm (maximum of that DMM).Then I gently heated it with my hot air gun and the capacitance went back to 40 pF only to go back up to 130 pF in a few minutes. I guess there is moisture under the folios or tape holding them. Is there a way to avoid moisture problems? A folio without adhesive is certainly not good.

author: Niklas
author_rank: Frequent Contributor
timestamp: March 10, 2014, 12:04:09 am
content: Quote from: jmaja on March 09, 2014, 10:38:14 pmTake a rectangle and cut it diagonally to form two triangles. The idea is to have two capacitors with a constant capacitance sum that you can relate the two individual measurements to. Hopefully, both capacitors are affected equally by moisture, temperature etc due to their close positioning. It is basically to get a 100% reading and then relate the other two readings to it to get a percentage.

author: jmaja
author_rank: Frequent Contributor
timestamp: March 10, 2014, 07:32:15 am
content: Quote from: Niklas on March 10, 2014, 12:04:09 amYes, I have seen that in touch slides. I don't know how it would work in my case. I have rather long cables (a few meters) from ADC to the tank I would like to measure. What I have tested so far shows that I need to have a ground as well. Thus I would have two triangulars + one rectangle?I did some more testing with my bottle. I flushed it inside and I got only 15 pF empty and 130 pF full. Then I put some salt into the water and still got 130 pF for full bottle. After empting the salt water without flushing I got 150 pF! Flushing got it back to 15 pF again. It seems to be about moisture and conductivity inside the bottle, not outside. The tank I would like to measure will have some salt and other impurities inside.I did some capacitor theory calculations. The bottle is made from PET (density 1380 kg/m3, relative permittivity 3.4). Quick calculation from weight and surface area suggest that it is about 0.4 mm thick. The folios are about 18*3 cm. If I assume that there is conductive material inside the bottle, I get a 400 pF capacitor from folio to that conductive material. Now I'm measuring two equal capacitors in series, which should mean 200 pF, which is very close to what I get with salt water.Is that what is happening now? Is the remaining salt + moisture after empting the bottle conductive enough to work as calculated above? How can I measure the difference between just some impurities + moisture vs. real liquid?

author: jmaja
author_rank: Frequent Contributor
timestamp: March 10, 2014, 04:13:26 pm
content: Any idea how this works:http://data.designspark.info/uploads/knowledge-items/content-349/987650-8001.PDFFrom this video you can see that 8 traces go into the sensor: