I've manufactured a tubular, water-tight, capacitor to measure liquid level in a chambered device. I have connected it to Arduino and written a sketch using the capacitiveSensorRaw library. I am discharging through a 1 megaohm resistor. I am calling the library API for 200 samples but am also calling the library 100 times and averaging the results for each reading, in an attempt to smooth the final result (please let me know if this is meaningless). I start by getting a baseline capacitance reading during setup. I consider this "zeroing" the device, to account for manufacturing differences for the capacitor sensors I've built (I'll eventually have a number of these chambers running). Thus, I subtract the baseline reading from each returned reading from the library routine.
As the fluid levels in the columns rise, the capacitance readings rise, as expected, but not consistently. My desire is to be able to tell the fluid level within about 10 ccs and so I am trying to determine the value ranges associated by testing the device in 10 cc increments from 0 to 200 ccs. I have run the test repeatedly using the same drip rate of fluid and using fluid at the same room temperature with the same sensor, in the same chamber and, all other things being equal, would expect that I would get close to the same result for each test at each 10 ccs. My readings are inconsistent, sometimes as much as 500 - 600 units difference between each test at each fluid level. If I can get it down to 50 units or so, with a much more consistent reading, I'll be in business. Can anyone give me some things to try to produce more consistent readings? Thanks.