Liquid Level measurement using copper foils sticked to the steel cylinder with arduino

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)

1 Like

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.

2 Likes

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.

Capture

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

The amount that the capacitance changes in response to the water will be very small compared to the parasitic capacitance to the metal container.

Imagine you are in a huge dome football stadium and it is pitch dark and someone lights a single candle somewhere in the stands. You'd easily be able to find that candle. It's light would be a significant change to the darkness.

Now imagine that all of the stadium lights are on and the brightness in the stadium is blinding. Now try to do the same trick and find a single candle in the stands. It will be much harder because the change in the light level from the candle is almost imperceptible.

It's the same reason that capacitive touch sensors don't work on metal enclosures.

1 Like

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.

How to make a capacitor

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.

1 Like

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).

That choice of materials makes all the difference. You can't do what you want to do in a metal container. You can do it in a glass container.

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.

1 Like

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

The capacitance to the metal tube is probably so high that your system can't fully measure it and in the process that capacitance is just getting more and more charged and giving you higher and higher readings.