Tech help
I'm in the process of writing a program that resides on a mobile phone it will basically be a scanguage2 but for mobile phones mainly mine (N95 8GB) and its completely wireless (bluetooth).
It does work so far through an elm device that reads from the OBD2 port, i can read a few values correctly (ignition timing, voltage and speed) and regulary too.
Anyone any ideas how i can work out average MPG?
I was thinking using the following values, and given a value every minute or so to get an average. I might have to put in an option to reset when you fill up with petrol but that would be a bit of PITA maybe no other to do it?
(fuel trim)
(Vehicle)
(MAF)
(AFR)
(VSS)
Cheers
It does work so far through an elm device that reads from the OBD2 port, i can read a few values correctly (ignition timing, voltage and speed) and regulary too.
Anyone any ideas how i can work out average MPG?
I was thinking using the following values, and given a value every minute or so to get an average. I might have to put in an option to reset when you fill up with petrol but that would be a bit of PITA maybe no other to do it?
(fuel trim)
(Vehicle)
(MAF)
(AFR)
(VSS)
Cheers
Well you're going to need to know distance, which I'd take from the Odometer. You'll also need to know how much fuel is being consumed. The inverse of this is fuel remaining, so you can obtain a voltage proportional to fuel level from the gauge.
With some magic on your part, both bits of data will give you your MPG.
It's not going to be spot on accurate, you'd have to look into something more complicated by looking at the amount of fuel injected (possibly by looking at MAF and air/fuel ratio).
With some magic on your part, both bits of data will give you your MPG.
It's not going to be spot on accurate, you'd have to look into something more complicated by looking at the amount of fuel injected (possibly by looking at MAF and air/fuel ratio).
I think the SGII does it by using RPM or Duty Cycle of the injectors (or something) and the engine capacity. It does use the TPS (throttle position) but I think that is only relevant to when its on idle. It has a measure for the FPR but that is blank on the S and it still works it all out quite well. I suspect its just using RPM and capacity.
It does have a correction factor that you can adjust when you fill up and the MPL economy figures are realtime ish but it also keeps a tally for trip, day and tank.
It does have a correction factor that you can adjust when you fill up and the MPL economy figures are realtime ish but it also keeps a tally for trip, day and tank.
Thanks guys, think its simplier.
Here is a formula that should do.
Based on VS, AFR of 14:7:1, MAF reading
MPG = (14.7 * 6.17 * 454 * VS) / (3600 * MAF / 100)
MPG = 710.7 * VS / MAF
This will be an approximation MPG, but better than nothing
Here is a list of items you can read (main ones)
Engine RPM
Calculated Load Value
Coolant Temperature
Fuel System Status
Vehicle Speed
Short Term Fuel Trim
Long Term Fuel Trim
Intake Manifold Pressure
Timing Advance
Intake Air Temperature
Air Flow Rate
Absolute Throttle Position
Oxygen sensor voltages/associated short term fuel trims
Fuel System status
Fuel Pressure
Here is a formula that should do.
Based on VS, AFR of 14:7:1, MAF reading
MPG = (14.7 * 6.17 * 454 * VS) / (3600 * MAF / 100)
MPG = 710.7 * VS / MAF
This will be an approximation MPG, but better than nothing

Here is a list of items you can read (main ones)

Engine RPM
Calculated Load Value
Coolant Temperature
Fuel System Status
Vehicle Speed
Short Term Fuel Trim
Long Term Fuel Trim
Intake Manifold Pressure
Timing Advance
Intake Air Temperature
Air Flow Rate
Absolute Throttle Position
Oxygen sensor voltages/associated short term fuel trims
Fuel System status
Fuel Pressure
Dont forget to add on the 'null' level from the TPS.
For when coasting on over run / closed throttle (no consumption).
The scanguage - you read TPS raw value with foot off the pedal, add a couple for slop and set this as the point where below this value there is zero fuel consumption (closed throttle).
For when coasting on over run / closed throttle (no consumption).
The scanguage - you read TPS raw value with foot off the pedal, add a couple for slop and set this as the point where below this value there is zero fuel consumption (closed throttle).
Trending Topics
OK; I know I'm twice you age Aj, but MPG on your mobile??? WTF???! Can't you youngsters just divide the miles covered between fill-ups by the amount of fuel used between fill-ups and then spend all that free'd up time drinking and sh@gg!ng??
98
98
Originally Posted by 98RON,Mar 10 2009, 08:22 AM
OK; I know I'm twice you age Aj, but MPG on your mobile??? WTF???! Can't you youngsters just divide the miles covered between fill-ups by the amount of fuel used between fill-ups and then spend all that free'd up time drinking and sh@gg!ng??
98
98

Bharat
Originally Posted by 98RON,Mar 10 2009, 08:22 AM
Can't you youngsters just divide the miles covered between fill-ups by the amount of fuel used between fill-ups and then spend all that free'd up time drinking and sh@gg!ng??
More time for drinking








