3

Is there a way that I can calculate the current range of a vehicle, using data provided via OBD-II?

I know I can find out the fuel percentage using fuelLevelInput, but how can I find out how many miles that equates to?

I am using a OBD system that roughly calculates MPG for me, is there a way I can use that in conjunction with fuelLevelInput, to estimate the current range of the car in miles?

My understanding is that all I have to do, is to multiply the MPG with the current fuel level in gallons. The problem is that fuelLevelInput only provides a percentage. Is there a way to find out the fuelLevelInput in gallons or litres?

Thanks for your time, Daniel.

Supertecnoboff
  • 219
  • 1
  • 3
  • 13

1 Answers1

2

I managed to solve my own problem, below are the steps I took to calculating the range (in case anyone else is interested):

1) Store the fuelLevelInput percentage for later use.

2) Use the following website to get details about the car (identification via car VIN number). The property I am after is called "Fuel Capacity" - the car's max fuel tank capacity in gallons.

3) Convert the current fuel level percentage into gallons by doing the following: (fuelLevelInput * max fuel tank capacity) / 100 = current fuel level (in gallons).

4) My OBD device/app that I am working on, calculates/stores all the MPG values of the recorded trips. So I add all the MPG values together and divide by the number of trips, to find out the average MPG value.

5) Now simply multiply the average MPG value with the current fuel level in gallons and you have an approximate current fuel range.

Note

Obviously this does not take other factors into consideration, such as but not limited to:

  • Driving gradients
  • Start/Stop traffic
  • Rate of acceleration
  • Rate of deceleration
  • Gears used (and the rate of acceleration in each gear)
  • Wind resistance

So its not going to be the most accurate range, but in my case it will do.

Supertecnoboff
  • 219
  • 1
  • 3
  • 13