Measuring a 2000 liter Diesel Tank with Ultrasonic sensor

I am trying to monitor my 2000 liter diesel tank with an ultrasound sensor. So far I tried a dyp-me007y, a SR04T-2.0 and a hy-srf05. All of them give me good consistent readings on the bench, but when installed in the tank they give me random measurements with are too low.
For example distance to oil level is measured is about 137 cm, sensor is reading 105 cm.
What can cause these errors, distance to the tank walls is about 30 cm in 3 sides, 1 meter to the 4th.

What did you bounce the beam off on the bench?

What can cause these errors

Perhaps diesel's not 100% reflective to ultrasound.

I used a concrete ceiling and it was very accurate then.
There are commercial ultrasound systems for diesel and oil tanks so it should work?
I have a ventilated tank so there should not be too many fumes

There are commercial ultrasound systems for diesel and oil tanks so it should work?

They might differ in some way. Perhaps a different frequency, or the time of flight is adjusted internally to allow for a sort of lag in the return, or its calibrated internally with a lookup table that gives the right distance from a time rather than a single formula.

It would be interesting if you could measure the distances from empty to full next time an empty tank is re-filled, and see if you can establish a relationship that you can adjust for.

Look at this!

Of Course this is very accurate and works on a high professional Level, bt would solve all your Problems.
There are also cheaper Solutions available but the question is how accurate you want to meassure! The System in the link meassures approx +/- 0,02mm

That looks like overkill in my case. A resolution of several mm is absolutely fine. Could I use a pressure sensor instead?

Could I use a pressure sensor instead?

You would need to dig around the suppliers to answer that, checking it's got the sensitivity and range you need and that it will be ok in a tank of oil.

If there is any tiny ridge or so on the wall of the tank (a weld may be enough) this can cause enough reflections for the sensor to read.
The distance you measure is shorter than the distance you expect, so you probably get an echo from something before you get the echo from the fuel surface. The cone has an angle of about 30 degrees, so some 60 cm below the sensor your sound signal reaches the wall of the tank. Something on the side of the tank at about 99 cm below the sensor would give 104 cm distance.

Then you are right, that are exactly the measurements I get... The tank is plastic so there are no walls, but then I get a reading of the walls... The last sensor I bought specifically stated an angle of 15 degrees, is there no ultrasonic sensor with a more narrow beam?

Or could I use something like this?

Just redid the calculations (that 30° should be the complete cone so fanning out 15° to either side): at a 15° angle you'd hit the wall at 120 cm below the sensor, so that's still quite consistent, that 15° is not that exact either. Apparently you get reflections from the plastic surface, I wouldn't expect that from a smooth wall. I have no problem with stainless steel walls and the HC-SR04 sensor placed really close to it. A small plastic tank also worked fine.

There are no narrower beams for 40 kHz sound, that's dictated by wave physics. You'd need to use a laser beam that you reflect off the surface, then you get a narrower beam.

When the tank level gets lower, does the reading change? How about when the tank level is above that point, is your reading correct?

Another thing, mostly a wild thought: what may cause the reflection is that at this point all the waves hit three of the walls at roughly the same level. That would cause a change in impedance and reflections. The end of a pipe can also cause reflections for the same reason, this is more like the beginning of a pipe (it's the point that the walls of the tank start to affect the sound waves). You placed the sensor pretty much dead centre between two walls, and the same distance from a third. Move it to a place where the distance to the different walls is different, see what happens.

I made some waveguards with paper tubes around the sender and receiver and now I am able to measure a correct 135 cm distance. I am using a Nodemcu Module and when I power it through my laptop`s usb port it measures correctly, when I power it from a usb wall plug it goes back to 105? I really dont understand this.

That's odd - unless you moved the module in the process just so you're in and out of the echo.

Can't you move the module away from dead centre? If my idea is correct that should \do the trick, without wave guards. Those anyway don't do much as the moment the wave leaves the tubes you first of all can get that end of tube echo, secondly the waves start to fan out in that 30 degree cone shape.

I have to stick with the existing opening of the tank, i put the sensor in the screw cap.
Whatever happened, it seems to work now, I am happy :wink: