I am trying to build a fuel level gauge for 250-300 gallon tanks. The tanks are are of different diameters and lengths. But are buried horizontally just below the surface of the ground. Piping connections are at the bottom on 1 end. There is also access to the inside on the top side close to one end.
The information I need end up with is the depth of the fuel in inches and the number of gallons in the tank.
None of this need to be done fast since the user will push a hold down a button until the Inches and gallons of fuel is displayed on a 16x2 lcd.
I have formulas that will calculate the amount of fuel in the tank as long as I have the diameter, Length and the level of fuel in inches from the bottom.
My first choice is a ultrasonic sensor in the top side of the tank. Measure the distance to the top of the fuel do some math and its done. However it seems gasoline vapors are destructive to sensor. Protecting the sensor will not work because sound must travel through.
So I must either use a pressure sensor mounted to the top with a tube to the bottom of the tank. This works great until it come to the calculations. I can calculate the amount of gallons based on pressure. But I have not figured out haw to calculate the level in inches. Unless I am wrong which I dont think I am since as the level goes up it will take more fuel to raise the level an inch.
The other option would be to build a tube with Reed switches or Hall effect sensors every inch apart. Using a magnetic float and check which one is on. The problem here would be connecting 20-30 sensors to the arduino. It may need to be more sensors because I think there would need to be at least one on all the time or no value would be displayed.
I am sorry for the book
But if anyone has any comments or other solutions I would be glad to here them
This might help: Round tank calculator
If you use the tube to the bottom method and measure the head pressure, you will need to keep the tube filled with air using a "bubbler" pump (careful with electrical sparks and gasoline vapors) and remember gasoline is lighter than water. "The specific gravity of common vehicular gasoline is approximately 0.74".
timk5000:
So I must either use a pressure sensor mounted to the top with a tube to the bottom of the tank. This works great until it come to the calculations. I can calculate the amount of gallons based on pressure. But I have not figured out haw to calculate the level in inches. Unless I am wrong which I dont think I am since as the level goes up it will take more fuel to raise the level an inch.
The pressure will be relative to fuel level, but the amount of fuel needed to change the level by one inch will vary depending on how full the tank is, as well as the size and shape of the tank. One big problem with using a tube and pressure sensor is absorption of the air in the tube into the fuel.
Can you use the more traditional method of a float on an arm attached to a potentiometer? The resistance value tends to not be linear, but can be calibrated to give a reasonable reading in inches/gallons.
One big problem with using a tube and pressure sensor is absorption of the air in the tube into the fuel.
That's the reason for the "bubbler". How I did in the 1970s: I read the amount of Diesel fuel in a 10000 gallon tank by running a 1/4" copper tube to the bottom of the tank, pressure was read as inches of water on a "MagnaHelic" gauge. The gauge was attached to the top end of the tube (only when measuring), a rubber bulb was teed into the tube and slowly squeezed until the pressure stopped rising and the pressure was read. Inches of water was multiplied by specific gravity of diesel fuel and volume found by using the round tank formula.
I have tried a lot of different methods of measuring liquid depths. All of which work with different levels of accuracy. Which all of them are acceptable for my application as to the nearest inch is fine for my application. The Problems are that 1. unless I go to a 800.00 dollar Sonic sensor it will not withstand the vapors put out when gasoline gets heats up in the tank. Since the vapors can be pretty dense at time The Sonic signals will at time bounce off of the vapors at the top of the tank. Pressure sensors also work in tests with open tanks but in practice real underground tanks have pressure release gates that open when the pressure gets to between 3 and 5 psi. Using a encoder on a standard mechanical level gauge seems to work unless the fuel sloshes fast while filling the tank. It seems to miss counts at times.
So anyone have any comments on the above.
Now thinking out of the box. What about not using any type of sensor. How about mounting a Spool on a small Servo Motor. attach a cable to the spool, run the cable through a spring loaded switch that will monitor the tension on the cable. The other end of the cable has a weighted float attached and can reach the bottom of the tank.
When I want to check the fuel level
I push a button
The servo runs the float to the top of the tank and the servos home position is set.
We then run the cable down until the switch says there is no tension on the cable. This should be the level of the fuel. By counting the pulses I should be able to calculate the depth of the fuel. Next time should be a quicker test because if there is tension on the cable the float is already above the fuel.
Sorry for the book, But has anyone tried anything like this,
A Swedish company built and sold sensors for measuring the cargo level in oil tankars and similiar. They use radar technic. Remember that any stuff that can cause a spark, or short circuit heating, will make the gas tank into a bomb.
I say, drop this idea, use commercially available equipment.
You could still do it with the "bubbler" I described earlier, but you would need a differential sensor to read the difference between the pressure at the bottom and the pressure in the air space.
There may also be safety legislation governing electrical installations with fuel tanks in your location - intrinsic safety etc ; you need to sort that out FIRST