A reliable distance sensor - oil tank?

I had a commercial sensor on my domestic central heating oil tank, after about five years it failed. Replacement was twice the cost and to add insult to injury the supplier also charged a monthly fee. Thought I can do better than this. Now been playing with this on and off for over a year (and getting fed up). Distance sensor on tank driven by a local nodemcu/ESP8266 (solar powered) ftping measurements to a second nodemcu in the house that serves up a webpage. It all works, it even sends me emails.

I started with an HC-SR04 ultrasonic sensor. This was okay, reasonable repeatability and accuracy but I ditched it because it didn't fit mechanically - too large for the existing hole in the top of the tank and I didn't want to make it larger. I switched to a JSN-SR04T. What a misbegotten heap of cr*p this device is. Two arrived DOA, one failed in testing and I finally got the fourth working and installed. Repeatability is poor and I have to take a lot of readings to try and compensate. Search the web and you will find lots of people complaining about this device. To try and improve consistency I was also temperature compensating (I'm in the UK no huge temperature extremes). Installed to tank and it was okayish for 3-4 weeks and then started giving erratic readings, we are talking +/- 100 litres between readings (every 4 hours).

Having had enough of acoustic sensors I have now switched to the VL53LOX optical sensor. On the bench excellent repeatability and accuracy (standard deviation typically < 3mm). On the tank it was okay for less than a week before it started giving erroneous readings, e.g.

08 Aug 23, 10:15
Successful readings = 19
Total readings = 19
Failed readings = 0
Average distance = 227 mm
Standard deviation = 119.41 mm
0 344 mm
1 400 mm
2 443 mm
3 476 mm
4 423 mm
5 125 mm
6 140 mm
7 153 mm
8 165 mm
9 158 mm
10 159 mm
11 162 mm
12 165 mm
13 166 mm
14 166 mm
15 164 mm
16 165 mm
17 170 mm
18 175 mm

This is a telemetry file it sends to my NAS when it takes a reading. It should be reading around 600mm!

When I have checked the sensor there has been no obvious sign of condensation, all I can think is that the atmosphere in the tank is killing the sensor, but that quickly??

Anybody got any bright ideas for alternative sensors, the tank is about 1200mm high and 1200mm diam (circular), measurement range 100-1000mm?

confirmed - I had the very same experience

I add OK results for an underground water tank with a A02YYUW. It's waterproof and an OK repeatability I'm taking 5 readings, throwing away to max and min and averaging the 3 others and precision is OK

it has two ready made holes to secure it in place, which was a nice idea

but it might be too large for your tank though if you found the HC-SR04 too large.

I don't know if it will work for you, but I had this same type of problem with a sensor installed in a water tank.

The solution I used needs some knowledge in electronics.

I used an automotive reverse gear sensor.
I put one of the sensors in the water tank and left the others off.
I connected the output of the module to an ESP8266 to analyze the distance.

Something like this:
" https://www.amazon.com/Zone-Tech-Reverse-Backup-System/dp/B0087QI3GM?th=1

Thanks for the rapid responses. Sadly the A02YYUW is too large. Similar dimensions to HC-SR04. Image of top of tank:


To get an HC-SR04 to fit I had to saw the corners off the module. Did try fitting it in the JB at the top but reflections from the plastic tube into the tank meant it didn't work. The sensor has to be mounted flush to the bottom.

The solution I used needs some knowledge in electronics.

Not an issue, got a degree in electronic/electrical engineering even if a long time ago :slightly_smiling_face:

Auto reversing kit - What makes me suspicious is that the sensor element looks identical to a JSN-SR04T, but willing to look seriously. How did you interface to the sensor electronics, i.e. what outputs did you pick up and what format? Presumably 12V supply? I've got solar panel > 18650 home made UPS > 5V supply to the ESP8266.

For completeness, the web page it serves up to illustrate the problems:


Switched to optical sensor 2 Aug, calibrated it and then...

If I don't find a solution, cathartic to talk to others who understand the problem.

These sensors are for 12V.

This is an interesting design.
Looks like it uses a 45 degree reflector

1 Like

Why oh why can't all the manufacturers do this? It's so obvious and adds basically nothing to the price!!!

It is just insane to me that you can buy that entire sensor package for under $20!

I have also used this model from Maxbotix with excellent results.
"MB7380 HRXL-MaxSonar-WRT – MaxBotix

Reach up to 450 cm.

image

Can't get that model in the UK, but have found other maxbotix waterproof sensors for around £40. Might give it a try. Thanks.

I needed a water level sensor. Most sensors I researched seemed likely to eventually fail. I built the device in the picture to obtain reliable readings.
It uses a floating magnet in a copper tube. The tube is attached vertically to the side of the tank. Note the tube is slightly square to keep the magnets pole orientated to one side. I used hall effect devices attached along its length and a Mega because of the number of inputs required. The device is super reliable and I transmit via i2c to a remote gauge.
Just an idea - it worked for me.

Thank you for that and it's got me thinking. I could put the hall effect devices in a sealed tube so they are not immersed in kerosene with a magnet on a floating ring on the outside. Switch from an ESP8266 to an ESP32 for the no of inputs and still have wifi.

Just be careful with anything electric in fuel tank even if you think its waterproof.

Murphy laws says shit will happen and Your insurance will be quick to say it’s your fault if something happens…

I've had really good luck with the JSN=SR04T. I've had one monitoring my potable water supply cistern for well over 5 years and no issues. Initially I had some issues, Two different versions of the JSN-SR04T and faraday shielding due to my board layout. I can't recall the exact specifics on the two versions but I had to add a pullup on the echo pin to get it to work. Similar to the OP post its is an Arduino Promini to do the timing. Communicating to a ESP07 via I2C. The ESP serves out a simple web page with the stats. Switching on board for fill pumps.





Was posting on another issue, so I thought I would provide an update.

I switched from acoustic to optical sensing using VLOX53 sensor. Looked promising but initial sensor lasted about 24 hours. Tried a second time, but this time with glass between the sensor and tank (a cover slip that you would normally use on a microscope slide). This lasted about 48 hours. I think the atmosphere in the oil tank is killing both the acoustic (JSN-SR04T) and optical sensors.

Now trying the "old fashioned" way - a float on an arm connected to a potentiometer (I'm using wire wound). I've switched from an ESP8266 to ESP32. Project in progress.

For harsh environments consider a "bubbler". Its basically a tube to the bottom of the tank. You force air down the tube. Reading the air pressure from a sensor tee'd into the line. The higher the air pressure the higher the tank level. Nice thing was the electronics & sensor can be a great distance from the tank. Best if with a lower viscosity oil.
I've tested this on deep water wells and good if the level change is relatively slow.
Also tried a simpler solution with a closed end tube and pressure reads. That was on a septic tank. Trickier to recalibrate but promising. Needed a rather large ID tube (2"). Its accuracy a bit limited but viable replacement for floats.

You could use a lidar rangefinder sensor. Put a polyethylene float in the tank to bounce it off of.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.