Author Topic: Acoustic level sensing in a pipe  (Read 15953 times)

0 Members and 3 Guests are viewing this topic.

Offline ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6805
  • Country: de
Acoustic level sensing in a pipe
« on: May 01, 2022, 07:43:33 am »
I want to add a level sensor to my rainwater cistern. It's outside, away from power connections, so I plan to build a battery-operated gadget that measures the level, say once an hour, sends data via a radio link, and goes back to sleep. The sensor and electronics should live in the underground concrete tank -- above the water level, but in a damp environment with various critters about.

Acoustic sensing looks promising: No moving parts and a reasonable linear range. Since there is an additional concrete support structure inside the tank, I think simple distance sensing from the top down to the water level would be messed up by the additional reflections. So I thought I might try acoustic sensing in an open-ended tube (see the attached sketch).

I could either measure the time until a signal burst returns -- not sure whether the returning signal will be strong enough in a tube with small diameter/length ratio? I would prefer a single transducer to emit and receive the sound. Or I could measure the resonance frequency of the air column, like in an organ pipe or when blowing on a beer bottle: Let the microcontroller emit various short sound bursts and measure the transducer impedance.

The air column in the tube would be between 0.5 m and 2.5 m long, depending on the water level. Hence a sound travel time (to and fro) between 3 ms and 15 ms, or a resonance frequency between 165 Hz and 33 Hz, if I am not mistaken. (The air column represents 1/4 of the wavelength for a resonance measurement.)

Before I start playing with this, I am looking for your experience:
  • Has anyone done this before?
  • Any recommendations in favor of travel time or resonance frequency measurement?
  • Is a minimum time of 3 ms easily achievable with a single ultrasound emitter/receiver, or would that mean asking for trouble?
  • Any reasons why the whole concept is stupid anyway?
  • Any recommendations for transducers which can withstand the damp environment long-term? The frequency ranges (and hence transducers) would be quite different for ultrasound travel time vs. acoustic resonance, of course.
Many thanks!
« Last Edit: May 01, 2022, 07:51:02 am by ebastler »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11598
  • Country: us
    • Personal site
Re: Acoustic level sensing in a pipe
« Reply #1 on: May 01, 2022, 07:55:15 am »
No practical experience from my side, but this video came to mind:



He used the standard distance sensor for oil level measurement in a tank. Not sure of other obstacles would be an issue, but those sensors are fairly directional.
Alex
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6560
  • Country: ro
Re: Acoustic level sensing in a pipe
« Reply #2 on: May 01, 2022, 08:09:53 am »
Similar project:


Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5402
  • Country: us
Re: Acoustic level sensing in a pipe
« Reply #3 on: May 01, 2022, 08:47:00 am »
Look into products from MaxBotix.
 

Offline ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6805
  • Country: de
Re: Acoustic level sensing in a pipe
« Reply #4 on: May 01, 2022, 11:50:27 am »
Thank you all -- three very helpful suggestions, covering different flavors of a possible implementation.

I will at least try one of the cheap ultrasound distance sensors, either in free space or in a tube, because it would be such a simple, low-cost solution. Am concerned about the longevity of the sensors though, they will probably corrode quickly. Leo's "sound in a pipe" design is very close to what I have in mind, and the use of a cheap but waterproof speaker and microphone is neat.

And then there is, of course, the option of using a decent ultrasound transducer right away. I am reluctant to spend the > $100, but that might well be where I end up anyway, if not now, then two years from now when my homebrew solutions have failed for the third time...

Maxbotix look like a good choice, and I have found a distributor in Germany. I will ping them for advice regarding measurement in the presence of obstructions, and also how to deal with condensation. (I came to realize that in cold weather, when the sensor is colder than the water below, I should probably expect condensation right on the sensor.)
 

Offline nali

  • Frequent Contributor
  • **
  • Posts: 690
  • Country: gb
Re: Acoustic level sensing in a pipe
« Reply #5 on: May 01, 2022, 02:50:16 pm »
It might be even easier to stick a load cell under the whole tank and measure the weight of the thing.

Resonance might be interesting... if you can find a suitable transducer or speaker you might just be able to generate a sweep or chirp, then look for a notch in the drive current? That would save messing about with tx/rx.
 

Offline ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6805
  • Country: de
Re: Acoustic level sensing in a pipe
« Reply #6 on: May 01, 2022, 04:30:31 pm »
Seems like it might be easy just to put an absolute pressure sensor at the bottom of the tank and have wires rise up to communicate the result to the transmitter or whatever locating the batteries either with the radio or the pressure sensor.

That's the idea I started with, actually. But I could not find an affordable, fully submersible pressure sensor which looked like it could be trusted for a few years. Any pointers appreciated! (The relevant pressure range is 0.1 bar per meter of water level, plus 1 bar for the atmosphere of course. So 1.0 to 1.2 bar in my application, with a desired resolution of 1 to a couple of mbar.)

It might be even easier to stick a load cell under the whole tank and measure the weight of the thing.

Resonance might be interesting... if you can find a suitable transducer or speaker you might just be able to generate a sweep or chirp, then look for a notch in the drive current? That would save messing about with tx/rx.

It's an underground concrete cistern, so weighing it is unfortunately not an option. (It has been in the ground for 50 years and I don't feel like digging it up...)

The resonance measurement you describe is exactly what I had in mind. I did an off-the-cuff experiment today with a small 8 Ohm speaker and series resistor, sweep generator and oscilloscope, and various lengths of 40 mm PVC pipe with a blocked end. That did not look promising unfortunately; no significant resonance peak or dip.
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Acoustic level sensing in a pipe
« Reply #7 on: May 01, 2022, 06:05:52 pm »
fully submersible pressure sensor which looked like it could be trusted for a few years.

Could you measure the air pressure at the top of an air filled tube.

At a very rough guess the air pressure reading at +2m of water would be low by around 20%, because of the air compressing and allowing water into the bottom end of the tube.
.  That took much longer than I thought it would.
 
The following users thanked this post: RoGeorge

Offline ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6805
  • Country: de
Re: Acoustic level sensing in a pipe
« Reply #8 on: May 01, 2022, 06:40:28 pm »
Could you measure the air pressure at the top of an air filled tube.

Ah, I see -- thank you for the idea! It would require the tube's top end to be sealed perfectly and permanently vs. the sensor, right? But it would avoid the need for a submerged sensor, allowing for much more affordable options.

Vapor pressure in the tube might cause some deviations, but since the temperature in the cistern is reasonably stable, that is probably not a big issue. I will look into this option!
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7026
  • Country: pl
Re: Acoustic level sensing in a pipe
« Reply #9 on: May 01, 2022, 06:42:56 pm »
Could you measure the air pressure at the top of an air filled tube.
You could, but air will diffuse slowly through water out of the tube.
 

Online Marco

  • Super Contributor
  • ***
  • Posts: 6862
  • Country: nl
Re: Acoustic level sensing in a pipe
« Reply #10 on: May 01, 2022, 06:54:36 pm »
They usually do that with a high pressure air pump I think, so it just keeps bubbling.

The term you want to search for for industrial bottom of tank sealed pressure meter is hydrostatic level sensor.
 

Offline ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6805
  • Country: de
Re: Acoustic level sensing in a pipe
« Reply #11 on: May 01, 2022, 06:54:57 pm »
Could you measure the air pressure at the top of an air filled tube.
You could, but air will diffuse slowly through water out of the tube.

Good point, that's another potential error source. Maybe a drop of oil in the bottom end of the tube could help to avoid that?

I am aware of a related level sensor (with an open-ended tube running to the bottom of the tank) which avoids the leakage problem: At the remote end of the tube, provide a small air pump and a pressure sensor. When you activate the pump, the pressure will settle at an equilibrium when air starts to bubble out of the submered end of the tube, and that equilibrium pressure is what you measure.

Nice when you want to use the tube as the conduit to a dry environment where you place the pump and sensor, and where you read the value. One could even do this without electrical power, using a hand pump and mechanical manometer. But for my intended design, with a battery-powered remote sensor, the pump seems to add more complexity and current draw than I like.

Edit: Ah, Marco beat me to it regarding the pump option!
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3184
  • Country: us
Re: Acoustic level sensing in a pipe
« Reply #12 on: May 01, 2022, 07:31:28 pm »
Andreas Spiess on repurposing a blood pressure monitor:

 
The following users thanked this post: Ian.M

Offline ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6805
  • Country: de
Re: Acoustic level sensing in a pipe
« Reply #13 on: May 01, 2022, 07:57:45 pm »
Neat idea with the blood pressure monitor, even if it is only used for salvaging the pump. I am encouraged to try the "tube + pressure sensor" approach. If I can't get air leakage under control, I can always add such a cheap pump (and a larger battery...).
 

Offline ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6805
  • Country: de
Re: Acoustic level sensing in a pipe
« Reply #14 on: May 01, 2022, 08:13:48 pm »
The term you want to search for for industrial bottom of tank sealed pressure meter is hydrostatic level sensor.

Thank you, that brought up a few more brands. Submersible pressure sensor or submersible level sensor also gave relevant results.

The problem remains that these are not products you buy, but products where you "request a quotation"; very much addressing an industrial market. The few prices which I have seen are several hundreds of USD per sensor. Even the Chinese knock-offs on Alibaba end up at well above $100 including shipping, for uncertain quality.

I struggle to justify that cost for a "nice to have" personal project -- where IP6x enclosure, radio link, a display etc. would still come on top. From a purely financial perspective, I'd probably be better off using tap water to water my garden for the next decade...
 

Online Marco

  • Super Contributor
  • ***
  • Posts: 6862
  • Country: nl
Re: Acoustic level sensing in a pipe
« Reply #15 on: May 01, 2022, 09:25:51 pm »
On the original topic, a quick google found "Leak detection in pipes using acoustic pulse reflectometry". They used a pressure pulse from a normal speaker rather than ultrasonics.

https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.501.5098&rep=rep1&type=pdf
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4622
  • Country: dk
Re: Acoustic level sensing in a pipe
« Reply #16 on: May 01, 2022, 09:40:27 pm »
The term you want to search for for industrial bottom of tank sealed pressure meter is hydrostatic level sensor.

Thank you, that brought up a few more brands. Submersible pressure sensor or submersible level sensor also gave relevant results.

The problem remains that these are not products you buy, but products where you "request a quotation"; very much addressing an industrial market. The few prices which I have seen are several hundreds of USD per sensor. Even the Chinese knock-offs on Alibaba end up at well above $100 including shipping, for uncertain quality.

I struggle to justify that cost for a "nice to have" personal project -- where IP6x enclosure, radio link, a display etc. would still come on top. From a purely financial perspective, I'd probably be better off using tap water to water my garden for the next decade...


https://www.ebay.com/itm/333677645766 ?

 

Offline ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6805
  • Country: de
Re: Acoustic level sensing in a pipe
« Reply #17 on: May 02, 2022, 05:07:01 am »
Thanks! That particular seller does not ship to Germany, but I did find others on ebay at a similar price. Must have used the wrong search terms for ebay before?

That's one of the Chinese knock-offs I mentioned above, but at a better price around $50. I am tempted to give it a try -- although I am wondering whether I should expect to get more than a year of use out of it. If the reviews of low-cost "stainless steel submersible pumps" are anything to go by, I should not...
 

Offline robert.rozee

  • Frequent Contributor
  • **
  • Posts: 295
  • Country: nz
Re: Acoustic level sensing in a pipe
« Reply #18 on: May 02, 2022, 01:54:47 pm »
cut a length of 2" plastic downpipe to a length that is a little less than the depth of the water tank. glue an endcap to one end, then fill the downpipe with sand (or some other weighting material) such that the total weight is a little more than the volume of water that the pipe would displace when fully submerged. now glue another endcap to the other end, sealing the downpipe.

if you suspend this weighted pipe, upright, within your tank from a load cell weight sensor (for instance: https://www.ebay.com/itm/165132623369), the measured weight will vary linearly between the tank being empty and full. when empty, the measured weight will be the actual weight of the pipe. when full, the measured weight will be the residual of actual weight minus the weight of displaced water.

to be really clever, build the load cell and associated electronics into the top of the pipe, so that you just have a pipe with a hook at the top to suspend it from, with a cable coming out that carries power and data out.


cheers,
rob   :-)
« Last Edit: May 02, 2022, 02:02:26 pm by robert.rozee »
 
The following users thanked this post: RoGeorge

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6560
  • Country: ro
Re: Acoustic level sensing in a pipe
« Reply #19 on: May 02, 2022, 02:17:07 pm »
Weighting a rock suspended with a nylon (fishing) wire just above the bottom of the tank would do it, as well.  :)

Offline magic

  • Super Contributor
  • ***
  • Posts: 7026
  • Country: pl
Re: Acoustic level sensing in a pipe
« Reply #20 on: May 02, 2022, 07:43:04 pm »
The rock would have to be fairly tall to cover the whole range of possible water levels :P

But then it could work, I guess.
 

Offline ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6805
  • Country: de
Re: Acoustic level sensing in a pipe
« Reply #21 on: May 02, 2022, 07:45:09 pm »
if you suspend this weighted pipe, upright, within your tank from a load cell weight sensor (for instance: https://www.ebay.com/itm/165132623369), the measured weight will vary linearly between the tank being empty and full. when empty, the measured weight will be the actual weight of the pipe. when full, the measured weight will be the residual of actual weight minus the weight of displaced water.

Nice one, thank you!

I am quite pleasantly surprised how many ways there are to measure a liquid level -- measuring different physical properties of the liquid, or measuring in the same property (mass density) in quite different ways. And we have not even gotten into electrical properties (dielectric constant); or how about viscosity? Stir the water with a rotating vertical paddle which runs the full height of the tank, and measure the drag on the paddle. ;-)

Who would have thought that this is such a rewarding topic! Now all I need to do is make up my mind which way to actually implement...
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6560
  • Country: ro
Re: Acoustic level sensing in a pipe
« Reply #22 on: May 02, 2022, 08:24:17 pm »
The rock would have to be fairly tall to cover the whole range of possible water levels :P

But then it could work, I guess.

My bad, not a rock.  I was having in mind something like in the video, that tends to float at a certain pressure (depth).  Has to be heavier so it will tend to float lower than the total depth of the tank, and suspended near the bottom:


Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5402
  • Country: us
Re: Acoustic level sensing in a pipe
« Reply #23 on: May 03, 2022, 12:23:59 am »
Another very simple idea is as old as water tanks.  Put a float on a rope in the tank.  At the top of the tank put a pulley and then put a weight on the end of the rope so it hangs down the outside.  Water level is read from an inverted scale on the outside of the tank, with full at the bottom and empty at the top.

The classic version involves lots of fiddly details if such things as wanting the tank to be fully enclosed etcetera are in the requirement set.  But by having two vertical pipes inside the tank all the issues are avoided.  Pipe one is open to the tank at the bottom, pipe two is not.  Both are open at the top.  Pipe two holds the weight, pipe one the float.  And a position encoder on the pulley reads the tank level.

This cat can be skinned in many ways.  For this project it is all really very dependent on what the OP finds interesting.
 

Offline exmadscientist

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: us
  • Technically A Professional
Re: Acoustic level sensing in a pipe
« Reply #24 on: May 03, 2022, 04:22:50 am »
not sure whether the returning signal will be strong enough in a tube with small diameter/length ratio?
We did this ~12 years ago with commercial ultrasonic sensors and a strict no-fluid-contact rule. Just sticking a pipe into the tank worked absolutely perfectly. The pipe length was somewhere around 4m and pipe diameter was, I think, 1-1/2 in (~40mm). That ratio gave no trouble, the whole thing worked like a charm. It wasn't quite as accurate as we'd have liked (I think we got 1mm accuracy out of it, and we wanted sub-mm?), and it turned out to be super sensitive to the gas composition in the pipe (this is not likely to be a problem for most people...), but it was wonderfully reliable.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf