Diesel Tank Volume Indicator

I have taken this problem of making an automatic level indicator for a 15000L tank. The tank cannot be made empty and is being used at all times.

It is a diesel tank so density is a bit lower than water. The exact internal dimensions of the tank are unknown. 15000L is written on the tank which is from an unreliable source,

The tank is a horizontal cylinder with spherical caps on both sides (not a perfect cylinder).

Whether there needs to be a flow meter (at least) but still, a level indicator would be much better. Normally flow meters yield low accuracy on low flow rates (that is what I was told).

There are no dip sticks or vertical scale to measure diesel against. To make those things, one needs to calibrate and develop a scale (which is currently not available).

i did t he volumetric analysis of the tank. My idea is to use ultrasonic against to find the empty height of the tank so with the filled height, volume of diesel that is present, can be approximated.

The accuracy needs to be + - 50 litres or something, it is not fixed. Some error is acceptable but not some 300 400 Litres.

All ideas are welcomed.

Thank you.

I think you might be on the right track with the ultrasonic as long as the height is not to great. Although I wonder about the sensors survivability in such an aromatic environment.

Here's a link that might give some other ideas.
A Dozen Ways to Measure Fluid Level and How They Work

The sensor that I am using has a maximum range of 400 cm. The range I need it for is below 300 cm.

I just am having trouble calculating the volume of the tank as it has two spherical caps and I am also a bit unsure at this stage concerning the density of diesel. That ultrasonics might not reflect back from a low dense liquid.

Any help though would be appreciated.

Abdul_Moeez:
...
I just am having trouble calculating the volume of the tank as it has two spherical caps and I am also a bit unsure at this stage concerning the density of diesel. That ultrasonics might not reflect back from a low dense liquid.

Any help though would be appreciated.

Here is a link to a very good webpage calculating the volume of the cylindrical part of the tank.

That just leaves the end caps. I expect that the end caps are actually hemispheres. Since there are two of them you need a formula for the volume of a partially filled sphere.

This website will let you calculate the volume of fuel in the end caps;

I don't see why the ultrasonics would not work with diesel. You could probably do a test using a PVC pipe filled with fuel.

I agree with @ardly the density is not an issue as the ultrasonic works off of the surface reflection. As I said before I would be much more concerned about the harsh environment.

No matter how accurate the calculations, without testing and calibration you are just guessing. It is a necessary part of the development cycle. You will not be able to avoid it if you want to have any idea of it's accuracy.

Printed Circuit Boards are glass fibre reinforced epoxy resin. The diesel will not affect the glass fibre and, accroding to this site, it will also not affect the resin;

However diesel will act as a solvent for rubber and plastics and may speed the corrosion of some metals.

Like @Hutkikz I would be concerned about the effect of the diesel fumes on electronics, particularly the ultrasonic transponder and coatings on any discrete components. Regular inspections will show if this is a problem or not.

@Hutkiz is also correct that you will need to perform some tests and calibrations to prove your volume calculations and software. The obvious thing to do is to wait until the tank level is low then use a dipstick to measure the depth as known volumes of fuel are added to the tank.

I would be a bit concerned with the environment, diesel is safer than gas, but still

I looked at using ultrasonic for a project and the level of the liquid close to the sensor seems to me was an issue.

Currently thinking about a bubbler, very small air compressor/pump - not much pressure and limit the air volume with a restrictor. Timer circuit turns the pump on and lets the pump force the water out of the tube then take the level measurement and record it. Maybe in your case a push button to take a measurement, should take only a few seconds to pump the tube empty of liquid and do the calculations.

The pressure of diesel per foot of depth should be easy to find or calculate relative to water.

A bubbler might let you move your electronics away from the fumes if there is a buildup in the area, don't remember if the tank is above or below ground

Sorry for the late post out of sequence, saved the draft and thought I lost my work and forgot one point I was trying to make last night

ardly:
This website will let you calculate the volume of fuel in the end caps;
http://www.ambrsoft.com/TrigoCalc/Sphere/Cap/SphereCap.htm#cap

I don't see why the ultrasonics would not work with diesel. You could probably do a test using a PVC pipe filled with fuel.

Thank you so much for that link. I still am unsure whether I can get that big R over there. and the angles, its an actual 15kL tank. I can get on top of it but I guess I would need to draw some geometrical lines on it?

or am I missing something? is there another way to find all that?

The things I know is the cap height and cape base radius. Other stuff through geometry?

Hutkikz:
I agree with @ardly the density is not an issue as the ultrasonic works off of the surface reflection. As I said before I would be much more concerned about the harsh environment.

No matter how accurate the calculations, without testing and calibration you are just guessing. It is a necessary part of the development cycle. You will not be able to avoid it if you want to have any idea of it's accuracy.

It would be more of a portable meter. You go over there you test you bring it back, yes diesel has fumes but I inquired about that and I guess the meter I il make will only have the ultrasonic exposed. Will try to save it as much as I can but that is a secondary issue. As for accuracy, something is better than nothing at this stage. + - 50 L should be okay.

ardly:
Printed Circuit Boards are glass fibre reinforced epoxy resin. The diesel will not affect the glass fibre and, accroding to this site, it will also not affect the resin;
Epoxy - Chemical Resistance

However diesel will act as a solvent for rubber and plastics and may speed the corrosion of some metals.

Like @Hutkikz I would be concerned about the effect of the diesel fumes on electronics, particularly the ultrasonic transponder and coatings on any discrete components. Regular inspections will show if this is a problem or not.

@Hutkiz is also correct that you will need to perform some tests and calibrations to prove your volume calculations and software. The obvious thing to do is to wait until the tank level is low then use a dipstick to measure the depth as known volumes of fuel are added to the tank.

I il check if wood is fine above diesel. As for rest, if ultrasonic sensors are okay, rest should be fine.

As for that last thing you wrote, that is the problem.

We need a known volume for some 5k Litres or 1k litres and then do this drama to add it to tank that is calibrated and then use a pump to put it into the main tank. In the place where I am, I don't think they would do such a thing.

They have this tanker guy who comes and fills it up, depending on his flow meter isn't something I want them to do. I also checked that low flow rate meters are inaccurate.

I will proceed with the ultrasonics, if anything comes up let me know, thank you all for the great help, I will update here my results soon. Will check on monday for the rest of the values for the spherical cups.

If this was my tank, I would empty it. Then add a "T" to the output connection. Connect a transparent plastic tube to the "T" and mount vertically. It's called a "sight tube". Add a vented cover to the top to keep bugs out.

Then you can instantly see how much fuel is remaining.

Paul

If you use a sight tube make sure their is a valve by the T to turn the sight tube off if something happens to the tube - I have seen some sight tubes and the default position of the valve was off and the valve was only opened when the sight tube was being used.

All ideas are welcomed.

Contact a tank service company and have them install a standard fuel oil/diesel level sensor. These utilize a metal encased float that slides along a magno-restrictive pickup rod. They are designed for the environment and meet all the necessary safety requirements, which are many, no matter where you are in the world.

This a job for professionals that do this sort of thing for hire. A home built sensor has no place in a tank of flammable liquid.

Although avr_fred is 100% correct and is the right thing to do, we often look at things from the theory point of view.
#1) intrinsically safe is part of the safety code here in the US. you have flammable vapors that are always present.

Class

Class l – Areas in which flammable gases or vapors may be present in sufficient quantities to be explosive or ignitable.
Divisions

Division 1 – Normal Situation: A hazard is present in the everyday normal production operation or during frequent repair and/or maintenance activity.
Groups

Group A, B, C & D Gases and vapors in Class l locations are classified into four groups, by the code A, B, C, and D. These materials are grouped according to the ignition temperature of the substance, its explosion pressure and other flammability characteristics.
Class I / Division 1

Group D • Propane • Acetone • Ammonia • Bezene • Butane • Ethanol • Gasoline • Methanol • Natural Gas

due to the nature of ignition, it seems that diesel is not on this list. but that in no way makes it safe to work around.

once a fire has started, you have to have fire supression equipment to extinguish.

whatever you choose for your sensor, be aware of the possibility that it could be the cause of a fire.

For Ultrasonic I would take a stick, hit the bottom of the tank measure the distance up.

Measure the the distance from the top of the tank to that existing fluid level

Create a test apparatus for that total height (to the bottom of the tank) with a PVC tube like a 4-inch diameter PVC

Fill it with diesel to the level measured, to replicate what the tank is
take readings
Drain the test apparatus. Take readings.

At that point you would have a total height of tank value and a current value.
then, add drops of diesel to determine the sensitivity of the sensor to read the fluid level.

This calibration would be able to show you how sensitive the sensor is.

you may not be able to read to an accuracy that you desire. proving to your satisfaction that the technology is, or is not workable.

In my opinion, I would only be concerned about the tank once it has dropped to about 1/4 of the height. that might be 1/10 of the total volume as you are on a cylinder at the bottom. time to re-fill.

also, keep track of filling. get the gallons delivered. you can compare the delivery volume to the tank readings to increase the accuracy of your system.

=================

You have not stated the diameter of the OD of the tank and the overall length.
on-line a 277 inch long tank, x 90 inches high
you should be able to figure out the amount of fluid needed to raise the level by 1 inch ( or 1cm )

Perform tests on your sensor to see what resolution in cm or mm it would have and see if you are within an acceptable level of accuracy.

I do not know if you are looking for a tank level device or a 'prove the volume delivered' device.
if you are looking for tank level, then accuracy is not as important.
if you are looking for custody transfer accuracy, are need to spend some huge bucks for high accuracy.

Why not just weigh the whole tank ? If you know the density of the deisel then you can work out what’s in it .

Forget the tank dimensions.
Fit external outlet flow meter, fill the tank, zero flow meter.
Use Arduino to subtract flow amount from 15kl and display on readout.
Result is you end up with not only what is in the tank, but also amount used.

Abdul_Moeez:
The accuracy needs to be + - 50 litres or something, it is not fixed. Some error is acceptable but not some 300 400 Litres.

You are being very ambitious to expect an accuracy of ±50 litres, that is only 0.33% of the total volume.

I think that even your "unacceptable" error of 300 litres (2%) would be hard to achieve using an ultrasonic sensor, particularly when you don't know the exact geometry of the tank.

Have you considered that the speed of sound (and hence the distance measured)) varies by about 1% for a 5°C change in temperature?

JohnLincoln:
You are being very ambitious to expect an accuracy of ±50 litres, that is only 0.33% of the total volume.

I think that even your "unacceptable" error of 300 litres (2%) would be hard to achieve using an ultrasonic sensor, particularly when you don't know the exact geometry of the tank.

Have you considered that the speed of sound (and hence the distance measured)) varies by about 1% for a 5°C change in temperature?

Everything we do changes in some ways. Humidity is totally dependent on temperature.
The comment about not knowing the dimensions is of vital importance. if the 15,000 litre tank is 90 inches in dieamter, then one can calculate the largest surface area at the 50% fill point.
using the rule of thumb that the sensor needs to be 4 times more sensitive than the thing it measures (for a general reading) then assuming the sensor can resolve to 1 cm. only would want to know how much volume it would take to raise the level by 4cm.
everything else can be measured and calibrated out.
Another way is to use a submersed pressure transducer and put it on the lowest part of the tank. drop it in from above, or connect it to the lowest drain. calibrate it for the fluid and Bob's your uncle.
Someone on here said they could measure the height of a flea's dick in a water tank with a high quality sensor.
alas, we still do not know what the actual application is.
is it custody transfer to verify the amount delivered is accurate ?
is the application to make sure there is adequate fuel for use ?

Thank you so much for that link. I still am unsure whether I can get that big R over there. and the angles, its an actual 15kL tank. I can get on top of it but I guess I would need to draw some geometrical lines on it?

or am I missing something? is there another way to find all that?.....

The big 'R' is just the radius of the cylindrical tank. You should be able to measure the width of the tank easily then just half it. The only measurements you need are the cylinder radius and the length of the straight part of the tank. The total length of the tank will be the legth of the straight part plus twice the tank radius. There is no need to mark geometery on the tank or measure angles.

The links I sent allow you to enter numbers so just feed some numbers in and see how the results change.

You say the measuring device will not be permanently mounted. That may make getting an accurate, reproducable reading difficult. What is the problem with just using a dip stick?

The idea of having a sight glass is a very good one.