Maker Pro
Maker Pro

Measure distance to water surface

Status
Not open for further replies.
I'm looking for a sensor that will measure the distance to a water surface. Some approximate specifications are:
  1. Operating range: 0 to 2 metres
  2. Update interval: 0.1 sec (10 per second)
  3. Accuracy: 1cm
Naturally it needs to be water resistant or able to be mounted in a water proof housing, and operate continuously for up to 3 or 4 hours.

It will need to connect to a programable controller that will process the measurements and control an actuator depending on the distance to the water surface. I'll need to program the controller as the movements are not a simple linear or curve relationship to the distance, it will need to be able to handle velocity and acceleration as well as straight displacement as it needs to have dampening effects and filter out noise.

Can someone advise of any existing hardware that fits the bill? And a suitable programmable controller that it can connect to?
 
Arduino would be well within capability.
Many different sensor arrangements such as sonic, slotted IR via codewheel, rotary encoder, but water resistant or waterproof throw up 2 different requirements initially and a host of mechanical possibilities.

Then you have velocity and acceleration to add so perhaps the latter of the sensors.(gives something mechanical to connect to)

movements are not a simple linear or curve relationship to the distance
As far as I can make out, it would need to be one or the other but one would allow for that in the programming.

Need for interfacing whatever the "actuator" might be.

Last but not least, how are you at programming?
Given the need to ask initially suggests, not much.
Even for a well experienced programmer, this is a rather large requirement overall and suggest it needs to be broken down into realistic pieces and solve each one at a time.

Perhaps keep in mind a simplified version of what it is you are trying to do, whatever that is.
I doubt there is anything "off-the-shelf".
 
I can program. If implementing a particular algorithm becomes an issue I'm sure I can find resources to help. A simple linear map will do to start with. I just want to be able to make it more complex later if necessary.

My biggest issue is getting suitable components to start with, such as a device to accurately and reliably measure to a rapidly changing water surface at the required interval and write to an interface. Then to have a device that accepts the input and processes it to tell an actuator what to do, basically move up or down.

The measuring device is step one. For example, there are units like the Arduino HC-SR04 Ultrasonic Sensor, but I have no idea if it can sense a water surface accurately.

https://randomnerdtutorials.com/complete-guide-for-ultrasonic-sensor-hc-sr04/
 
Last edited:
There are many monitors available for measuring tank liquid levels - oil, water, sewage - and they commonly use ultra sonic (non-contact) methods of measurement. As such I suggest the standard Ultrasonic modules used with Arduino and via the I2C interface providing you can make the necessary protection for the transducers.

If you Google remote liquid level monitoring you'll find many tank systems that may fit your bill without the complication of construction/programming.

There are, of course, other methods to measure liquid level (floats) including PRESSURE if the liquid is in a sealed container.
 

hevans1944

Hop - AC8NS
Here is an application note on the HC-SR04 sensor that may be useful in calculating your measurement error. Note that this sensor performs no temperature correction for the velocity of sound. The width of the return echo is a function of distance and is the parameter your microprocessor interface must measure. No idea (and no specification) on how much jitter occurs from the end of the 8 cycles of transmission burst to the beginning of the return echo pulse that terminates the echo output, but this would affect both resolution and accuracy.

The return echo pulse is not provided. Only a crystal-controlled timer output is provided, which is started after the last 8 cycles of transmission and terminated when the echo is received. It is the length of this timer output that you measure, but who knows when that output is terminated, i.e., how many (or how few) cycles of the transmission burst must be received to stop the timer? This, too, affects accuracy and resolution. Still, its a fine piece of electronics integration if you can tolerate its rather loose specifications.

You can "roll your own" by purchasing the ultrasonic transducers separately and building your own echo-based ranging system. This would allow you to design in some sophisticated receiver circuitry that would use multiple received echos to improve the range accuracy.

Some questions you should ask before attempting to re-invent this particular wheel: Why does the transmitter emit eight (and only eight) cycles of ultrasonic sound? Is this related to the mechanical self-resonance of the piezo-electric ultrasonic transducers? How does the transmitter ensure that only eight cycles are emitted per trigger input pulse? Does this even matter? Does the receiver have a count threshold on the number of cycles it must detect before terminating the echo output pulse? What happens if no echo is detected, either because the target surface is too far away or the return echo signal is somehow attenuated below the receiver detection threshold?

Presumably the designers of the HC-SR04 module have considered and answered these very same questions and now make their wisdom and product available to you for only a dollar or so. I would take advantage of that, if possible, unless you just want to learn how to design and build ultrasonic ranging sensors. We've come a long way since Polaroid put these doobies on their instant-photo snapshot cameras, and later made the circuitry available for public use and purchase. The HC-SR04 is somewhat simplified in that it uses two ultrasonic transducers, one for transmit and one for receive, whereas the original Polaroid camera managed to get by with just one, albeit much larger, transducer.
 

Fish4Fun

So long, and Thanks for all the Fish!
Hey WWild!

I have wrestled this problem many times over the years .... with varying degrees of success. One method that works fairly well for a simple cistern type scenario is a pair of "Flow Meters" one for water in and one for water out with a simple "Float Switch" to prevent over filling. These are cheap and readily available:

https://www.ebay.com/itm/NEW-G3-4-W...h=item232dcc3d9b:g:UGgAAMXQfvlSdkEu:rk:1:pf:0

Perhaps the most accurate "level indicator" I have played with uses one of these:

https://www.ebay.com/itm/0-40kPa-At...h=item1c99b4398f:g:15cAAOSwcUBYSNSp:rk:2:pf:0

I purchased some of the version with the built in 24-bit ADC, but I haven't tested them yet ....

https://www.ebay.com/itm/2-Digital-...d-Water-Level-Controller-3-3-5V-/401433500416

I did some preliminary testing with the analog version (linked first), using my bench VOM measuring water in a 500ml graduated cylinder ... I don't remember the actual numbers, but the VOM reflected a response to single drops of water .... and 10 drops caused a very consistent change in voltage.

In theory 40kpa translates to 5.8psi or 160 inches of water, but the pressure is relative to Atmospheric Pressure which can vary from as low as 87kPa to as high as 107kPa with a standard value assignment of 101.325kPa. While it is unlikely any fixed location would experience either extreme, atmospheric pressure certainly changes from day to day and could lead to inaccurate readings unless taken into account ...

Other methods of note include:

Creating a capacitor from a pair of insulated metallic tubes or plates separated such that as the tank fills the space between the tubes/plates is filled with water thus changing the capacitance in a repeatable way ... if this capacitor is used in an RC oscillator then the output frequency becomes a repeatable function of water depth.

A simple encoder can be rigged to a float to give highly accurate, absolute level readings.

If you are measuring volatile or corrosive liquids obviously you need to take pertinent precautions.

If I could give one bit of advice it would be: "Simple is generally more reliable than complicated." I have several water cisterns that need to remain relatively full without needlessly cycling the "fill" pump ... what I have found works best is a pair of float switches ~ 12 inches apart in depth ... the switches connect to logic that turns the "fill pump" on only when the water drops below the bottom switch, once the pump is on, it runs until the water reaches the top switch then turns off until the water again drops below the bottom switch. In my 500 gallon cistern the top switch is located ~450 gallons and the bottom switch is ~300 gallons so the pump runs for at least 30 minutes before cycling off.

In a different cistern I use a pair of optical sensors and a single float that moves a rod with a pair of "flags" ... In this case the distance between the switches is only ~6 inches, but this is a larger cistern and 6 inches is around 300 gallons.

Good Luck!

Fish

Fish
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Aaaagh @Fish4Fun... I also thought of measuring the depth of the water via a pressure sensor and using that to calculate the position of the surface. I'm glad you provided a link to a pressure transducer.
 
I was in the same boat of requirement and to my surprise there are quite a few new sensors in town. This one has 2 transducers instead of 1, therefore has less minimum detection distance as compared to JSN SR04T. It is also completely sealed and waterproof.

https://www.ebay.com/itm/253978673298

Before finalizing on this I had bought another one which was a waterproof modified version of HC-SR04 from here

https://www.ebay.com/itm/254113850508

The 1st one is much more rugged and waterproof as compared to the latter one.
 
There are many ways like using a float sensor to determine the water level, or using probes to detect peak and low level in the tank. it is simple to use ultrasonic sensor which gives the depth, by determining the tank depth we can set the maximum and minimum level
5556d6f21d3e1.jpg
 

hevans1944

Hop - AC8NS
Hmmm. @Elainedan0228, how does your "monkey see, monkey do" picture add anything to this discussion?

BTW, it appears that the original poster (OP) was a "drive by" who has considered their "problem" solved and has driven on to somewhere else as of October 20, 2018, the same day as their original post, as well as the day they joined this forum. It's not that I didn't enjoy reading the interesting comments and links that other members of this forum posted, but sometimes I wonder why do we even bother if there is no dialog established with the original poster?

Distance measurement is a fascinating subject whatever the application. I first encountered the need for it while learning to maintain a radar-controlled 20mm Gatling gun. Range-to-target is an important parameter that needs to be accurately measured and used in calculating solutions to the ballistic equation in "real time" if the fire control system is expected to perform adequately. It's hard enough to do this shooting backwards out of the tail of an airplane, a relatively stable platform, but I cringe at the thought of having to do it from a ship-at-sea, at close range of only a few hundred meters, with one or more missiles bearing down at supersonic speeds. Somehow the Navy does manage to do it.
 
Status
Not open for further replies.
Top