Subaru Legacy Forums

Subaru Legacy Forums (http://legacygt.com/forums/index.php)
-   Interior/Audio (http://legacygt.com/forums/forumdisplay.php?f=22)
-   -   Trip meter hacking thread (http://legacygt.com/forums/showthread.php?t=79982)

CombatCQB 01-26-2008 10:44 AM

Trip meter hacking thread
 
2 Attachment(s)
This is a project I've finally found time to tackle and with surprisingly good results. This should apply to all available trip meters from 05-08 but I'm only working with an 05 right now. The ultimate goal here is to decode the trip meter data and integrate it as part of my CarPC.

So the 05 trip meter has one serial interface between the combination meter and the trip meter. Reading the service manual tell us that the trip meter does zero calculations, and relies on the combination meter to feed exact values to it. The serial line is also one way, so the trip meter only receives data. Here's the good part; from looking at the serial stream captures, the data is a standard UART protocol:

-12V signal (0-12V)
-2400bps, Even parity, 8 data bits, 1 stop bit
-Polarity is reverse, so 12V=logic 0
-One packet every 100ms or so
-Nine bytes in each packet
-Last byte is a single-precision checksum
-All trip meter data is contained in the remaining 8 bytes so there is only one packet to decode

As for the meaning of the 8 data bytes, that's still being worked out. But I'm 98% sure the first byte is the outside temp while the 3rd byte has something to do with the instant MPG.

================================================== ======================
So I've managed to decode all the bytes that the clock/trip-meter displays:

|Temp|Unknown|Instant MPG|Avg MPG A|Avg MPG B|Miles remain|00|A/B|Checksum

Temp: 0x2C = 0 degrees F. It is not an exact linear reading, 0x37,0x38 both displays 10 degrees F. See post #35 for details on the temp scale: http://www.legacygt.com/forums/showp...7&postcount=35

Unknown: This byte changes occasionally, but doesn't change the display. It might be a hidden reading we don't know about, only more testing will tell.

Instant MPG: 0x28=20.0MPG. Each increment is 0.5MPG

Avg MPG A: 0x10 = 4.8MPG, 0x20 = 9.6MPG, 0x30 = 14.4MPG, 0x40 = 19.2MPG, scale is linear
Avg MPG B: same as above but for trip B

Miles remaining: 0x01 = 10miles, basically convert hex to decimal and add a zero to the end. Max is 0x63 = 990miles

00: another unknown, haven't see it changed. Maybe a disabled feature.

A/B: Only bit 8 is known right now to cause the Avg MPG display to select between trip A or trip B. This is normally 0x0C or 0x8C, but I have seen 0x9C so those other bits should mean something. Just don't know what yet.

Checksum: Take all the bytes and add them up, truncate result to one byte.

Now I just need some time or someone to write software. The hardware is simply a USB to serial adapter, I'll put together a write up soon.

================================================== ======================
03/16/08 Added HW interface schematic. This is using what I have on hand, but once the interface is stable I'll put together a cheaper implementation using a FT232R.

Penphoe 01-26-2008 11:20 AM

While you're in there, do you know how illumination is controlled in the trip meter? It doesn't have the illum and dimm (violet and Black/White) lines like some of the other illuminated devices.

LaterZ!
Darren!!

fweasel 01-26-2008 01:08 PM

cool. have at it.

John M 01-26-2008 01:47 PM

Awesome to hear! It might just motivate me to finish putting the damn PC into the car.

Penphoe 01-26-2008 11:24 PM

Never mind 'bout the dimmer circuitry of the clock trip meter. Doesn't matter any more since the Prosport is unable to dim via the white/amber lines. :(

LaterZ!
Darren!!

mwiener2 02-01-2008 11:44 PM

does mean a possible fix for the MPG when using upgraded injectors?

unclemat 02-02-2008 12:10 AM

cool thread, subscribe

now, this can fix edmundu's mpg readings - bastard says he gets 30 mpg all the time with his big turbo :)

Btw, trip meters are external on 05-06 only. 07-08 have it built in into the gauge cluster, and have only clock in the old location

mwiener2 02-02-2008 12:18 AM

30mpg....psh


Mine says 40 something in the city and over 50 on the highway

EquinnoxX 02-02-2008 12:18 AM

Excellent work, plz keep us posted!

unclemat 02-02-2008 12:21 AM

FWIW, a member tried to hook up metric cluster to USDM trip meter. Don't remember exactly, but I think they did not communicate, only temperature worked ok.

deltabi 02-02-2008 03:03 AM

Great! Thread subscribed.

Do you know what kind of Molex connector do the trip meter uses ?
Or you plan to just intercept the two wires needed for the serial communications before the connector itself ?

Thanks, CombatCQB.

BigT 02-02-2008 04:42 PM

Damn! I have no idea what you're talking about with this stuff. I really need to get some computer skills :(
If you were able to get something to perform the equations they would be pretty simple enough to write.

CombatCQB 02-02-2008 09:39 PM

Quote:

Originally Posted by deltabi (Post 1681821)
Great! Thread subscribed.

Do you know what kind of Molex connector do the trip meter uses ?
Or you plan to just intercept the two wires needed for the serial communications before the connector itself ?

Thanks, CombatCQB.

I don't think molex makes any of the connectors in our subaru. But I plan to replace the connector with something else.

I'm planning to build an interface module using the FTDI serial to USB chip. I'll see if I can use any of the other I/Os to operate the dimmer override and read back the pass. airbag status as well. That will provide a complete replacement for the trip meter.

Quote:

FWIW, a member tried to hook up metric cluster to USDM trip meter. Don't remember exactly, but I think they did not communicate, only temperature worked ok.
That's a good point, I should read back a metric trip meter to see how the bytes differ. It might help explain more the packet.

Quote:

does mean a possible fix for the MPG when using upgraded injectors?
This is possible but will take some effort to figure out the proper formula. A simple way is to come up with a table that converts the value that the ECU calculates to the actual MPG. But I don't know where to start with this. Is it just an inverse linear scale? So if you double the injector size, you half the MPG calculated to get the proper value?

FLPerf393 02-07-2008 02:59 PM

Writing a code shouldn't be all that difficult in vb. All i really need to know is how the data stream looks and I could write up a simple code in VB that will parse the strings.

deltabi 02-08-2008 02:36 AM

Quote:

Originally Posted by FLPerf393 (Post 1693739)
Writing a code shouldn't be all that difficult in vb. All i really need to know is how the data stream looks and I could write up a simple code in VB that will parse the strings.

It would be great to have a plugin for both the more diffused front-ends: Roadrunner and Centrafuse (the latter being probably my choice :)).

If I remember correctly the Centrafuse SDK is based on .Net, however.

Cheers.


All times are GMT -6. The time now is 04:44 AM.


LegacyGT.com