Skip to main content

Reverse engineering PIDs

· 5 min read
info

This was originally posted on 2021-09-18 on gr-yaris.co.uk forum thread.

Car telemetry is a bit of a black magic. New cars are full of sensors that report readings on internal CAN buses. This data is accessible via a basic OBD adapter. However one needs to know the exact sensor PID value to query the sensor. The received data is usually in a raw form and needs to be converted to something usable by applying a specific formula. PID values and formulas are not shared by car manufacturers. Here is my attempt to make some sence of the GR Yaris OBD data.

Thanks to this thread we now know that selecting Toyota Camry 2020 in OBDLink Android app gives access to GR Yaris additional sensors.

It is relatively easy to snoop Bluetooth traffic on Android devices from bugreports or even live. So I selected a couple of sensors in OBDLink on continuous monitoring and looked into the BT traffic using Wireshark. Here is a little snippet from the quite verbose conversation:

Capture of Bluetooth traffic between OBDLink and the car

These are ELM327 microcontroler, that runs inside OBDLink, AT protocol commands. Interesting ones here are:

  • ATSH 0007D0 - sets OBD header for all subsequent OBD commands
  • 2162 - queries OBD Mode 21 PID 62 and gets 7D8 05 61 62 03 00 00 0 as a response

First three hex digits in the response 7D8 is the ID of the ECU that has sent the response. Next three bytes 05 61 62 I am not sure what they are. And next three bytes 03 00 00 is the actual data that could be interesting.

Here is the short list of OBD Headers, Modes and PIDs that I was able to figure out from the first initial look and from subsequent help of other gr-yaris.co.uk forum members below:

SensorCategoryModePIDHeaderFormulaDiag Command
Parking brakeNavigation System21627D0BIT(A:1)
Accelerator PositionEngine221059700(A-41) / 1.42
Engine Oil PressureEngine221074700(((A*256)+B) * 10) / 128
M/T Oil TemperatureEngine221638700A + B/256 - 40
+B VoltageCombination Meter2210217C0A/10
Fuel InputCombination Meter2210227C0??? 1
Sub FuelCombination Meter2210237C0???
Fuel Pressure (High)Engine221F6D700???
Fuel Pressure (Low)Engine221F6D700???
Intake Manifold Absolute PressureEngine221F87700???
Low Fuel Pressure SensorEngine2210CD700???
ExDID_1BE1Engine221BE1700???
ExDID_15F7Engine2215F7700???
ExDID_1F07Engine221F07700???
Tire ID 1 PressureTPM221005750B * 0.01373atcea2A atta2A
Tire ID 2 PressureTPM221005750D * 0.01373atcea2A atta2A
Tire ID 3 PressureTPM221005750F * 0.01373atcea2A atta2A
Tire ID 4 PressureTPM221005750H * 0.01373atcea2A atta2A
Tire ID 1 TemperatureTPM221004750A - 40atcea2A atta2A
Tire ID 2 TemperatureTPM221004750B - 40atcea2A atta2A
Tire ID 3 TemperatureTPM221004750C - 40atcea2A atta2A
Tire ID 4 TemperatureTPM221004750D - 40atcea2A atta2A
Tire ID 1 PositionTPM222021750LOOKUP(A::1=FL:2=FR:3=RL:4=RR)atcea2A atta2A
Tire ID 2 PositionTPM222021750LOOKUP(B::1=FL:2=FR:3=RL:4=RR)atcea2A atta2A
Tire ID 3 PositionTPM222021750LOOKUP(C::1=FL:2=FR:3=RL:4=RR)atcea2A atta2A
Tire ID 4 PositionTPM222021750LOOKUP(D::1=FL:2=FR:3=RL:4=RR)atcea2A atta2A
Steering Angle2210047B3((SIGNED(A)*256)+B)*1.5
Master Cylinder TemperatureBrake2210067B0A-80
Clutchpack TemperatureFour Wheel Drive2210267B1(A*256+B)/128

This is not much yet, but at least I hope this is enough information for anyone to join into this reverse engineering party.

CSV file that can be imported into Torque app for the custom PIDs can be found here.

Footnotes

  1. formulas are the tricky part