How to not measure the water level with an ultrasonic sensor

Put an ultrasonic sensor at the end of a 75mm pipe, stick the pipe down a water tank and measure the distance. It seemed like such a good idea. Get an exact distance reading and calculate the water depth.

Testing on dry land gave promising results. The sensor would deliver perfect distance readings up to at least 2m when fitted to the end of a 75 mm pipe. Testing in an actual tank worked equally well. For a while.

Then, suddenly, a stray reading, totally off the scale, and then back to normal. This wouldn’t really have been a problem if it wasn’t for the GSM module, sending me a text message every time it happened, but it was an easy fix to introduce a threshold, requiring a number of readings saying the same thing to trigger the text message telling me something was wrong.

That worked, but not for long, until the messages started coming in. Again the sensor was reporting strange values, completely off the scale, but for longer periods of time than before.

Visual inspection gave no clues. Mechanically everything was all right where the sensor sitting just as it should and the water level was fine, within limits.

The sensor had to go. It was deactivated and later replaced by a differential pressure sensor that has been successfully used before and still works after several months of use. The only downside is that it varies slightly with the weather, but it does so consistently, so that readings can be trusted to stay within certain limits.

I know for a fact that ultrasonic sensors are used for exactly this application industrially, so there’s no doubt that it can be done, but I don’t recommend trying it with the kind of naked sensor that you can buy cheaply at the electronics store. If the sensor is encapsulated in some suitable material that lets the ultrasonic waves through it should be a totally workable solution. Feel free to experiement.

2 thoughts on “How to not measure the water level with an ultrasonic sensor”

  1. I would have used a Maxbotix ultrasonic sensor that is designed for exactly this purpose ! I need to solve the same problem and have a Maxbotix ready to go. Now just need the motivation !

  2. Its been over a year, so you may no longer be interested. However I have been experimenting in exactly the same way, using a standard LV Maxbotix sensor pointing down a 75 mm pipe. This is setup on an outside test rig. The sensor is mounted inside the pipe at the top and there is (temporarily) a plastic bag over the end held with bungy cord, which in theory keeps it dry.

    I found that it would operate correctly for a day or two and then intermittently there would be long period of under range measurements.

    So I changed the mounting to be able to adjust the sensor direction down the pipe. Once lined up properly, it worked fine for about a 8 days. Then during a prolonged period of very heavy rain (still going) it has started misbehaving again.

    On examination it seems that some damp has penetrated. After brief drying (probably insufficient) it returned to good operation, although has just reverted again to short readings with more rain.

    So I suspect (but haven’t proven yet) that the problem is damp related. Conclusion I guess is either damp has to be thoroughly excluded (which might be difficult with condensation) or a waterproof sensor is needed. The latter is undoubtedly going to be more reliable, but in NZ the Outdoor Maxbotix sensors are 3 times the price!

    My own tank depth wireless system, which uses a reasonably powerful micro-controller, it probably doesn’t require the sophistication of the Maxbotix. However the advantage of Maxsonar over other modules is the ability to operate on very low voltages from 2.5V, whereas most other module require at least a 5V supply, which isn’t idea when you are using a 3.7V – 4.2V Lithium Ion battery to power the unit.

    Cheers Ron, Wellington NZ

Comments are closed.