Subscribe to Make Magazine Today!

Make: Projects

New Project: Arduino LED Fuel Gauge

Replace the analog fuel gauge in your car with a more accurate digital version powered by Arduino.

New Project: Arduino LED Fuel Gauge

Arduino Fuel Gauge:

A few months ago, I hit a pot-hole while driving my 1974 Dodge Dart and my fuel gauge immediately went to "E." For a split second I thought I lost all of my fuel! My father-in-law suggested I drive backwards over the pothole to fix the gauge. It didn’t work.

I researched some aftermarket options and I was generally unsatisfied with how they looked. Usually they were 3-digit 7-segment displays that read between 1-100 representing the percentage of fuel left in the tank. That style reminded me of the sad time in the early ’90s when car instruments were too digital.

I had one of them in an online shopping cart, ready to click "complete purchase" and sacrifice $50 and the analog soul of my car, when it hit me: "Hey, am I a maker, or not?" So I abandoned ship and decided to make a fuel gauge myself that would be cheaper and better than one purchased off the shelf.

Older vehicles usually have gauges that use a very simple analog circuit to read a resistance. You can read this resistance with an Arduino!


  • Jonathan Williams

    Steve,
    all of your ideas are really smart. I will definitely implement some of them. Thanks for your help!!

  • Don Miller

    Jonathan,
    I have lots of questions concerning a similar project – Can you contact me via e-mail please?
    Thanks! Don

  • Samuel Wakefield

    Johnathon, can you please repost the coding for this?! I have assembled the hardware but I dont have any of the coding, and I dont have the knowhow for it! PLEASE HELP

  • yaseen

    jonathan i m working on similar project,bro it wul b your favour if u help me via email.my email id is yaseenrupani@gmail.com.thanks

  • Michiel Dix

    dear jonathan,

    i am working on an old vespa bike and would like to include a led fuel gauge. Your project seems spot on, can you send me the code if possible?

    tnx!

    Michiel Dix

  • Anuvin .

    Thanks very much for this project. I wish the code was still up, let me know if you need hosting. anuvin at g mail dot com.

  • sneha raikar

    can u please mail me the code???? sneharaikar32@yahoo.in plz plz very much in need pls

  • Anuvin .

    I found code that works with this build here: http://naveed.roon.io/making-fuel-gauge

    I followed 100% of the instructions here, and used the code from that website, and mine is working well.

    Good luck!

  • Toedrag

    Not to take anything away from the author or Arduino, but you can use other components instead of Arduino, such as an LM3914 or a few simple comparators (e.g. LT1721) and some resistors. The function of all of these devices (Arduino, LM3914, or a comparator) is the same: compare the incoming analog voltage with preset thresholds and turn on/off the appropriate LEDs.

    If you already have an Arduino or if the Arduino will perform other functions in addition to the Fuel Gauge, then sure, go ahead and do it this way. However, if you’re only building a Fuel Gauge and nothing else, there is no reason to buy the Arduino or similar microcontroller.

    • Ali Taher

      can u explain how to use LT1721 ? is there any guide ? and what about ATMEGA (program it with arduino then using it as standalone)?

      • Toedrag

        Sure thing. No guide yet, but maybe when I build it, I’ll write one…The LT1721 is just a simple comparator (many others could also work – it’s just the first one I thought of); you’d use 1 comparator per LED you want to light up. The Fuel Level sensor signal goes to the inverting input of each comparator. On the non-inverting input of each comparator, connect a voltage divider (which is just 2 resistors); the divider sets the threshold where the comparator’s output changes state. Each voltage divider resistor pair may be different for each comparator, but it really depends on how linear the resistance is coming from the Fuel Level sensor (or any other resistive type of sensor for that matter). If you get lucky and the sensor is linear, you can use something like an LM3914, which is an LED driver IC and has 10 comparators and 10 resistor dividers composed of a series of 1k ohm resistors.
        I don’t know much about ATMEGA, but in general, there’s not much reason to use a SW-based approach to sample such a slow analog signal, unless you need to do something else more complex with it besides driving just an LED.

  • http://www.theartisanswork.com Jonathan Williams

    Hi Everone! I finally put this code on Github. (link below)
    Sorry that I couldn’t maintain the link in the project text.

    https://github.com/friendorfoo/Arduino-LED-Fuel-Gauge.

Related Supplies at Maker Shed