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.

Comments

  1. now thats useful arduino usage =]

  2. mattbeddow says:

    Hmm, that seams….safe.
    Petrol + Electricity ?

  3. Adam says:

    mattbeddow, how do you think a gas guage works anyways?

    It’s usually a resistive wiper (much like an RC Speed switch)

  4. Josh says:

    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.

  5. Going Digital says:

    No you have no current in contact with the fuel, there is usually a mechanical float that is in contact with the fuel and the gauge is connected to the float.

  6. Josh M says:

    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

  7. rd says:

    What’s “overly complicated” about a capacitive sensor?

  8. andrew says:

    After some digging, I found this more thorough explanation: http://www.arduino.cc/playground/Main/CapSense

    Still, I’d be interested to know what kind of data he can get from this.

  9. Sean says:

    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…

  10. rallen says:

    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.

  11. nubie says:

    In most cars the fuel actually travels through the electric pump motor for cooling and sound damping.

    Also most fuel gauges expose bare wires to the tank.

    http://auto.howstuffworks.com/fuel-gauge1.htm

    Personally I would adapt an existing fuel gauge, they are dirt cheap at wrecking yards.

    Dune Buggy just says vibration to me, I hope it works for him.

  12. Skitchin says:

    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/

  13. Nemo says:

    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.

  14. therian says:

    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.

  15. Urza9814 says:

    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?

  16. farthead says:

    @nubie.. you are correct sir. This system will fail miserably.

    Works great for water. sucks for gasoline.

  17. Jay says:

    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.

  18. Severedbrain says:

    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.

  19. Joe Bonasses says:

    TWA flight 800? Oh, wait, that was a missile. With all that spare arduino capacity you could add a nitrogen inerting system though :)

  20. Think says:

    Insulation. You know the kind.

  21. Tim says:

    Here’s a commercially available capacitive fuel sender unit. This unit has some sort of chip that senses the capacitance and simulates the signal normally received by a resistive sensing circuit.

    http://www.datcon.com/products/4intelli.htm

  22. McNoob says:

    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.

  23. therian says:

    and who is a smart ass to copy my nick name ?

  24. therian says:

    identity theft istn funny dude, it lame

  25. squidarthur says:

    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.

  26. mike says:

    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.

  27. TheBlunderbuss says:

    Alcohol sensors work on electricity.
    They don’t explode.

  28. Luke Smith says:

    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.

  29. Shawn says:

    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.

  30. therian says:

    @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.

  31. nerbert says:

    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!

  32. therian says:

    @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

  33. Orv says:

    @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.

  34. nerbert says:

    @therian
    that would be sweet if you shared your projects/info. You said you reanimate old equipment do you just revive them or you add new features/more power ect.

  35. Quvmoh says:

    anyone have a simpler circuit to do the same thing
    or perhaps just drive an analog gauge?

  36. Some really dumb folks here… Modern vehicle use submerged fuel pumps and the level sensor is sitting in fuel too, both using electricity… p.s. mixture would be too rich if there was a spark….

  37. Larry T. says:

    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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s