No announcement yet.

Gas logging

  • Filter
  • Time
  • Show
Clear All
new posts

  • Gas logging

    I didn't put this in the software section because that section looks anemic.
    The program I'm writing does gas/drive/speed logging so I can monitor my mpg and cost. It tells me how many miles ive driven since my last fill up, average and peak speed. This generally works fine as it pertains to actually driving. However when I'm not driving, or stop and go traffic at less than 2mph, nothing is registered (I have it programmed to only calculate/register when I'm >3mph). I know it is a pretty broad question considering different cars and mpg and such, but how can I go about calculating gas use while the car is at stand still(stop and go traffic)? As it is, I generally get 14-18mpg city.


  • #2
    What do you mean "calculate" (at standstill)? That's zero mpg, or infinite L per 100km etc.

    Not that I know how modern vehicles do it, but it used to be handled by whatever filtering/averaging algorithm was used, else an invalid display (dashes with flashing dot etc) - especially if a dual display in conjunction with a rolling average or filtered display.


    • #3
      Basically my software logs that I put X gallons in my tank at $60.00, on 1/8/2014. Now I go driving for let's say 30 miles and my tank is empty. While I was driving, my software was logging how many miles I was driving, doing all the calculations based on GPS and speed. Now when I fill up my tank again it logs that I got 30 miles out of the previous fill for $60.00.

      Now that last run was a straight highway run with no stops or idle time, so the calculation is perfect, I know I was able to drive 30 miles for my $60.00. But what if I idled for say three hours, which I do tend to do because I can't run my system for too long without the car running, then it looks like I was only able to get 27 miles out of my fill up. So it looks like something is wrong and I'm not getting my proper mpg. So I want to split the log in order to calculate none drive time that is using up my gas. I just need to figure out an average formula. Like let's say an hour of idle time equates to driving 1 mile; so three hours of idling will equate to ROUGHLY 3 miles of driving and I'm back up to 30 miles. Of course the database log would be split between idling time and actual driving time so I know how much is a rough estimate.

      Soooooooo, any ideas?


      • #4
        According to the US Dept of energy the average fleet vehicle burns 0.594387 US gallons of fuel for every hour idling
        I had researched this many moons ago for my fleet tracking company. Not sure how accurate but at least it is a starting point some what. Good luck SNO


        • #5
          I went ahead and did some googling...I don't know why I didn't do that first...and see that the burn is between .3 - 1 gallon per hour idling. That's wildly different numbers. I think I'll split the difference and go with .6 gallons per hour. I also found a site that said an hour of idling translates to a trip of 25-30 miles. Now I need to figure out what all this means mathematically and come up with a happy rough medium. Chime in if you have input.