OBD2 PIDs & Messages Explained
To get started recording OBD2 data, it’s helpful to understand the basics of the message structure.
In simplified terms, an OBD2 message is comprised of an identifier and data.
Further, the data is split in Mode, PID and data bytes Ah, Bh, Ch, Dh (in hexadecimal values) - cf. the figure below.
An example of a request/response CAN message for the PID 'Vehicle Speed' with a value of 50 km/h can look like this:
Request: 7DF 02 01 0D 55 55 55 55 55
Response: 7E8 03 41 0D 32 aa aa aa aa
Here the 32 is the hexadecimal value of 50.
Try to enter the response message (excl. 7e8 03) in our OBD2 message converter to confirm the result.
Below, each part of the OBD2 message is explained:
IDENTIFIER: For OBD2 messages, the identifier is standard 11-bit and used to distinguish between “request messages” (ID 7DF) and “response messages” (ID 7E8 to 7EF). Note that 7E8 will typically be where the main engine or ECU responds at.
LENGTH: This simply reflects the length in number of bytes of the remaining data (03 to 06). For the Vehicle Speed example, it is 02 for the request (since only 01 and 0D follow), while for the response it is 03 as both 41, 0D and 32 follow.
MODE: For requests, this will be between 01-0A. For responses the 0 is replaced by 4 (i.e. 41, 42, … , 4A). There are 10 modes as described in the SAE J1979 OBD2 standard. Mode 1 shows Current Data and is e.g. used for looking at real-time vehicle speed, RPM etc. Other modes are used to e.g. show or clear stored diagnostic trouble codes and show freeze frame data.
PID: For each mode, a list of standard OBD2 PIDs exist - e.g. in Mode 01 PID 0D is Vehicle Speed. For the full list, check out the aforementioned Wikipedia OBD2 PID overview. Each PID has a description and some have a specified minimum/maximum and conversion formula.
The formula for speed is e.g. simply A, meaning that the Ah data byte (which is in HEX) is converted to decimal to get the km/h converted value (i.e. 32 becomes 50 km/h above). For e.g. RPM (PID 0C), the formula is (256*A + B) / 4.
Ah, Bh, Ch, Dh: These are the data bytes in HEX, which need to be converted to decimal form before they are used in the PID formula calculations. Note that the last data byte (after Dh) is not used.
How to Log OBD2 Data?
OBD2 data logging works as follows:
- You connect a OBD2 scanner or OBD2 data logger to the OBD2 16 pin connector
- Via the tool, you enter “request messages” (queries) transmitted via the CAN-bus
- The relevant ECUs react and send “response messages” via the CAN-bus
This stuff is important:
It means that you will not see OBD2 data if you just plug in a "passive" logger or interface to your car.
(This would however yield raw CAN data since this is "broadcasted").
To log OBD2 response messages, your OBD2 data logger needs to be able to send the request messages.
For an example of requests/responses, check out a practical OBD2 PID logging example with the CANLoggerX000.
The above example is deliberately manual - we also have a simpler way to log OBD2 data.