First lemme explain my idea. I am trying to measure the height of the liquid level in a steel cylinder by placing 2 insulated copper foils on to the walls of steel cylinder and measuring the capacitance through touch read function in arduino and ESP32 MC - I connected 1 foil to touchpad and another to ground. While conducting the experiment...i am getting capacitance values, but the values are varying a lot - infact always increasing. Then, I grounded the cylinder - it is giving me less varying values still it doesnt settle. I used water as the liquid-may be its increasing because water is conducting and increasing its charge? Now I want to know how do i stablize my results of capacitance so that i can match it with my height accordingly.
Thanks
Copper tape on the outside of a plastic (nonconductive) cylinder works very well, as described in the attached PDF file.
NV27-Measuring Water Level.pdf (520.0 KB)
yeah true..but steel vessel is wat i am actually working on and i tried placing outside steel..it gives very minute changes which is difficult to calibrate
Since steel is conductive, you are measuring the capacitance between the steel and the copper tape. The water inside the steel pipe makes no difference.
but i have insulated the copper foils and placed it inside the steel cylinder. after pouring water its giving me capacitance readings.
You forgot to mention that the tape is inside.
However, if the strips are taped or glued to the inside of the cylinder, the capacitance you measure between the two strips is still almost entirely due to the steel cylinder.
Capacitance C increases as the distance between the plates decreases.

I get it. But when i fill in the water...the capacitance changes very well. So i can use it for measuring height right?
Or it wud be better if you tell me how this whole thing works actually? How is capacitance formed or whats just happening in there?
Iam just doing out experiments and trying diff combinations
Resistance will probably work better, with multiple pairs of pads for different heights. Resistance will vary depending on the purity of the water and maybe corrosion of the copper but there should be a big difference with and without water.
I assume most commercial solutions use a float or sound in the water or ultrasound above the water.
The fuel tank in your car has a float (connected to a potentiometer).
Ships & boats take a "sounding" but a quick search tells me that the word isn't derived from the word "sound" and it was in use long before sonar was invented.
A capacitor is two conductive plates with an insulator in-between. There is no direct connection through a capacitor. It can be "charged" and you can pass an AC signal through it but not constant DC.
The copper insulated from the steel makes a capacitor and the way you have it wired you have two capacitors in series (with the cylinder as and "extra" plate in the middle). The surrounding liquid shouldn't change the capacitance but it will create a resistance (actually conductance) in parallel.
What is that supposed to mean? If the capacitance changes "very well", then you don't have a problem.
To continue this discussion on a sensible basis, please post the details of the setup, the code and some actual measurements.
#include <stdio.h>
#include <string.h>
void setup()
{
Serial.begin(115200);
delay(1000);
Serial.println("ESP32 Touch Test");
}
char msg[32];
int t1,t2;
void loop()
{
t1 = touchRead(1);
delay(1000);
t2 = touchRead(2);
sprintf(msg,"%d,%d",t1,t2);
Serial.println(msg);
delay(1000);
}
This is the code to read the values... and to explain that "the capacitance values changes very well" - I mean it changes and does not remain stable for a stable height. For example at height 5 cm it should remain at a number like 500000pF, but as time goes the values keep increasing slowly. Due to this i am not able to calibrate or match a certain capacitance with a height.
To explain my setup: I connect 1 copper foil to touch pad and another foil to ground and i have also grounded the steel cylinder.
Inshort i haved mimiced "https://www.youtube.com/watch?v=40TjjWLljaU&t=365s" but he has done in a glass container and i am doing it in steel cylinder by sticking it into the wall. Pls help me
Glass is a good choice. For an even easier approach, see the article posted in reply #2
From @jremington post #2
If you stick the isolated foil to the steel wall, and it is connected to GND, you are measuring the capacitance between the foil and the steel, through the insulator.
It doesn't matter the other foil and it doesn't matter much the water level. I would say, if I understand right your setup
The idea is that between positive and negative there should be only water or air (and pvc).
thanks...i just wanted some readings from it ´thats it...i dont care if its bw steel or foil or something else....but even if iam measuring capacitance of something...it should be stable right? why is it increasing..is my doubt.
Measure the capacitance directly with a good multimeter, if it's not too small. Also measure resistance, just in case.
I don't know what could happen. At the end you have it connected to a big piece of metal that could be picking anything.
I can understand you. But i can confirmly say with my experiments in both plastic mug and steel cylinder. That irrespective of both steel and plastic the capacitance readings are on the rise always at same height. Im tired of it now
an alternative could be TOF-distance-sensors
I have used them in water tanks
good. i even used vl53lix from m5stack website. its not giving less than 1mm accuracy..or sometimes not even 1 mm. I think it is because of my cylinder, it is 50mm diameter and 20cm in height, and the fov degree may not reach all the way down? if u know more...can u just share info
I am not sure if anyone got this idea but I used the touchread function of arduino to get some readings. Lemme explain my project. I wanted to measure the height of a liquid level in a steel cylinder. So seeing the touchread function giving some values..i thought i can stick an insulated copper foil to wall of my steel cylinder and add water and as water rises it might give some value. And I was right...it gave me increase in values...but the problem is that the values does not get stablized even if i stop adding water. They keep on increasing slowly. So my idea is that if i get a certain value at certain height...i can match it and tell the exact height..any thoughts on how to get stable readings? MC: ESP32S3 M5Stamp. Code i used is the touchread example from arduino
First you have to figure out the physics of what is affecting the capacitance. It is unclear from the description what the circuit, setup, procedure, and results are.
