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

**URL:** <https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633>\
**Category:** Science and Measurement\
**Created:** [June 23, 2024, 9:58am UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633 "2024-06-23T09:58:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkhpr\_44](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@rkhpr\_44](https://forum.arduino.cc/u/rkhpr_44)\
**Post date:** [June 23, 2024, 9:58am UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/1 "2024-06-23T09:58:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [June 23, 2024, 1:33pm UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/2 "2024-06-23T13:33:40Z")

</div>

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](https://forum.arduino.cc/uploads/short-url/bGh2gl0AztQHw48ss0E4nxtfWql.pdf) (520.0 KB)

---

<div class="post-metadata">

**Author:** ![rkhpr\_44](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@rkhpr\_44](https://forum.arduino.cc/u/rkhpr_44)\
**Post date:** [June 23, 2024, 3:52pm UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/3 "2024-06-23T15:52:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [June 23, 2024, 3:53pm UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/4 "2024-06-23T15:53:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rkhpr\_44](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@rkhpr\_44](https://forum.arduino.cc/u/rkhpr_44)\
**Post date:** [June 23, 2024, 4:27pm UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/5 "2024-06-23T16:27:59Z")

</div>

but i have insulated the copper foils and placed it inside the steel cylinder. after pouring water its giving me capacitance readings.

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [June 23, 2024, 4:33pm UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/6 "2024-06-23T16:33:16Z")

</div>

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](https://europe1.discourse-cdn.com/arduino/original/4X/1/f/6/1f6ffe93f3a7108b8ee2d3412a0b7ad93c60ccbd.png)

---

<div class="post-metadata">

**Author:** ![rkhpr\_44](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@rkhpr\_44](https://forum.arduino.cc/u/rkhpr_44)\
**Post date:** [June 23, 2024, 5:20pm UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/7 "2024-06-23T17:20:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DVDdoug](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dvddoug/32/671533_2.png) [@DVDdoug](https://forum.arduino.cc/u/DVDdoug)\
**Post date:** [June 23, 2024, 5:44pm UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/10 "2024-06-23T17:44:35Z")

</div>

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.

> [@](#):
>
> How is capacitance formed or whats just happening in there?

**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](https://www.instructables.com/Aluminum-Foil-Plate-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.

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [June 23, 2024, 7:35pm UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/11 "2024-06-23T19:35:39Z")

</div>

> [@rkhpr\_44](#):
>
> But when i fill in the water...the capacitance changes very well.

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.

---

<div class="post-metadata">

**Author:** ![rkhpr\_44](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@rkhpr\_44](https://forum.arduino.cc/u/rkhpr_44)\
**Post date:** [June 24, 2024, 5:38pm UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/12 "2024-06-24T17:38:08Z")

</div>

```arduino
#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](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

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [June 24, 2024, 5:49pm UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/13 "2024-06-24T17:49:02Z")

</div>

> [@rkhpr\_44](#):
>
> he has done in a glass container

Glass is a good choice. For an even easier approach, see the article posted in reply #2

---

<div class="post-metadata">

**Author:** ![EmilyJane](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/emilyjane/32/821537_2.png) [@EmilyJane](https://forum.arduino.cc/u/EmilyJane)\
**Post date:** [June 24, 2024, 6:15pm UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/14 "2024-06-24T18:15:20Z")

</div>

From @anon94801460 post #2

 ![Screenshot 2024-06-24 at 1.13.15 PM](https://europe1.discourse-cdn.com/arduino/original/4X/b/8/7/b87b31ffd36ba0591c177714a48f77fb17733cf8.png)

---

<div class="post-metadata">

**Author:** ![anon27210439](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@anon27210439](https://forum.arduino.cc/u/anon27210439)\
**Post date:** [June 24, 2024, 6:18pm UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/15 "2024-06-24T18:18:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rkhpr\_44](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@rkhpr\_44](https://forum.arduino.cc/u/rkhpr_44)\
**Post date:** [June 25, 2024, 9:11am UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/17 "2024-06-25T09:11:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anon27210439](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@anon27210439](https://forum.arduino.cc/u/anon27210439)\
**Post date:** [June 25, 2024, 10:54am UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/18 "2024-06-25T10:54:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rkhpr\_44](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@rkhpr\_44](https://forum.arduino.cc/u/rkhpr_44)\
**Post date:** [June 25, 2024, 11:53am UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/19 "2024-06-25T11:53:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [June 26, 2024, 7:22am UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/21 "2024-06-26T07:22:41Z")

</div>

an alternative could be [TOF-distance-sensors](https://www.pololu.com/category/306/carriers-for-st-time-of-flight-tof-distance-sensors)  
I have used them in water tanks

---

<div class="post-metadata">

**Author:** ![rkhpr\_44](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@rkhpr\_44](https://forum.arduino.cc/u/rkhpr_44)\
**Post date:** [June 26, 2024, 10:56am UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/22 "2024-06-26T10:56:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rkhpr\_44](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@rkhpr\_44](https://forum.arduino.cc/u/rkhpr_44)\
**Post date:** [June 26, 2024, 12:29pm UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/24 "2024-06-26T12:29:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DaveX](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/davex/32/751443_2.png) [@DaveX](https://forum.arduino.cc/u/DaveX)\
**Post date:** [June 26, 2024, 6:54pm UTC](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633/25 "2024-06-26T18:54:31Z")

</div>

> [@rkhpr\_44](#):
>
> any thoughts on how to get stable readings?

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.

[Next page](https://forum.arduino.cc/t/liquid-level-measurement-using-copper-foils-sticked-to-the-steel-cylinder-with-arduino/1274633.md?page=2)
