Overly Complicated Gas Guage

While this is most likely overkill for a gas gauge, we do thank [VadimS] for sharing the information. He shows us how to build a capacitive liquid sensor using an Arduino, some foil and some wire. He’s basically detecting the difference in capacitance between the foil sheets. As he gets more water in the bottle, the capacitance goes up. At least we think thats what is going on. He has included the source code for the Arduino, both for handling the sensor and running the LCD display shown in the picture above. When completed, this will be used in his dune buggy for a gas gauge.

39 thoughts on “Overly Complicated Gas Guage

  1. I’m thinking he’s going to need some major recalibration once he uses it on his fuel tank, unless he’s using a hydrogen power cell.

    @mattbeddow… Take a look at how a fuel gauge sender works. Hint: it uses electricity.

  2. I work on avionics systems on many planes (heavies to be exact), and fuel indication is all capacitive readings from the probes in the tanks. It is a mix between tank units, which are the actual probes, and then you have compensator probes located at the bottom of the tank(s) which compensate for fuel density and aircraft movement on all axis. It is very simple, but a bitch to work sometimes depending what tank reads incorrectly :-P

  3. A nice system, I like it! No contact between the fuel and electric components at all.

    It’s worth remembering that water has an extremely high dielectric constant relative to most fuels (that I can think of anyway)… water is around 80 (depending on temperature), and gasoline is around 2. Calibration!

    You could do this without any MCU at all if you were so inclined… if you know the capacitance when the tank is full, you compare the current capacitance to this reference using two oscillating Schmitt triggers that are out of phase. A change in capacitance will cause a beat frequency, which is audible if you amplify it and connect it to a speaker. Surely you could also build a gauge, but the idea of an audible theremin-fuel gauge is too entertaining…

  4. I’ve worked on some “Tank empty” sensors for aircraft that are optical. They shined a led down a probe tube inserted into the tank, and measured the reflection from an plastic prism glued into the end. The fuel would change the reflectance of the prism. This doesn’t provide an actual measurement of fuel remaining, just let’s you know you’ve emptied your tank down to the length of the probe, and you’re into your reserve fuel.

  5. I’m not nearly as knowledgeable in electronics as the other readers, but the only way I would call this overly-complex is if the Arduino + LCD are used ONLY for the gas gauge. There’s no reason why this couldn’t be expanded with other much more useful sensor information such as oil pressure and temperature, battery voltage, RPM, estimated fuel time/distance remaining.

    Remember though that even in more modern vehicles, gas gauges aren’t at all as accurate as most think, especially in older vehicles.

    It’s funny as hell though that the LCD uses like 3 times as many wires as the gauge itself. Digital displays will look much nicer. But honestly, a buggy is rugged, so why not go for some rugged analog gauges? http://www.diylife.com/2008/02/02/show-pc-stats-on-analog-gauges/

  6. Overkill is an understatement. An ENTIRE Arduino Mega for a single capacitive sensor and LCD screen!? This is a project for the likes of an Attiny13, not the freaking beast that is the Arduino Mega.

    [VadimS]-disregard if adding more functionality later, or switching the brains.

  7. Wow this awesome, I get personal arduino now. I am sure my 555 timers are going to trash now. now my scooter will know gas amount now.

    only problem now have 2000lb of capacitors and resistors from using 555 timers all time. Maybe make sculpture with bobob.

  8. Excellent! From what I’ve been told (don’t do much work on cars myself), car fuel gauges generally die because the gas eventually corrodes the sensors. If there’s no sensor in contact with the gas, the fuel gauge should last longer, correct?

  9. PLEASE DON’T DO THIS

    there’s a reason why car gas sensor are complicated plastic thing that float over the gas :

    ELECTRICITY THROUGH GAS= BAD DATA

    simple as that,and on top of that,using with gasoline will give weird info since different gasoline are used by different companies.

  10. Actually, gasoline won’t ignite at an air:fuel below 1.4% or above 7.6%. So liquid gasoline won’t ignite from a spark (even if there was one). Mythbusters covered this a couple episodes ago when TRYING to explode a gas tank and failing repeatedly.

  11. You got that wrong, bad for water, great for gas.

    if he ever gets water in his tank it will peg high.
    and nothing ever corroded from contact with fuel, only when water joins in.

    this would work better with more surface area, ie make it from tubing, not wire. usually they consist of 3 concentric tubes, signal being the inner tube lo-z (excitation) being the middle, and the outer being a mechanical (and sometimes electric) shield to keep monkeys from slapping sealant on the inner tubes. so far as I know the elements should not be insulated, the metal should contact the fuel. and someone should be sure that their design has no ability to push amperage should something vibrate loose inside the tank.

    I doubt the available gasolines vary in dielectric enough to throw off calibration, but if you think it might, add an additional sensor at the bottom of the tank positioned so as to remain submerged always, and read that as a calibration correction factor. that would automatically correct for density variations caused by differing grades of fuels.

    also nobody has mentioned this is not going to read gallons, it will read pounds, so a full tank will not always read max on the gage.

  12. Gasoline vapors can ignite off static electricity; I think there is a safety issue here that’s been under-reported. Do what you want, but I’m not putting this in my tank. With all the variables, you’ll spend more time calibrating this than using it. Great idea, but not for gas.

  13. actually, the gas meter in my car works using a floater-on-arm mechanism, similar to a toilent tank float. this is attached to the fuel pump assembly and submerged in the gas tank (which is why this procedure is done on 1/2 tank or less). the actual electrical connections are outside the tank, but the pump itself is connected while submerged. and…my car hasn’t blow up. at least, from the fuel tank. yet.

  14. In the 80’s XD through XF Falcon cars in Australia had capacitive fuel senders. The sensor was a bare copper PCB in the fuel with two tracks the length of the PCB and an epoxy coated chip at the top that converted the fuel capacitance into a voltage between 0 and 4.5V to sent to the cross-coil gauge. The whole thing was then in a steel tube with a small hole in the end to damp the sloshing of the fuel.

    The only problem with them came when the fuel got contaminates like water in it which shorted out the electrodes.

    You need oxygen and fuel to burn. In a fuel tank there isn’t any oxygen, its all pushed out by the fuel vapor. Most cars have fuel pumps with submerged, brushed motors.

  15. Like Josh M, I work on avionics (for helicopters). This system is actually extremely reliable. Using JP-8 fuel, even with oxygen in a sealed tank, there are no explosions of any sort. There isn’t enough current in the system and the voltage isn’t high enough to create any sparks to jump from one contact to the other. It can also be extremely accurate.

    As for calibration, measure the capacitance when the tank is full and when it’s empty. That gives you upper and lower limits. Everything else from there is just a quick math equation, quite easy for an arduino, or really any MCU, to solve.

  16. @To nick spoofer
    Dude who poorly pretend being me, if I want to code I have more than enough PICs and ICD3 to debug them, so no, arduino is not an option. And when I do analog I use discrete, so there isn’t much 555 in collection, I do use them sometimes, but when couple transistors can handle the task I use transistors.

  17. Yeah that was a pretty poor attempt at imitating
    @therian, some peoples kids need a double slap lol.
    Im new to electronics and I was wondering what kind of things you make with discrete components. are you using pic and discrete or just discrete.
    ive used MicroControler and discrete but haven’t found to many for just discrete. any projects you have made @therian or websites you’ve found that could help… thanks!

  18. @nerbert
    Usually both, I love analog because of interest in radio communication. Many old forgotten but great and simple circuits (forgotten because of hard of use or soso stability etc) can have a new life with help of microcontroller, so mostly in free time I try to reanimate them. I don’t believe in web site teaching, 99% they not complete or informative enough, so I have huge pile of books and even more eBooks. If you interested I can share it, but in a week or 2, now I have finals and really busy

  19. @Joe: TWA 800’s explosion was in an *empty* tank; what ignited wasn’t liquid fuel, but residual fuel vapors mixed with air. The interesting thing is this could only happen in a tank that was empty; in a tank with usable fuel there’s enough vapor to push out the oxygen, creating a mixture too “rich” to ignite.

  20. I was looking at this for a motorcycle. I’m thinking on an even simpler circuit using a series connected reed switch with resistors placed in a sealed 1/4″ diameter tube. Attached (& parallel) to it would be a similar tube with a float containing a earth magnet. That tube would have holes in it to allow gas to enter, and the float to “float” on the gas. As the magnet/float moves the appropriate reed switch is closed indicating the level. Simply read the voltage with an arduino (or could also go to some LED’s). No voltage/current in the tank (i.e. it is sealed inside one of the parallel plexiglass tubes. Just need to safely route two wires out of the gas tank to the receiver. The tubes could be bent to accomodate odd shaped gas tanks, and calibration would be very easy.

Leave a Reply to TimCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.