DIY Capacitive Water Level Sensor using ESP32 Touch Read function

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ม.ค. 2025
  • In this video I will show you how to create the Capacitive Water Level sensors to be used with ESP32.
    You can find the source code for ESP32 here:
    github.com/kj8...
    and source code for Cereal Potter here:
    github.com/kj8...

ความคิดเห็น • 72

  • @oliver1978
    @oliver1978 2 ปีที่แล้ว +4

    I couldn't wait to replicate your idea, Kris. I am impressed how well the thing works. I used 5mm stainless steel rods 50cm inserted into PVC pipes. The result is quite linear function. I am not friend with ESP-IDF, hence used Arduino. Each centimeter was around 1 point on the 0..50 scale.

    • @hernanvassallo9902
      @hernanvassallo9902 2 ปีที่แล้ว

      You have to make another circuit?

    • @oliver1978
      @oliver1978 2 ปีที่แล้ว

      @@hernanvassallo9902 yes, the circuit is different. I made a pcb for the rods and modified to have 12V supply and few other things.

  • @CHXO2010
    @CHXO2010 3 ปีที่แล้ว +3

    Thank you, Kris, the experiences you so well shared in your video not only led me to making capacitive sensors with an iron on my desktop, but a way to achieve measuring soil moisture to provide water to maintain plants. I encountered difficulties with my python-version mess in the mac, so until I figure out the paths, I use a primary arduino code averagaing and mapping the readings (my equaly primary micropython dind't improve the readings that much), monitored wirlessly using virtuino. So, while I must hold to see the whole-grain stuff in my bowl, I found the sensors potentially functinal to operate a water supply sytem to a kitchen herb garden, so, I am much grateful to you for the spoonfull!

  • @bhMaker963
    @bhMaker963 3 ปีที่แล้ว +4

    About arduino range and reading speed you have function touchSetCycles(range,sleep), you can play with values for different range and reading times...

    • @bhMaker963
      @bhMaker963 3 ปีที่แล้ว +1

      also for instability of arduino readings i think averaging readings example for 10 readings will improve stability a lot !

    • @str8upkickyaindanuts289
      @str8upkickyaindanuts289 3 ปีที่แล้ว +2

      @@bhMaker963 I found that reading multiple channels somehow makes the reading more stable, only reading the channels I used in the code caused random drops, reading more than needed fixed the issue. Discovered after chasing my tail with random glitches even with averaging, which created a time delay that was undesirable. I wrote a program to read all touch pins to test which were stable, to my amazement the glitches went away on the channels that were previously an issue. So now I just include extra touch sensor function calls until I get stable performance on the pins I'm actually using.

  • @robertlongoria765
    @robertlongoria765 3 ปีที่แล้ว +1

    Thanks I have been looking for exactly this answer for weeks. Your description and guidance have made the reproduction of this process possible to me a person with somewhat limited tech skills. Thanks, I will be using the touch sensors for a + or - application. They will give me a binary signal describing a true or false condition; so the ardunio IDE will be just fine (I hope). Thanks for the knowledge, I respect your dedication to this project.

    • @richardangelo8344
      @richardangelo8344 3 ปีที่แล้ว

      you all probably dont care at all but does anybody know of a way to log back into an Instagram account??
      I was dumb forgot my login password. I would appreciate any assistance you can give me!

    • @devincarl8120
      @devincarl8120 3 ปีที่แล้ว

      @Richard Angelo instablaster :)

    • @richardangelo8344
      @richardangelo8344 3 ปีที่แล้ว

      @Devin Carl i really appreciate your reply. I found the site through google and I'm in the hacking process atm.
      Seems to take a while so I will reply here later when my account password hopefully is recovered.

    • @richardangelo8344
      @richardangelo8344 3 ปีที่แล้ว

      @Devin Carl It did the trick and I finally got access to my account again. I'm so happy!
      Thank you so much you really help me out!

    • @devincarl8120
      @devincarl8120 3 ปีที่แล้ว

      @Richard Angelo you are welcome :D

  • @miltonjimenez5771
    @miltonjimenez5771 6 หลายเดือนก่อน

    I am been loocking for something like this ,I will make it and let you now my results, thanks

  • @hermannsonnleitner4645
    @hermannsonnleitner4645 3 ปีที่แล้ว +1

    To fix the problem with the measurement error (spikes) and also to get a higher resolution, simply call the function 'touch_pad_init ()' in the setup () routine.

    • @hermannsonnleitner4645
      @hermannsonnleitner4645 3 ปีที่แล้ว

      correction: the 'touch_pad_init()' function needs to be executed each time before reading the cap-value.

  • @kbouwman64
    @kbouwman64 3 ปีที่แล้ว +1

    I would like to use this to measure the water level in a 55-gallon drum. The sensing range would be nearly a meter tall. As I want to move this sensor from barrel to barrel, I was thinking to apply copper foil tape strips to an 18mm OD plastic pipe and covering that with heat shrink tubing. I would then 3D print an enclosure for the electronics at the top of the pipe. I would like the best resolution I can get but am ok with whatever that turns out to be. Do you have a recommendation for how wide the copper strips should be and what the gap between them should be? I get the relationship between wider and narrower but for a 1-meter long sensor...where would you start to best utilize the touch input? What resolution would you expect is possible? I know I could stack sensors (and will if I have to) but I would like to keep this as simple as possible.

  • @whiteking80
    @whiteking80 2 ปีที่แล้ว +1

    Awesome demo! May I know what freq signal injected onto the copper pad?

    • @kris-.1439
      @kris-.1439  2 ปีที่แล้ว +1

      Sorry, I don't know the answer. I used the Touch sensor function call of ESP-IDF. You can find more information here: docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/touch_pad.html

  • @hernanvassallo9902
    @hernanvassallo9902 2 ปีที่แล้ว

    Great experiment. I'd like to build a water level sensor with this principie.

  • @swissTom124
    @swissTom124 3 ปีที่แล้ว +2

    Maybe could even use a double wire instead of those sensors as an capacitor? Just close the end with glue.

  • @Schroedimoto
    @Schroedimoto 8 หลายเดือนก่อน

    Hello,
    Thanks for the great video.
    I always thought it is necessary that the electrode (copper) touches the medium to work correctly
    So its okay if the electrode is completely sealed? Does this also work if i have tube in tube?

  • @Solitudetravel
    @Solitudetravel 6 หลายเดือนก่อน

    does anyone have an idea of how the capacitance values might change when the copper foils are stuck to inner walls of steel cylinder? I tried it and its not giving stable readings at a particular height. suggestions?

  • @mohammedhammouda2692
    @mohammedhammouda2692 3 ปีที่แล้ว

    Hello, Thank you for the video. I have a question, I have no background in using this type of application. I am trying to use this as an FDC1004 contactless sensor because I cant get an FDC1004 at the moment, I only have the ESP32, do you think this will work? Thank you again.

  • @PranaliBhongade
    @PranaliBhongade 11 หลายเดือนก่อน

    I want to ask- as depth increases, why capacitance is decreasing ? it should increase with depth right?

  • @chibimarukochan9462
    @chibimarukochan9462 4 ปีที่แล้ว +1

    Great I have a few questions. 1. Can you put the sensor outside the container. I.e. not submerged in the water and totally contactless to the water?
    2. Can it sense the water decreasing?
    3. Can it support 1 litre of water?

    • @kris-.1439
      @kris-.1439  4 ปีที่แล้ว

      You may want to check on this one ..
      th-cam.com/video/CDwmm0gQsTw/w-d-xo.html

    • @charlesrg
      @charlesrg 4 ปีที่แล้ว

      I put the strips on the outside to test and it works as well, th-cam.com/video/b8V8aReSjAs/w-d-xo.html

  • @ProEvilPriest
    @ProEvilPriest 2 ปีที่แล้ว

    Great Video, i was wondering if it is possible to use the sensors with an RPI and without the ESP32 module. Do all the code in Python and connect the sensor to the GPIO Pins.

  • @skinkebuen
    @skinkebuen 3 ปีที่แล้ว

    Great project. I am looking for a way to measure level in a fuel tank. Do you think it is possible to replace the strips with a tube with a rod in senter? The tube will act as a capacitor. My plan is to immerse the tube into the tank. The tank is metal, and I can not use strips on the surface og tank to make the capacitor.

    • @AlienRelics
      @AlienRelics 2 ปีที่แล้ว +1

      Concentric tubes is precisely how I added level sensing to a gas tank. If it is a fluid that is not a conductor, no insulating layer is needed. This was back in the early '80s, I used a couple of 555 timers and an LM3914 wired to show continuous level rather than just 10 steps.
      The outer tube is the ground and shields it from outside interference and any parasitic capacitances from the tank or things outside a nonconductive tank.
      I have done the same with water based fluids, in those cases I coat the tube with epoxy or polyurethane. It is important there be no flaws to allow water through.

  • @Damalycus
    @Damalycus 3 ปีที่แล้ว

    This is so cool. Never knew spreadsheets had this feature.

  • @evanlane1690
    @evanlane1690 3 ปีที่แล้ว

    This was very helpful! Thank you.

  • @clasperj
    @clasperj 2 ปีที่แล้ว

    Hi Kris, thanks for the detailed and amazing tutorial. Do you think the sensor will still work well in salted or mineral water? or "grey water". I would like to apply this design to monitor the water level of a water garden

    • @kris-.1439
      @kris-.1439  2 ปีที่แล้ว

      Yes, I tested it and it seems working.

  • @mksmurff
    @mksmurff 3 ปีที่แล้ว

    What a great video thank you. I am looking at starting a project to measure two-stroke petrol mix in a plastic tank. So I won't be immersing the probe but sticking it to the outside. What're your thoughts on this? Furthermore, do you have any idea why the Arduino library doesn't work well? It's all I have ever used for my ESP32. Thanks

    • @kris-.1439
      @kris-.1439  3 ปีที่แล้ว +1

      If your plastic tank wall is not too thick, it should work. I saw some people using aluminum foil with a glass bottle and it works as well.
      The reasons that I'm not using Arduino IDE are
      1. Reading resolution, Arduino IDE will report reading around 50 counts with my sensor not touching anything compare to ESP-IDF that would read around 700. Thus I will get more resolution in depth-sensing using ESP-IDF.
      2. As shown in my video when I plotted Arduino readings, sometimes the reading suddenly becomes zero.
      I haven't played with Arduino IDE for quite some time, maybe their software gets updated and these issues have been fixed.
      Thanks for watching the video.

    • @mksmurff
      @mksmurff 3 ปีที่แล้ว

      @@kris-.1439 Thank you for the reply. My initial tests reveal the same as yours. Have you posted these findings anywhere?

    • @kris-.1439
      @kris-.1439  3 ปีที่แล้ว +1

      @@mksmurff Only in my video around 5:16 mentioned why I did not use Arduino IDE.

  • @ItisImarko
    @ItisImarko 10 หลายเดือนก่อน

    I wonder if that can work for other fluids.. probably is just individual kalibrering. Second question is how it will work if you have metal tankand glue it on a side?

    • @Solitudetravel
      @Solitudetravel 6 หลายเดือนก่อน

      I am working on it. It gives increasing capacitance at a particular height. So calibration is not possible. Any thoughts?

    • @ItisImarko
      @ItisImarko 6 หลายเดือนก่อน

      @@Solitudetravel I assume you heve seen standard option to measure.. from light reflecting to ultrasonic.. well Have you think og mixing load cell and other option and make measurment relative to weight and hight. Offscourse that will work only on stationary objects not while on move (rv/boat).

    • @Solitudetravel
      @Solitudetravel 6 หลายเดือนก่อน +1

      @@ItisImarko i tried tof and ultrasonic. They r ok but i kinda need sub mm accuracy. I thought this touchread can give me more accurate results

  • @Cyruscosmo
    @Cyruscosmo 2 ปีที่แล้ว

    Would it be possible to place the copper tape on the outside of an aquarium and have it function as a water level indicator?

    • @kris-.1439
      @kris-.1439  2 ปีที่แล้ว

      It is hard to say because there are so many factors such as the thickness of aquarium tank and the type of material of the aquarium wall. If wall too thick, ESP32 may not be able to detect the different in capacitive change.

  • @akiljoko6796
    @akiljoko6796 2 ปีที่แล้ว

    hi kris,thank you for sharing amazing idea, but i have problem when build and flash the program, when im trying to flash it says "Variable ${config:idf.pythonBinPathWin} can not be resolved because setting 'idf.pythonBinPathWin' not found".what should i do?

    • @nasserghouse9119
      @nasserghouse9119 ปีที่แล้ว

      Hi.. I have the same problem..
      I see that you have commented three months ago.. could you tell me if you found a solution to the problem ?

  • @charlesrg
    @charlesrg 4 ปีที่แล้ว

    I'm trying to understand what do you mean with dynamic ranges related to the width. I'm using wide strips and it's working well. over 1 inch width. What are your thoughs on width ?

    • @kris-.1439
      @kris-.1439  4 ปีที่แล้ว

      Basically it is the depth of water level that ESP32 can read until the touch read becomes saturated. For example the 1 inch width copper tapes will not decrease the touch read after the immersed into the water more than 10 cm, however the 0.5 inch copper tapes, you can immersed much deeper into the water until the ESP32 touch read becomes saturated.

    • @charlesrg
      @charlesrg 4 ปีที่แล้ว

      @@kris-.1439 interesting, I'm using almost 2 inches outside of the water and I've full readings. I guess I don't get saturation because I've a larger bag between water and the electrodes

  • @tomsaavedra6920
    @tomsaavedra6920 3 ปีที่แล้ว

    I flashed the code on my wroom dev module. The Cereal Potter does not start at 600-700 and go down when touching the sensor. Mine starts at 0 and goes up to around 6 when touching either sensor. Any idea what's causing this?

    • @tomsaavedra6920
      @tomsaavedra6920 3 ปีที่แล้ว

      I had to comment out the EnableScale in app_main

  • @stefanvasilevski8724
    @stefanvasilevski8724 ปีที่แล้ว

    Which language do you use to write the Serial monitor?Python, C++ or another?

  • @deesimon1693
    @deesimon1693 2 ปีที่แล้ว

    Can you use an arduino uno microcontroller instead of esp32 and achieve similar results?

    • @kris-.1439
      @kris-.1439  2 ปีที่แล้ว

      I'm don't think UNO has touch read pins as ESP32.

  • @NeoBelerophon
    @NeoBelerophon 4 ปีที่แล้ว

    Very nice idea! Is there any reason why the IDF project is not longer available on github?

    • @kris-.1439
      @kris-.1439  4 ปีที่แล้ว +1

      Please check again. I forgot to make it public.

    • @nasserghouse9119
      @nasserghouse9119 ปีที่แล้ว

      Hi..can you tell me where exactly is the IDF onboarding file, please? I get errors every time I try to run the program. It says the path is not found etc..

  • @robertlongoria765
    @robertlongoria765 3 ปีที่แล้ว

    Kris I have been thinking about this since I saw it last week. I have a question. Can I use this technique to measure the increasing width of a persons waistline? Can you see this sensor (the copper tape soldered to esp32 GPIOs) as a type of belt? How would it work? Would you put it against the skin?

    • @kris-.1439
      @kris-.1439  3 ปีที่แล้ว

      Robert, I have not experimented with this aspect, so I don't know. But one thing to know is that the sensor is very sensitive to moisture, so if the people are sweating, it probably will affect the result.

    • @robertlongoria765
      @robertlongoria765 3 ปีที่แล้ว

      @@kris-.1439 thanks for the tip!

  • @borgteknoloji
    @borgteknoloji 3 ปีที่แล้ว

    CerealPotter program gives zedgraph error. i am using 5.1.5 i have to use an old library.....

    • @kris-.1439
      @kris-.1439  3 ปีที่แล้ว

      I got the same error when using 5.1.5. You can just comment out line that gave you an error if you can't use ZedGraph 5.1.7.
      //this.zedGraphControl1.UseExtendedPrintDialog = true;

  • @ssrisunt
    @ssrisunt 4 ปีที่แล้ว +1

    Cool ... I will try it

  • @purplegirl6103
    @purplegirl6103 2 ปีที่แล้ว

    Hi, can you give code of arduino ide platform

    • @kris-.1439
      @kris-.1439  2 ปีที่แล้ว

      Sorry I don't have it.

    • @mohammedhammouda2692
      @mohammedhammouda2692 2 ปีที่แล้ว

      Asalamu Alykum,
      please check this th-cam.com/video/b8V8aReSjAs/w-d-xo.html the code is in the description of the video. InshAllah it helps !

  • @mubasherazam8972
    @mubasherazam8972 4 ปีที่แล้ว

    The content of video and knowledge which have been shared, are awesome.I appreciate your efforts.I have few questions
    1. Can this sensor be used in 5 feet deep water tank?
    2. Will it work for dirty water, e.g lake water?
    3. Will these sensor be corrosion over the period of time?
    4. Are these sensor Arduino compatible because i have bought arduinos ?
    5. Does temperature and humidity effect sensor reading ?
    6. How long wire from sensor to board is recommended?

    • @kris-.1439
      @kris-.1439  4 ปีที่แล้ว +2

      Thanks very much for the comment. I will try to answer some of your question. When I discover this sensor it is quite new to me too, so I may not have answer for all of your questions.
      1. You may try to use very small electrode area to expand the range but you will lose the resolution or you can use multi channels of touch read to achieve this. Let say you have 5 of water level sensors stack them up.
      2. I did some experiment to see if the calibration stay the same with tap water, 5% salt water and 7% salt water. To my surprise the calibration doesn't seem to be changed at all.
      3. This type of sensor is using capacitive not electro conductivity thus there will be no corrosion from electrolysis. But I don't know how long the will the laminate sheet last.
      4. I'm using this sensor with ESP32 which is compatible with Arduino but as in my video the Arduino touch read has some bug.
      5. I don't have an answer for this. But I left the sensor run couple days, the reading seem fluctuate little bit but not significant.
      6. If you want to try very long wire you may need a wire with very good shield.

    • @mubasherazam8972
      @mubasherazam8972 4 ปีที่แล้ว

      @@kris-.1439 What if i use Crystal resin coating on almunium tape instead of lamination ?

    • @charlesrg
      @charlesrg 4 ปีที่แล้ว

      @@kris-.1439 you could just have taped the foil to the outside of the bottle th-cam.com/video/b8V8aReSjAs/w-d-xo.html