1. Attachments are working again! Check out this thread for more details and to report any other bugs.

Reading MPG from Canbus Datas

Discussion in 'Gen 2 Prius Technical Discussion' started by NikQC, Dec 2, 2008.

  1. NikQC

    NikQC New Member

    Joined:
    Dec 2, 2008
    1
    0
    0
    Location:
    Quebec, Canada
    Vehicle:
    2004 Prius


    I'm trying to read some data from my Prius CANBUS. Using a CANbus datalogger and Attila Vass documentation, I already managed to read data such as battery voltage, vehicle speed,... I'm now trying to acquire the Prius fuel economy (MPG) from CAN data.
    After a quick search on this forum and on Google, I'm quite confused. I learned that the MPG displayed on the Prius MFD is not directly available on the CANBus and that it should be calculated. I was not able to find a formula for the MPG calculation.
    A way to do this seems to be by using the Fuel injection information on the CANbus (Attila Vass excel file) and the vehicle speed. Other references speak about using the gas gauge information and the travelled distance. Softwares like CanView already give the car MPG so it should be possible to calculate it.
    Does anyone have information to share with me? Thank you for your help,

    Nik
     
  2. bwilson4web

    bwilson4web BMW i3 and Model 3

    Joined:
    Nov 25, 2005
    27,670
    15,664
    0
    Location:
    Huntsville AL
    Vehicle:
    2018 Tesla Model 3
    Model:
    Prime Plus


    I would recommend:

    • mass_air_flow / 14.7 -> fuel grams/sec
    • speed * K(1) -> speed in miles/second
    • fuel_grams/sec / K(2) -> fuel in gallons/sec
    • speed in miles per second / fuel in gallons/sec -> miles/gallon
    The constants K(1) and K(2) are left as a simple Google search effort.

    GOOD LUCK!
    Bob Wilson