OBD-II PIDs

P-codes, or OBD-II PIDs On Board Diagnostics "Parameter IDs", are codes used to request data from a vehicle, used as a diagnostic tool. These codes are part of SAE standard J/1979, required to be implemented in all cars sold in North America since 1996.

Typically, a car mechanic will use PIDs with a scan tool connected to the vehicle's OBD-II connector.
 * The mechanic enters the PID
 * The scan tool sends to the vehicle's bus (CAN, VPW, PWM, ISO, KWP. After 2008, CAN only)
 * A device on the bus recognizes the PID as one it is responsible for, and reports the value for that PID to the bus
 * The scan tool reads the response, and shows it to the mechanic

=Modes= There are nine modes of operation described in the OBD-II standard SAE J1979. They are:
 * 1) Show current data
 * 2) Show freeze frame data
 * 3) Show stored Diagnostic Trouble Codes
 * 4) Clear Diagnostic Trouble Codes and stored values
 * 5) Test results, oxygen sensor monitoring
 * 6) Test results, other component/system monitoring (e.g.: Catalyst, EVAP)
 * 7) Show pending Diagnostic Trouble Codes (detected during current or last driving cycle)
 * 8) Control operation of on-board component/system
 * 9) Request vehicle information

Vehicle manufactures are not required to support all modes.

Each manufacturer may define additional modes above #9 (e.g.: mode 22 as defined by SAE J2190 for Ford/GM, mode 21 for Toyota) for other information (e.g.: the voltage of the Traction Battery in a HEV).

=PIDs= The table below shows the standard OBD-II PIDs as defined by SAE J1979. The expected response for each PID is given, along with information on how to translate the response into meaningful data. Again, not all vehicles will support all PIDs and there can be manufacturer-defined custom PIDs that are not defined in the OBD-II standard.

Note that modes 1 and 2 are basically identical, except that Mode 1 provides current information, whereas Mode 2 provides a snapshot of the same data taken at the point when the last diagnostic trouble code was set. The exceptions are PID 01, which is only available in Mode 1, and PID 02, which is only available in Mode 2. If Mode 2 PID 02 returns zero, then there is no snapshot and all other Mode 2 data is meaningless.

In the formula column, letters A, B, C, etc. represent the decimal equivalent of the first, second, third, etc. bytes of data. Where a (?) appears, contradictory or incomplete information was available. Someone with a copy of the 2006 SAE HS-3000 should fact-check these.

Bitwise encoded PIDs
Some of the PIDs in the above table cannot be explained with a simple formula. A more elaborate explanation of these data is provided here:

Mode 1 PID 01: A request for this PID returns 4 bytes of data. The first byte contains two pieces of information. Bit A7 (the seventh bit of byte A, the first byte) indicates whether or not the MIL (check engine light) is illuminated. Bits A0 through A6 represent the number of diagnostic trouble codes currently flagged in the ECU. The second, third, and fourth bytes give information about the availability and completeness of certain on-board tests. Note that test availability signified by set (1) bit; completeness signified by reset (0) bit: Test available     Test incomplete Misfire               B0                   B4           Fuel System            B1                   B5 Components             B2                   B6 Reserved               B3                   B7 Catalyst               C0                   D0 Heated Catalyst        C1                   D1 Evaporative System     C2                   D2 Secondary Air System   C3                   D3 A/C Refrigerant        C4                   D4 Oxygen Sensor          C5                   D5 Oxygen Sensor Heater   C6                   D6 EGR System             C7                   D7

Mode 1 PID 03: A request for this PID returns 2 bytes of data. The first byte describes fuel system #1. Only one bit should ever be set. A0    Open loop due to insufficient engine temperature A1    Closed loop, using oxygen sensor feedback to determine fuel mix A2    Open loop due to engine load OR fuel cut due to deceleration A3    Open loop due to system failure A4    Closed loop, using at least one oxygen sensor but there is a fault in the feedback system A5-A7 Always zero The second byte describes fuel system #2 (if it exists) and is encoded identically to the first byte.

Mode 1 PID 12: A request for this PID returns a single byte of data which describes the secondary air status. Only one bit should ever be set. A0    Upstream of catalytic converter A1    Downstream of catalytic converter A2    From the outside atmosphere or off A3-A7 Always zero

Mode 1 PID 1C: A request for this PID returns a single byte of data which describes which OBD standards this ECU was designed to comply with. The hexadecimal and binary representations of the data byte are shown below next to what it implies: 0x01 00000001b    OBD-II as defined by the CARB 0x02 00000010b    OBD as defined by the EPA 0x03 00000011b    OBD and OBD-II 0x04 00000100b    OBD-I 0x05 00000101b    Not meant to comply with any OBD standard 0x06 00000110b    EOBD

Mode 1 PID 41: A request for this PID returns 4 bytes of data. The first byte is always zero. The second, third, and fourth bytes give information about the availability and completeness of certain on-board tests. Note that test availability signified by set (1) bit; completeness signified by reset (0) bit: Test enabled      Test incomplete Misfire               B0                   B4           Fuel System            B1                   B5 Components             B2                   B6 Reserved               B3                   B7 Catalyst               C0                   D0 Heated Catalyst        C1                   D1 Evaporative System     C2                   D2 Secondary Air System   C3                   D3 A/C Refrigerant        C4                   D4 Oxygen Sensor          C5                   D5 Oxygen Sensor Heater   C6                   D6 EGR System             C7                   D7

Mode 3: (no PID required)  A request for this mode returns information about the DTCs that have been set. The response will be an integer number of packets each containing 6 data bytes. Each trouble code requires 2 bytes to describe, so the number of packets returned will be the number of codes divided by three, rounded up. A trouble code can be decoded from each pair of data bytes. The first character in the trouble code is determined by the first two bits in the first byte: A7 A6   First DTC character -- --   --- 0  0    P - Powertrain 0 1    C - Chassis 1 0    B - Body 1 1    U - Network

As of September 2005, only P and U generic DTCs are standardized.

The second character in the DTC is a number defined by A5 A4   Second DTC character -- --    0  0    0 0  1    1 1  0    2 1  1    3 The third character in the DTC is a number defined by A3 A2 A1 A0    Third DTC character -- -- -- --   --- 0  0  0  0    0 0  0  0  1    1      0  0  1  0    2 0  0  1  1    3 0  1  0  0    4 0  1  0  1    5 0  1  1  0    6 0  1  1  1    7 1  0  0  0    8 1  0  0  1    9 The fourth and fifth characters are defined in the same way as the third, but using bits B7..B4 and B3..B0. The resulting five-character code should look something like "U0158" and can be looked up in a table of OBD-II DTCs.

Fuel Type Coding
Mode 1 PID 0x51 returns a value from an enumerated list giving the fuel type of the vehicle. The fuel type is returned as a single byte, and the value is given by 01   Gasoline 02   Methanol 03   Ethanol 04   Diesel 05   LPG 06   CNG 07   Propane 08   Electric 09   Bifuel running Gasoline 0A   Bifuel running Methanol 0B   Bifuel running Ethanol 0C   Bifuel running LPG 0D   Bifuel running CNG 0E   Bifuel running Prop 0F   Bifuel running Electricity 10   Bifuel mixed gas/electric 11   Hybrid gasoline 12   Hybrid Ethanol 13   Hybrid Diesel 14   Hybrid Eelctric 15   Hybrid Mixed fuel 16   Hybrid Regenerative

= CAN Bus format =

The PID query and response occurs on the vehicle's CAN Bus, using 3 particular CAN ids.

Query
The PID query is sent to the vehicle on the CAN bus at ID 7DFh, using 8 data bytes. The bytes are:

Response
The vehicle responds to the PID query on the CAN bus with two messages, at IDs 7E8h and 7E9h. For standard (SAE) messages, the two messages are identical. For vehicle specific messages, they differ. Even though the number of bytes in the returned value is variable, the message uses 8 data bytes regardless. The bytes are: