Is anybody here really good with ESP32 touch sensors?

I need some sort of sensor, to detect liquid levels in a tank.
I had planned on ultrasonic, but that is going to be very difficult to implement physically.
I was thinking maybe the touch sensor input could be used?

So I’m just wondering if anybody here is a lot more knowledgeable about them than I am.

Well, I had the same problem (replace oil tank stick manual measurement). Also thought about ultrasonic, but was not doable (echo in tank too chaotic). I excluded touch because oil would have been too aggressive. And: better no electricity in an oil tank :wink:

Last plan was: put pressure sensor in closed top of pipe and sink the pipe to the ground.

Unfortunately for you I now have a heatpump :smiley:, so no details about that, just an idea.

Wouldn’t work for me as the tanks are vented. I didn’t think about echo in the tanks, interesting.

I currently have some capacitive sensors, that glue on to the side of the tank. They work, but A) a bit expensive and B) have only specific levels.

I was thinking maybe a capacitive strip on the outside of the tank. Kinda like the glue on ones, but a longer strip that would give an analog level. I’m just not sure about the wire runs, I’m sure that would throw the proverbial monkey wrench into the works.

Maybe a project for next year, too much to do this year.

Maybe you can use a IR Distance sensor for example this one:
Dutch shop, also in English

There are sensors in different ranges.

Edit: link sensor was out of stock

I haven’t actually made it myself, but would this be helpful as a reference?

For tanks, you need float switch type liquid level sensor.

That (and the LASER) would work, but the problem is I only have access to a single side and the bottom. I can’t get to the top without cutting holes in the floor.
It’s just very inaccessible.
I’m going to try the capacitance sensor on the esp32 and see how that works. Maybe next year, right now I just need to get this project working.

The XKC-Y26 is ideal for your tank setup. It detects liquid through plastic walls. No need to open or drill the tank. It works from outside the container surface. This matches your limited access problem well. It gives a simple digital ON or OFF signal. You can detect specific liquid height points.
Multiple sensors allow multi-level monitoring. It works well with ESP32 systems. Since ESP32 runs at 3.3V and the sensor is 5V, you must use a logic level converter.
Mount the sensor tightly on tank wall. Avoid air gaps between sensor and tank. Place at desired liquid height points. For connections in the development phase, dupont cables will suffice.

UWB radars (won’t have a problem with echos and even foam)

@richonguzman What about the range? How much distance do they cover usually?

Cheap ones (they are not cheap though) cover less than 2 mts

Expensive ones can reach till 10-15m with good resolution

ha! That’s what I’m using! They do work great, and easy, but expensive. But again, it’s only a single level output, not a 'level output" based on fluid levels.

Originally, I had planned on using 4 for each tank, to replace their crummy sensors (that look like spark plugs I guess). But I wanted to go with an actual level sensor like ultrasonic. But that didn’t work, so I went back to these, but they would be very expensive (at least 4 per tank, 4 tanks).

I used to do a lot of “bare metal” stuff, but dang, I’m just getting too old. I thought this was going to be “simple”, but once again, I got my patootie handed to me. (man, I miss being young…)
I’ll probably still look into the esp32 sensor stuff, just to satisfy my curiosity…

Look here.
That can help you perhaps.

I’ll have to look into those, but I’d still need to cut a hole in the top of the tank. It might be smaller for the TOF sensor though, and a single hole vs. 2 I wonder how that would work out for very short distances, like when the tank is full.

I have used a pressure sensor and a 4-20mA to 0-3.3vdc converter which connects to an ESP 32. All purchased from Aliexpress.

If you need idiot proof level sensing the HC-SR04 sonar part is worth a try. I mount it in a 50mm PVC water pipe endcap using a couple of rubber grommets then fit the assembly onto a length of 50mm PVC pipe. It’s good for up to 1.5+M and has no noticeable reflection issues.
Cut the tube bottom off at 45 degrees to prevent ‘bottoming’ Cheers

I’d second this - I’ve been using one of these with an ESP32-C3 for several years tracking a water tank level. Get the 5V in, 0-3.3v out as this matches pretty well with the ESP32’s Analog inputs, rather than getting the current converter one.

That’s what I had planned on using, and may still use. But I really can’t get to the top of the tank, and really don’t want to drill holes in the tank(s).
I basically only have access to one side, and the bottom.
But thanks for the suggestion.

This is just an idea, but how about a method for detecting acoustic resonance points?

Calibration would be necessary, but imagine a glass harp.

Place a speaker and microphone on the bottom or side of the tank. Sweep a sine wave through the speaker, pick up the signal with the microphone, and analyze the amplitude and frequency.

From the resonance frequency, you can estimate the tank’s volume (the resonance point will be low if the tank is full). However, pre-calibration would be necessary for both very small and full tank volumes.

This method seems to have fewer constraints regarding sensor placement.

Further verification is needed to determine if it actually works.

A similar approach worth considering is to use a solenoid-driven soft hammer to deliver a light impact, pick up the sound with an accelerometer, and perform frequency analysis using FFT.

About 40 years ago, I received a request to replace human-based hammer sound testing with a machine, and I custom-built an evaluation device for research purposes.

At that time, I used an INMOS transputer for FFT and mounted multiple circuit boards in a rack, but nowadays, an inexpensive commercially available SoC would suffice.