In our day to day lives we make car trips to the same places hundreds of times. Work, the grocery store, restaurants, etc. Wouldn't it be nice to know how much these trips cost? Like when you go for groceries, how much should you mentally add on to the bill for gas and maintenance?
The math is easy enough, but most of us just don't want to keep so many notes. That's why I've been wanting to create a simple device that mounts on your dash, and tells you instantly what each trip is costing you. After a couple of weeks with no added effort, you'll "just know" what all your daily trips cost. From there you can make smarter decisions about where and how you drive.
What it does
The gas meter is very simple. It has GPS and keeps track of the distances you drive. It uses this, plus some data you enter about your car to keep a running total of how much gas you've used, and how much you've spent. A zero button allows you to reset the count at the start of your trips, so that when you arrive, you'll know how much money and gasoline you've expended.
How I built it
Here are the core components I used:
MTK3339 GPS Module
Link: https://www.arduino.cc/en/Main/ArduinoBoardDue This is my go to Arduino now. ..and unfortunately it got discontinued. But it's awesome. Its a 32 bit core, and runs at 84mhz with tons of IO, so it can run circles around most other micros when it comes to multi-tasking and high throughput applications.
Generic 16x2 LCD
Link: (similar) https://smile.amazon.com/ESUMIC-Module-Arduino-MEGA2560-White/dp/B00E5YJCBA/ Arduino Library: https://www.arduino.cc/en/Reference/LiquidCrystal These are cheap and convenient for simple readouts. You can get them for like 2 bucks each on ebay.
Link: (similar) https://smile.amazon.com/Adafruit-3x4-Phone-style-Matrix-Keypad/dp/B00QSHPCO8 Arduino library: http://playground.arduino.cc/Code/Keypad Ok.. this was unnecessary to include. But it has awesome tactile keys and I've been wanting to use it on something for years.. so KEYPAD just because.
The program updates at a 1hz intervals.
First it pulls the latest latitude and longitude (if locked).
If we're on the first iteration just store this location as a waypoint.
Otherwise, do some math to calculate how far we are from the waypoint.
If we're farther than 15m, add the distance to the total traveled, and move the waypoint to where we are now.
(The waypoint system is nice, because position jitters won't register unless they're greater than 15m)
Use precalculated multipliers to convert the distance to dollars spent, and Gas consumed.
Push this data to the display.
Challenges I ran into
Things went pretty smoothly, but I did spend an hour trying to figure out why my GPS wouldn't lock, before walking outside and getting a signal in like 45 seconds...
Accomplishments that I'm proud of
It's pretty sweet to build any project that "Searches for Satellites". Also I think my Acrylic case turned out really nice. I designed the whole thing in Solidworks, then cut it out with the laser cutter.
What's next for Dash Gas Meter
I might make a second version that's much more compact. I also have some other car-computer ideas that I might be able to integrate into the same device. For example, keeping track of what speed zone your in, so you can drive near the speed limit without glancing at the speedometer every 2 seconds.