WindedHero
Posts: 2
Joined: Thu Jan 30, 2020 4:13 pm

Distance Sensors

Thu Jan 30, 2020 4:42 pm

I am looking to build a device that monitors the level of liquid in an upright cylindrical container. Due to the nature of the liquid and the environment, IR is not preferred, as steam is likely and the rising steam may interfere with temperature based readings.
This container is approximately 25 ft in height.

I think Raspberry Pi might be a good fit for this project, but I have no idea where to start as far as sensors and coding are concerned.
I found this but it mentions the HC-SR04 which only has a range of 1 inch to 10 feet (2 cm to 3 m). I need to be able to measure at least to 20ft.
Last edited by WindedHero on Thu Jan 30, 2020 8:33 pm, edited 2 times in total.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27425
Joined: Sat Jul 30, 2011 7:41 pm

Re: Distance Sensors

Thu Jan 30, 2020 5:14 pm

Ultrasonic? Like an oil tank sensor or similar - they can do over 100cm IIRC.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

PhatFil
Posts: 1705
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Distance Sensors

Thu Jan 30, 2020 5:48 pm

WindedHero wrote:
Thu Jan 30, 2020 4:42 pm
I am looking to build a device that monitors the level of liquid in an upright cylindrical container. Due to the nature of the liquid and the environment, IR is not preferred, as steam is likely and the rising steam may interfere with temperature based readings.
This container is approximately 25 ft in height.

I think Raspberry Pi might be a good fit for this project, but I have no idea where to start as far as sensors and coding are concerned.
I found this but it mentions the HC-SR04 which only has a maximum distance of 200cm. I need to be able to measure at least to 610cm.
what range of distances do you want to monitor and whats the level of accuracy or how granular can the readings be and remain useful?

steam? what sort of temperatures and levels of steam density do you expect? is this a hostile environment? whats the liquid?

If breaking the skin of the container for inserting sensors is a NoNo then a sensor 'dip stick' can be made from cheap pvc pipeing capped at the 'bottom' with sensors and wires inside the tube..

nmrider66
Posts: 45
Joined: Fri Feb 10, 2017 8:31 pm

Re: Distance Sensors

Thu Jan 30, 2020 5:57 pm

Depth of a liquid can be calculated if you know the size of the container and the pressure at the bottom of the container.

WindedHero
Posts: 2
Joined: Thu Jan 30, 2020 4:13 pm

Re: Distance Sensors

Thu Jan 30, 2020 8:24 pm

PhatFil wrote:
Thu Jan 30, 2020 5:48 pm
what range of distances do you want to monitor and whats the level of accuracy or how granular can the readings be and remain useful?
I would be happy with any reasonable accuracy less than 1m. Distances between 1-8m. Ideally the more accurate the better. Best case (read:accuracy), I would use this to measure full/empty levels to maintain a record of incoming/outgoing volume. Worst case, a max accuracy of less than 3m would provide for an alert/light if the cylinder is nearing maximum capacity. Both uses would be a practical improvement for our current method which isn't measured, is eyeballed and requires two people with walkie-talkies.
PhatFil wrote:
Thu Jan 30, 2020 5:48 pm
steam? what sort of temperatures and levels of steam density do you expect? is this a hostile environment? whats the liquid?
Factory conditions. We process solids, water, and impurities out of waste vegetable oil (grease). It is heated with live steam to temperatures up to 200F where it is pumped into cooling tanks. I am looking to monitor these cooling tanks for the distance between the sensor and the surface of the oil. The earlier stages in filling the cylinder are much steamier than at the end, but it is not consistently steamy. I wouldn't expect the average ambient temperature to go over 100F.
PhatFil wrote:
Thu Jan 30, 2020 5:48 pm
If breaking the skin of the container for inserting sensors is a NoNo then a sensor 'dip stick' can be made from cheap pvc pipeing capped at the 'bottom' with sensors and wires inside the tube..
The upright cylinder is open-ended. I wouldn't necessarily "insert" sensors into the cylinder due to the fact that the oil tends to build up and make a "skin" on things.
nmrider66 wrote:
Thu Jan 30, 2020 5:57 pm
Depth of a liquid can be calculated if you know the size of the container and the pressure at the bottom of the container.
I don't need the depth of the liquid, so much as the available free space of the cylinder. Due to the varying consistencies of the liquid, I'm not sure pressure would be a viable method of acquiring these measurements. The consistency from bottom to top goes from solids, to water, to oil, to cream, to foam, to air.

PhatFil
Posts: 1705
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Distance Sensors

Thu Jan 30, 2020 9:05 pm

Yikes Very Hostile Conditions... I would suggest you need professional advice for that so many factors a diy enthusiast cant be aware of..

Heater
Posts: 16846
Joined: Tue Jul 17, 2012 3:02 pm

Re: Distance Sensors

Thu Jan 30, 2020 9:25 pm

Good grief.

High temperatures. Unknown properties of the content. ....

You have a major research in measurement project there.

I have no doubt a Raspberry Pi can handle the computational requirements. As long as you keep it away from liquids, steam, corrosion etc.

Making the measurement itself, accurately and reliably, is a whole other problem.
Memory in C++ is a leaky abstraction .

User avatar
jbeale
Posts: 3716
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Distance Sensors

Thu Jan 30, 2020 10:45 pm

"The consistency from bottom to top goes from solids, to water, to oil, to cream, to foam, to air."

That is an interesting (aka "difficult") measurement problem, because from this description the "surface" of the stuff in the container is not well defined. You would get a nice clean echo from sound waves hitting a sharp discontinuity in density like air->water or air->solid. However, what you describe sounds like a very gradual change in density as you go down, from air to lighter foam to denser foam and so forth. In that situation, there is no sharp density transition and I would expect hardly any sound echo at all. "Gradually denser foam" is actually how the walls of anechoic chambers are made. The temperature, humidity, and condensing / solidifying oil in the physical environment is an added complication.

If you've got steam and condensing vapor I assume visibility may be poor and optical methods (eg. machine vision) will not be reliable.
My first thought would be some kind of mechanical float, if there is any float + mechanism that is compatible with this situation.
My second thought is that a pressure sensor should generally work, giving a reading proportional to depth x material density, so long as the material is not completely solid.
But as other people are saying, this doesn't sound like a casual project.

JohnsUPS
Posts: 188
Joined: Fri Jul 06, 2018 2:13 am
Location: USA

Re: Distance Sensors

Thu Jan 30, 2020 11:48 pm

This surely is a difficult measurement problem, given the various densities of the materials and temperature. Because it was said that absolute accuracy isn't needed, I thought I'd throw this out there for the OP's consideration:
How viable would measuring the outside temperature gradient of the tank be? Either multiple sensors down the side of the tank, or perhaps an infrared solution (looking at the tank from the outside)?

Return to “General discussion”