# Thread: Calculating MPG from VSS and MAF from OBD2

1. Get that from the injector specs...
Decide whether you want a rectangular average (eg, width minus half ramp up&down time) or mapped; assumed pressure (eg 3 bar) or measured etc.
Squirt volume times injections (x cylinders) divide by distance.
Metric or imperial to your liking.

PS - I only ever dealt with low-Z injectors.... I never bothered with the voltage bullsh that hi-Z injectors allegedly require... (Where that was an issue, hi-Zs were replaced with low-Z's, else a regulated voltage rail was used.)

2. ## MAF Accuracy

MAF sensors produce results which factor in temperature, humidity, and altitude. They seemingly make the job of determining the Mass of Air flowing into the engine easy.
However, I'm wondering how accurate or linear they are. For example, let say a known mass of air is passed through the MAF sensor. How accurate would the result be if the temperature was then varied from say 0F to 120F? Likewise with the humidity and pressure (Alt)?
Any one have any data?

3. According to you, they factor that in.....

But MAFs are mass-flow, hence usually only measure flow & temperature.
The temperature won't vary significantly through the MAF.

Humidity (if measured), and pressure (altitude) are different sensors.

Get linearity from the specific MAF specs.

4. ## A confusing problem

Originally Posted by wi77iam
The software that came with the OBD reader I have, has some formulas for computing various things from the codes. One of which is instantaneous MPG, as follows:

instantaneous Distance D = VSS * t/3600
instantaneous Fuel F = 1 / (14.75 * 6.26) * MAF * t/60
instantaneous MPG = D / F

t is delta time.

So other than the conversion constants being slightly different, I would say your formula looks good.
Dear sir,
I think the formulas you offered are really quite concise and smart.
However, I am confused that how to obtain the constants “6.26” and “60”?
What are their units? It is not appeared and consistent with the formulas offered by maeliosa. I appreciate your kindly answer and help.

SY Chen

5. ## Yo Punks!

YOu stupid yankies don't know how to calculate MPG? Ha, ha, ha!

MPG = miles per gallon = miles/gallon

(miles/hour)/(gallons/hours) = miles/gallon = miles per gallon = MPG

It's ease

so you need a speedometer, fuel flow meter and calculator, that'd be able to do only one operation///\\\

6. The obvious stated by one without a clue. How refreshing. (Especially getting a speedo LOL!)

7. Hi to all..

I'm trying to create small application for calculating LPK, KPL etc.
So, now I have found problem with calculation of MAF from MAP, RPM, IAT.

The problem is in that in injector engines when you release at all acceleration pedal PCM will block fuel supply and LPK momentary must be 0. But in case of calculating MAF from MAP, RPM, IAT LPK momentary will never be 0. Someone solved that problem?

8. I like the page 1 solution - use the injector pulse-width.

How much are fuel-flow sensors? If they are (relatively) as cheap as photo-diodes & -resistors, I prefer that to certain other solutions (like using GPS for dimming; those \$1 photo-components work in tunnels and during any weather or eclipse). ( )

9. Originally Posted by OldSpark
How much are fuel-flow sensors?
Most if not all of the market is marine stuff, for calculating exact fuel usage on boats (to avoid running out of fuel on the water). They run in the \$100-\$300 per sensor range. I've yet to find anything capable of sufficiently high pressure and flammable fluids capable for any cheaper.

10. Hmmm - I recall from under \$100 (so I made my own with a conical seat and a spring and used the spring's varying inductance/impedance to indicate flow rate).
But that was for older low pressure systems.

Injection systems also suffer from their reticulation system - you'd have to have 2 sensors - subtract the return flow from the forward flow (hence doubling inaccuracy).

AFAIK, most use injector pulse widths. It's usually reasonably accurate since the pressure is constant and pulse width can be read else monitored - just allow for open and close time (ie, half the flow during the open+close time, and the remaining time x flow).
And that can be extended to all injectors when differing injection volumes occur.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•