Need a clear, practical understanding of the Obd2 Standard?
This guide provides an in-depth introduction to the On-Board Diagnostic (OBD2) protocol, covering everything from the OBD2 connector and OBD2 parameter IDs (PIDs) to its relationship with the CAN bus.
Note: This is a comprehensive guide designed to enhance the original content, offering deeper insights into requesting and decoding OBD2 data, exploring key applications, and providing practical tips for professionals and enthusiasts alike.
Discover why this is becoming the go-to OBD2 resource for those seeking a thorough understanding.
You can also explore our introductory OBD2 video above – or access the PDF version for offline reading.
In this article
Author: Martin Falch (updated January 2025)
Download as PDF
What is the OBD2 Standard?
The OBD2 standard represents your vehicle’s integrated self-diagnostic system. It is a globally recognized protocol that enables the retrieval of diagnostic trouble codes (DTCs) and real-time operational data through the standardized OBD2 connector. This system is fundamental for modern automotive diagnostics and vehicle health monitoring.
You’ve likely already encountered OBD2 in action:
Have you ever seen the check engine light illuminate on your dashboard?
This is your car signaling a potential issue. Automotive technicians rely on OBD2 scanners to accurately diagnose these problems.
The diagnostic process involves connecting an OBD2 reader to the standardized 16-pin OBD2 connector, typically located within easy reach near the steering wheel. The scanner transmits ‘OBD2 requests’ to the vehicle’s computer, and the car responds with ‘OBD2 responses’. These responses contain a wealth of information, including vehicle speed, fuel levels, and crucial Diagnostic Trouble Codes (DTCs). This streamlined communication significantly accelerates troubleshooting and repair processes.
Understanding OBD2: On-Board Diagnostics and the Malfunction Indicator Light (MIL) for Vehicle Scans
OBD2 Standard Compatibility: Does Your Car Support It?
In most cases: Yes, it probably does!
The vast majority of modern gasoline and diesel vehicles, excluding fully electric cars, are equipped with OBD2 support and predominantly utilize the CAN bus communication protocol. However, for older vehicles, the presence of a 16-pin OBD2 connector doesn’t automatically guarantee OBD2 compliance. Some may feature the connector without fully implementing the OBD2 standard. To ascertain OBD2 compliance, consider the vehicle’s origin and year of purchase:
OBD2 Compliance Guide: Determining if Your Vehicle Adheres to OBD2 Standards in EU, US, and CAN Regions
A Look into the OBD2 Standard History
The OBD2 standard has its roots in California, where the California Air Resources Board (CARB) mandated OBD systems in all new vehicles starting from 1991 to monitor and control vehicle emissions. This initiative was a response to growing environmental concerns and the need for effective emissions management.
The Society of Automotive Engineers (SAE) played a crucial role in formalizing the OBD2 standard, standardizing both Diagnostic Trouble Codes (DTCs) and the physical OBD connector across different vehicle manufacturers (SAE J1962). This standardization was a significant step towards making vehicle diagnostics more accessible and uniform.
The global rollout of the OBD2 standard occurred in phases:
- 1996: OBD2 became mandatory in the USA for all cars and light trucks. This marked the widespread adoption of OBD2 in the largest automotive market.
- 2001: The European Union mandated OBD2 for gasoline-powered cars. This extended the reach of OBD2 to Europe, under the European On-Board Diagnostics (EOBD) initiative.
- 2003: EOBD requirements in the EU expanded to include diesel vehicles. This ensured comprehensive emissions monitoring across all common passenger vehicle types in Europe.
- 2005: OBD2 requirements in the US were further extended to medium-duty vehicles, broadening its application beyond passenger cars and light trucks.
- 2008: A significant technical shift occurred in the US as vehicles were required to use ISO 15765-4 (CAN) as the foundational protocol for OBD2 communication. This adoption of CAN bus enhanced the data transfer capabilities and reliability of OBD2 systems.
- 2010: The OBD2 mandate in the US reached its final phase, becoming compulsory for heavy-duty vehicles, completing the implementation across all vehicle classes.
OBD2 Standard Timeline: From Emission Control Origins to Modern Car Data and CAN Bus Integration
Historical Timeline of OBD2: Key Milestones in On-Board Diagnostics Development
The Future of OBD: OBD3, Remote Diagnostics, Emission Testing, Cloud Integration, and IoT Technologies
The Future Trajectory of the OBD2 Standard
OBD2 remains a cornerstone of vehicle diagnostics, but its evolution is ongoing. Several key trends are shaping its future:
Initially conceived for emissions monitoring and testing, legislated OBD2 faces new challenges and adaptations, especially with the rise of electric vehicles. Notably, electric vehicles are not mandated to support OBD2 in its traditional form. This is reflected in the industry, where most modern EVs do not support standard OBD2 requests. Instead, they commonly employ OEM-specific UDS (Unified Diagnostic Services) communication protocols. This shift often complicates data extraction from EVs, requiring reverse engineering efforts to decode proprietary data formats. However, successful reverse engineering efforts have led to solutions for accessing data from brands like Tesla, Hyundai/Kia, Nissan, and VW/Skoda EVs, as highlighted in our case studies.
The limitations of current OBD2 implementations, particularly in data richness and lower-layer protocols, are driving the development of advanced alternatives. WWH-OBD (World-Wide Harmonized OBD) and OBDonUDS (OBD on UDS) represent significant advancements. These protocols aim to modernize OBD communication by building upon the UDS protocol, offering enhanced capabilities and standardization. For a deeper understanding of these emerging protocols, refer to our introduction to UDS.
In an increasingly connected world, traditional OBD2 testing methods are becoming less efficient. Manual emissions checks are time-intensive and costly, prompting the exploration of more streamlined solutions.
OBD3, incorporating telematics into all vehicles, is emerging as a potential solution. OBD3 envisions equipping vehicles with a small radio transponder, similar to those used for electronic toll collection. This technology would enable the wireless transmission of the car’s vehicle identification number (VIN) and DTCs to a central server for automated monitoring and diagnostics. This approach could revolutionize emission testing and vehicle health management.
Current technologies already facilitate CAN and OBD2 data transfer via wireless communication. Devices like the CANedge2 WiFi CAN logger and the CANedge3 3G/4G CAN logger exemplify this trend. While offering cost savings and convenience, the implementation of OBD3 raises political and privacy concerns related to surveillance.
While OBD2 was initially designed for static emission control checks, its utility has expanded significantly. Today, third-party access to real-time OBD2 data is widely utilized through OBD2 dongles, CAN loggers and similar devices. However, the German automotive industry is advocating for changes that could reshape this landscape:
“OBD has been designed to service cars in repair shops. In no way has it been intended to allow third parties to build a form of data-driven economy on the access through this interface“
– Christoph Grote, SVP Electronics, BMW (2017)
The proposal suggests disabling OBD2 functionality during normal driving conditions and centralizing data collection through manufacturer-controlled servers. This shift would give manufacturers greater control over ‘automotive big data’.
Arguments for this change often cite security benefits, such as mitigating the risk of car hacking. However, many industry observers view this as a commercially motivated strategy. The ultimate outcome of these proposals remains uncertain, but it could significantly disrupt the market for third-party OBD2 services.
OBD2 in the Age of Electric Vehicles: Trends Towards Limited Data Access
Enhance Your CAN Bus Expertise
Looking to become a CAN bus expert?
Access our comprehensive collection of 12 ‘simple introductions’ in a single, 160+ page PDF guide:
Download now
Decoding OBD2 Standards: Protocols and Layers
On-board diagnostics, OBD2, operates as a higher-layer protocol, essentially a communication ‘language’. In contrast, CAN (Controller Area Network) functions as the communication medium, akin to a ‘phone line’. This places OBD2 alongside other CAN-based higher-layer protocols like J1939, CANopen, and NMEA 2000.
Specifically, the OBD2 standards define critical elements, including the OBD2 connector specifications, lower-layer communication protocols, OBD2 parameter IDs (PIDs), and more. These specifications ensure interoperability and consistent diagnostic procedures across different vehicle makes and models.
These standards can be visualized using the 7-layer OSI model, a conceptual framework that organizes network functions into distinct layers. The following sections will delve into the most significant standards within this model.
In the OSI model representation, it’s important to note the overlapping coverage by both SAE (Society of Automotive Engineers) and ISO (International Organization for Standardization) standards. Generally, SAE standards are primarily associated with OBD regulations in the USA, while ISO standards are more aligned with EU regulations. Many of these standards are technically very similar, such as SAE J1979 and ISO 15031-5 for diagnostic services, and SAE J1962 and ISO 15031-3 for the OBD connector.
OBD2 and CAN Bus in the OSI Model: Illustrating ISO 15765 and ISO 11898 Layered Standards
OBD2 Connector Pinout: Type A Female Socket, Data Link Connector (DLC) Details
The OBD2 Connector: SAE J1962 and Physical Interface
The 16-pin OBD2 connector is the standardized interface that provides easy access to your vehicle’s diagnostic data. This connector is meticulously defined by the standard SAE J1962 / ISO 15031-3, ensuring uniformity across vehicle manufacturers and diagnostic tools.
The illustration above shows a typical Type A OBD2 pin connector, also known as a Data Link Connector (DLC). This connector is the physical gateway to your vehicle’s diagnostic system.
Key aspects of the OBD2 connector include:
- Its location is generally near the steering wheel for easy access, but it may be concealed behind a panel in some vehicles.
- Pin 16 consistently provides battery power, often remaining live even when the ignition is switched off. This allows diagnostic tools to operate and communicate with the vehicle’s systems without the engine running.
- The specific OBD2 pinout configuration is protocol-dependent. Different communication protocols may utilize different pins for data transmission and reception.
- CAN bus, being the most prevalent lower-layer protocol, typically uses pins 6 (CAN-High) and 14 (CAN-Low) for data communication.
OBD2 Connector Types: Type A versus Type B
In practical applications, you may encounter both Type A and Type B OBD2 connectors. Type A connectors are predominantly found in passenger cars and light-duty vehicles, while Type B connectors are more common in medium and heavy-duty vehicles.
As depicted in the illustration, Type A and Type B connectors share similar OBD2 pinouts but differ primarily in their power supply outputs. Type A typically provides a 12V power supply, suitable for car electronics, whereas Type B is designed for 24V systems, common in trucks and buses. Furthermore, communication baud rates often vary. Cars commonly use 500K baud rate, while heavy-duty vehicles often use 250K, with increasing support for 500K in newer heavy-duty models.
A key physical distinction between the two types is the interrupted groove in the middle of the Type B OBD2 connector. This design feature ensures that a Type B OBD2 adapter cable is universally compatible with both Type A and Type B sockets. However, a Type A connector will not physically fit into a Type B socket due to this groove.
SAE J1962 OBD2 Connector Types: Comparing Type A and Type B for Cars, Vans, and Trucks (12V vs 24V)
ISO 15765: The Relationship Between OBD2 and CAN Bus Standards
OBD2 and CAN Bus Integration: ISO 15765-4 Standard
Since 2008, the CAN bus protocol has become the mandatory lower-layer communication standard for OBD2 in all vehicles sold in the United States, as mandated by ISO 15765. This standard solidified CAN bus as the primary physical layer for OBD2 diagnostics.
ISO 15765-4, also known as Diagnostics over CAN (DoCAN), outlines a specific set of constraints and specifications applied to the CAN standard (ISO 11898) for OBD2 implementation. It standardizes the CAN interface for diagnostic test equipment, focusing on the physical, data link, and network layers of the OSI model.
Key specifications within ISO 15765-4 include:
- The CAN bus bit rate must be either 250 Kbps or 500 Kbps. These standardized bit rates ensure compatibility and reliable communication across different vehicle networks.
- Both 11-bit (standard) and 29-bit (extended) CAN identifiers are permitted. This flexibility accommodates the addressing needs of various vehicle architectures and network complexities.
- Specific CAN IDs are reserved for OBD requests and responses. These predefined IDs ensure that diagnostic messages are correctly routed and prioritized within the CAN network.
- The diagnostic CAN frame data payload is restricted to a maximum of 8 bytes. This limitation is inherent to the CAN standard and influences how OBD2 data is structured and transmitted.
- The OBD2 adapter cable connecting the diagnostic tool to the vehicle must not exceed 5 meters in length. This constraint minimizes signal degradation and maintains reliable communication quality.
OBD2 CAN Identifiers: 11-bit and 29-bit Addressing
All OBD2 communication over CAN bus relies on a request-response message exchange. Diagnostic tools send requests, and vehicle ECUs respond with diagnostic information.
In most passenger vehicles, 11-bit CAN identifiers are predominantly used for OBD2 communication. The ‘Functional Addressing’ ID, 0x7DF, is central to this approach. When a diagnostic tool sends a request using CAN ID 0x7DF, it’s effectively broadcasting a query to all OBD2-compliant Electronic Control Units (ECUs) in the vehicle, asking if they have data to report for the requested parameter, as defined in ISO 15765-4. In contrast, CAN IDs ranging from 0x7E0 to 0x7E7 are reserved for ‘Physical Addressing’ requests. These are less frequently used in typical OBD2 diagnostics and allow for direct communication with a specific ECU.
ECUs respond to diagnostic requests using 11-bit CAN IDs in the range of 0x7E8 to 0x7EF. The most commonly used response ID is 0x7E8, typically originating from the ECM (Engine Control Module). Another frequently encountered response ID is 0x7E9, often associated with the TCM (Transmission Control Module).
In certain vehicle categories, particularly vans and medium to heavy-duty vehicles, extended 29-bit CAN identifiers may be employed for OBD2 communication instead of the standard 11-bit IDs. This is often due to the more complex network architectures and addressing requirements in these larger vehicles.
When 29-bit identifiers are used, the ‘Functional Addressing’ CAN ID becomes 0x18DB33F1. This extended ID serves the same broadcast query function as 0x7DF in 11-bit systems, but within the 29-bit addressing space.
Correspondingly, response messages in 29-bit OBD2 systems are typically observed with CAN IDs ranging from 0x18DAF100 to 0x18DAF1FF, with common examples being 0x18DAF110 and 0x18DAF11E. These response IDs can also be represented in the ‘J1939 PGN’ format. Specifically, the PGN 0xDA00 (decimal 55808) is designated in the J1939-71 standard as ‘Reserved for ISO 15765-2’, further linking OBD2 over CAN with established automotive networking standards.
OBD2 Protocol Communication: Request and Response Frames with PID Data Parameters
Contrasting OBD2 and OEM-Specific Proprietary CAN Bus Protocols for Vehicle Data
OBD2 vs. Proprietary CAN Protocols: Understanding the Difference
It’s crucial to understand that a vehicle’s Electronic Control Units (ECUs) operate primarily using OEM-specific proprietary CAN protocols, not OBD2. OBD2 is implemented as a secondary diagnostic protocol, layered on top of the vehicle’s core communication network. Each Original Equipment Manufacturer (OEM) develops its own unique CAN protocols tailored to their specific vehicle brands, models, and production years. These proprietary protocols govern the day-to-day operation and communication between ECUs within the vehicle. Unless you are the OEM and have access to the proprietary specifications, interpreting this raw CAN data is typically not possible without significant reverse engineering efforts.
When a CAN bus data logger is connected to a vehicle’s OBD2 port, you may observe OEM-specific CAN data traffic alongside OBD2 communication. This OEM-specific data is often broadcast at high rates, typically 1000-2000 frames per second, reflecting the real-time control and monitoring activities within the vehicle. However, in many newer vehicles, a ‘gateway’ module is implemented. This gateway acts as a network security and management device, often blocking direct access to the OEM-specific CAN data through the OBD2 port and exclusively enabling OBD2 communication via this interface. This design choice enhances vehicle security and can limit unauthorized access to critical vehicle systems.
In essence, think of OBD2 as an ‘additional’ higher-layer protocol that operates in parallel with the OEM-specific protocol. It’s a standardized diagnostic interface that allows external tools to query specific emissions-related and diagnostic data without interfering with the vehicle’s primary communication network.
Bit-rate and ID Validation in OBD2 Communication
As previously discussed, OBD2 communication via CAN bus can utilize two possible bit rates (250 Kbps, 500 Kbps) and two CAN ID lengths (11-bit, 29-bit). This results in four potential protocol combinations that a diagnostic tool must be prepared to handle. In modern passenger vehicles, the combination of 500 Kbps bit rate and 11-bit CAN IDs is the most prevalent. However, robust diagnostic tools must systematically determine the correct combination for each vehicle to ensure reliable communication.
ISO 15765-4 provides detailed recommendations for a systematic initialization sequence to automatically detect the appropriate protocol combination. This process, illustrated in the flowchart below, leverages the fact that all OBD2-compliant vehicles are required to respond to a specific mandatory OBD2 request (Service 0x01 PID 0x00, as detailed in the OBD2 PID section). Furthermore, it exploits the behavior of the CAN bus network – transmitting data with an incorrect bit rate will result in the generation of CAN error frames, which can be detected by the diagnostic tool.
More recent versions of ISO 15765-4 acknowledge that vehicles may implement OBD communication via either OBDonUDS (OBD on Unified Diagnostic Services) or OBDonEDS (OBD on Emission Diagnostic Services). This article primarily focuses on OBD2/OBDonEDS (defined by ISO 15031-5/SAE J1979) as it is the more commonly encountered protocol in non-electric vehicles today. WWH-OBD/OBDonUDS (defined by ISO 14229, ISO 27145-3/SAE J1979-2) is primarily used in European trucks and buses, representing a more advanced diagnostic approach.
To differentiate between OBDonEDS and OBDonUDS protocols, a diagnostic tool may perform additional protocol detection steps. Specifically, it can send UDS requests using 11-bit or 29-bit functional address IDs for service 0x22 and Data Identifier (DID) 0xF810 (protocol identification). Vehicles that support OBDonUDS are required to have ECUs that respond to this specific DID, allowing the diagnostic tool to identify the protocol in use.
In practice, OBDonEDS (also referred to as OBD2, SAE OBD, EOBD, or ISO OBD) remains the dominant protocol in most non-EV vehicles currently on the road. WWH-OBD is gaining traction in commercial vehicle applications, reflecting the evolving landscape of automotive diagnostics.
ISO 15765-4 OBD2 Bit-Rate and CAN ID Validation Flowchart
OBD2 Lower-Layer Protocols: ISO 15765 (CAN), KWP2000, SAE J1850, and ISO 9141
Five Lower-Layer OBD2 Protocols: Beyond CAN
While CAN bus (ISO 15765) is the predominant lower-layer protocol for OBD2 in the vast majority of modern vehicles, especially those manufactured post-2008, it’s important to recognize that older vehicles may utilize one of four other lower-layer protocols. If you are working with pre-2008 vehicles, understanding these alternative protocols and their associated OBD2 connector pinouts is essential for establishing communication. The pinout configuration can often provide clues about the protocol in use.
The five lower-layer protocols historically used for OBD2 communication are:
- ISO 15765 (CAN bus): As previously discussed, CAN bus is mandatory in US vehicles since 2008 and is now the most widely used protocol globally. Its robustness and high-speed capabilities make it ideal for modern vehicle networks.
- ISO 14230-4 (KWP2000): The Keyword Protocol 2000 (KWP2000) was a common protocol in vehicles manufactured around 2003 and later, particularly in Asian markets and some European models. It offered a step up in performance from earlier protocols.
- ISO 9141-2: ISO 9141-2 was prevalent in European, Chrysler, and Asian vehicles manufactured in the early 2000s (approximately 2000-2004). It was one of the earlier standardized protocols for OBD diagnostics.
- SAE J1850 (VPW – Variable Pulse Width Modulation): SAE J1850 VPW was primarily used in older General Motors (GM) vehicles. It employed a variable pulse width modulation scheme for data transmission.
- SAE J1850 (PWM – Pulse Width Modulation): SAE J1850 PWM was predominantly found in older Ford vehicles. It utilized pulse width modulation, a different signaling method compared to VPW, for communication.
ISO-TP: Transporting OBD2 Messages via ISO 15765-2
All OBD2 data exchange over CAN bus relies on a transport protocol known as ISO-TP (ISO 15765-2). This protocol is crucial because it enables the transmission of data payloads that exceed the 8-byte limit of a standard CAN frame. This capability is essential in OBD2 for operations like retrieving the Vehicle Identification Number (VIN) or Diagnostic Trouble Codes (DTCs), which often require more than 8 bytes of data. ISO 15765-2 provides mechanisms for segmentation (dividing large messages into smaller frames), flow control (managing the rate of data transmission), and reassembly (reconstructing the original message from segmented frames). For a more detailed explanation of ISO-TP principles, please refer to our introduction to UDS.
However, it’s worth noting that many common OBD2 data requests and responses, especially those involving real-time parameters (PIDs), fit within a single CAN frame. In these single-frame scenarios, ISO 15765-2 specifies the use of a ‘Single Frame’ (SF) format. In a Single Frame, the first data byte (also known as the PCI – Protocol Control Information field) contains the payload length. This length indicates the number of bytes in the payload that carry OBD2-related communication data, excluding any padding bytes. This leaves up to 7 bytes within the CAN data frame to carry the actual OBD2 message content.
ISO 15765-2 ISO-TP Frame Types for OBD2 Communication: Single Frame, First Frame, Consecutive Frame, and Flow Control Frame
Decoding the OBD2 Diagnostic Message: SAE J1979, ISO 15031-5
To fully understand OBD2 communication over CAN bus, let’s examine the structure of a raw ‘Single Frame’ OBD2 CAN message. In a simplified representation, an OBD2 message consists of a CAN identifier, a data length indicator (PCI field), and the actual data payload. The data payload itself is further structured into components: Mode, Parameter ID (PID), and Data Bytes.
OBD2 Message Structure: Breakdown of Raw Frame, Mode, PID, and Data Bytes
Example: OBD2 Request and Response Sequence
Before dissecting each component of the OBD2 message, consider this practical example of a request-response exchange for the ‘Vehicle Speed’ parameter.
In this scenario, an external diagnostic tool initiates a request by sending a CAN message to the vehicle. This request message uses CAN ID 0x7DF and contains a 2-byte payload: Mode 0x01 and PID 0x0D. Mode 0x01 signifies a request for current data, and PID 0x0D is the specific Parameter ID for Vehicle Speed.
The vehicle’s ECU, upon receiving this request, responds with a CAN message using CAN ID 0x7E8. The response payload is 3 bytes long and includes the vehicle speed value in the 4th byte (data byte), which is 0x32 (equivalent to 50 in decimal).
By consulting the OBD2 PID specifications for PID 0x0D, we can determine the decoding rules for this parameter. In this case, the raw byte value 0x32 translates to a physical value of 50 km/h for vehicle speed.
In the following sections, we will delve deeper into OBD2 modes and PIDs, providing a comprehensive understanding of these key elements of the OBD2 standard.
OBD2 Request and Response Example: CAN ID 7DF Request, 7E8 Response for Vehicle Speed
OBD2 PID Example: Vehicle Speed Parameter ID (0D) and Data Interpretation
OBD2 Diagnostic Services: 10 Modes Including Current Data, Freeze Frame, and DTC Clearing
The 10 OBD2 Diagnostic Services (Modes)
The OBD2 standard defines 10 distinct diagnostic services, often referred to as ‘modes’. Each mode serves a specific purpose in vehicle diagnostics. Mode 0x01, for example, is used to retrieve current, real-time data parameters, providing live sensor readings and vehicle operating conditions. Other modes are dedicated to accessing and managing Diagnostic Trouble Codes (DTCs), such as displaying stored DTCs, clearing DTCs, and accessing freeze frame data, which captures vehicle conditions when a DTC was set.
It’s important to note that vehicle manufacturers are not obligated to support all 10 standardized OBD2 modes. The level of mode support can vary depending on the vehicle make, model, and year. Furthermore, manufacturers may implement OEM-specific OBD2 modes beyond the 10 standardized modes to provide access to proprietary diagnostic information or functionalities.
In the structure of OBD2 messages, the mode is always located in the second byte of the data payload. In a request message, the mode code is included directly (e.g., 0x01 for Mode 1). In a response message, however, a consistent pattern is followed: 0x40 is added to the requested mode code (e.g., a response to Mode 0x01 will have a mode code of 0x41 in the response). This offset helps to clearly distinguish response messages from request messages within the OBD2 communication flow.
OBD2 Parameter IDs (PIDs): Accessing Specific Data
Within each OBD2 mode, Parameter IDs (PIDs) are used to specify the particular data parameter being requested or reported. PIDs are essentially codes that identify specific pieces of diagnostic information.
For example, Mode 0x01, which is used for retrieving current data, encompasses a comprehensive list of approximately 200 standardized PIDs. These PIDs cover a wide range of real-time vehicle parameters, including but not limited to vehicle speed, engine RPM, coolant temperature, oxygen sensor readings, and fuel level. However, it is crucial to understand that not all vehicles support every PID defined within Mode 0x01. The actual PIDs supported by a vehicle are determined by the manufacturer and the vehicle’s specific systems and sensors. In practice, most vehicles only support a subset of the available standardized PIDs.
Among the vast array of PIDs, one PID holds a special significance: PID 0x00 within Mode 0x01. If an emissions-related ECU (Electronic Control Unit) is designed to support any OBD2 services at all, it is mandatorily required to support Mode 0x01 PID 0x00. When a diagnostic tool sends a request for Mode 0x01 PID 0x00, the vehicle’s ECU responds by providing a bitmask that indicates which PIDs in the range 0x01-0x20 are supported by that ECU. This makes PID 0x00 an invaluable tool for performing a fundamental ‘OBD2 compatibility test’ and for discovering the range of supported PIDs. Building upon this, PIDs 0x20, 0x40, 0x60, 0x80, 0xA0, and 0xC0 serve a similar purpose. Requesting these PIDs allows a diagnostic tool to determine the support status for subsequent blocks of PIDs within Mode 0x01 (0x21-0x40, 0x41-0x60, and so on).
OBD2 Protocol Communication: Request and Response Frames with PID Data Parameters
OBD2 PID Overview Tool: Service 01 PID Lookup and Data Interpretation
Practical Resource: OBD2 PID Overview Tool
The appendices of the SAE J1979 and ISO 15031-5 standards contain essential scaling and decoding information for standardized OBD2 PIDs. This information is crucial for converting raw data bytes received from the vehicle into meaningful physical values, such as kilometers per hour or degrees Celsius, as previously explained in our CAN bus introduction.
To simplify the process of working with Mode 0x01 PIDs, we offer a dedicated OBD2 PID overview tool. This tool is designed to assist you in constructing OBD2 request frames for specific PIDs and in dynamically decoding the OBD2 responses received from the vehicle. It streamlines the process of accessing and interpreting real-time vehicle data.
OBD2 PID overview tool
Practical Guide: Logging and Decoding OBD2 Data
In this section, we provide a hands-on example of how to log OBD2 data using the CANedge CAN bus data logger. The CANedge is versatile and configurable, allowing you to define custom CAN frames for transmission, making it ideally suited for OBD2 data logging applications.
Once configured with your desired OBD2 requests, the CANedge device can be easily connected to your vehicle’s OBD2 port using our OBD2-DB9 adapter cable. This direct connection enables seamless data acquisition from the vehicle’s diagnostic system.
OBD2 Data Logger Setup: Requesting PID Data with CAN IDs 7DF and 7E8
Validating CAN Bit-Rate for OBD2 Communication
Reviewing Supported PIDs: OBD2 Validation Responses in asammdf
Step #1: Validate Bit-rate, CAN IDs, and Supported PIDs
As previously discussed, ISO 15765-4 outlines a procedure for determining the correct bit-rate and CAN IDs used by a specific vehicle for OBD2 communication. You can utilize the CANedge data logger to systematically test and identify these parameters, as described below (refer to the CANedge Introduction for detailed setup instructions):
- Bit-rate Validation: Begin by attempting to transmit a CAN frame at a bit rate of 500 Kbps. Monitor for successful transmission. If transmission fails, repeat the test at 250 Kbps. Successful transmission at either bit rate indicates the correct bit rate for OBD2 communication with the target vehicle.
- Bit-rate Configuration: Once the correct bit rate is identified, configure the CANedge to use this bit rate for all subsequent OBD2 communication.
- Supported PID Discovery: Send a series of ‘Supported PIDs’ requests (Mode 0x01 PID 0x00, PID 0x20, PID 0x40, etc.). Analyze the responses received from the vehicle’s ECUs.
- CAN ID Determination: Based on the CAN IDs observed in the response messages, determine whether the vehicle is using 11-bit or 29-bit CAN identifiers for OBD2 communication.
- Supported PID List: Examine the data payload of the response messages to identify the specific PIDs supported by the vehicle. The response to PID 0x00, in particular, provides a bitmask indicating support for PIDs 0x01-0x20.
We provide pre-configured CANedge configurations that streamline these initial validation tests, making the setup process easier.
In most non-electric vehicles manufactured in 2008 or later, you can typically expect to find support for 40-80 PIDs, utilizing a 500 Kbps bit rate, 11-bit CAN IDs, and the standard OBD2/OBDonEDS protocol.
As illustrated in the asammdf GUI screenshot, it is common to receive multiple responses to a single OBD2 request, especially when using the functional addressing request ID 0x7DF. This occurs because the 0x7DF request ID effectively broadcasts the request to all OBD2-compliant ECUs on the vehicle network, and multiple ECUs may respond. Since all OBD2/OBDonEDS-compliant ECUs are mandated to support service 0x01 PID 0x00, you will often observe numerous responses to this specific PID. As you progress to subsequent ‘Supported PIDs’ requests (PID 0x20, PID 0x40, etc.), you will typically notice a gradual reduction in the number of responding ECUs, as fewer ECUs support the extended PID ranges. It’s also worth noting in the example screenshot that the ECM (Engine Control Module, ID 0x7E8) appears to support all the PIDs that are supported by other ECUs in this particular vehicle. This observation suggests that network busload could potentially be reduced by directing subsequent requests specifically to the ECM using the ‘Physical Addressing’ CAN ID 0x7E0, instead of broadcasting to all ECUs.
Step #2: Configure OBD2 PID Requests for Data Logging
Having successfully identified the PIDs supported by your vehicle, along with the correct bit rate and CAN IDs, you are now ready to configure the CANedge to log the OBD2 data parameters of interest.
When setting up your CANedge transmit list for OBD2 data logging, consider the following best practices:
- CAN ID Strategy: Transition to using ‘Physical Addressing’ request IDs (e.g., 0x7E0, 0x7E1, etc.) instead of the functional addressing ID 0x7DF. This approach directs requests to specific ECUs, minimizing redundant responses and reducing network busload, especially when you are primarily interested in data from specific modules like the ECM or TCM.
- Request Spacing: Introduce a time delay of 300-500 milliseconds between consecutive OBD2 requests. Aggressively spamming the ECUs with rapid requests can overwhelm them and lead to unreliable responses or even communication errors.
- Battery Drain Management: Implement triggers within your CANedge configuration to automatically stop OBD2 request transmissions when the vehicle is inactive (ignition off). This is crucial to prevent unnecessary battery drain, as continuous OBD2 requests can keep vehicle ECUs in a powered-on state even when the engine is off. Triggers can be based on vehicle speed, engine RPM, or other relevant parameters to detect vehicle inactivity.
- Data Filtering: Configure CANedge filters to selectively record only OBD2 response messages (e.g., CAN IDs in the 0x7E8-0x7EF range). This is particularly important if your vehicle also broadcasts OEM-specific CAN data on the OBD2 port. Filtering out unwanted OEM-specific traffic will reduce data storage requirements and simplify subsequent data analysis, focusing solely on the OBD2 diagnostic information.
Once these configurations are in place, your CANedge device is optimally set up to efficiently and reliably log raw OBD2 data from your vehicle.
Example CANedge OBD2 PID Request Transmit List Configuration
OBD2 Data Visualization: DBC Decoded Plot in asammdf CAN Bus Software
Step #3: DBC Decode Raw OBD2 Data for Analysis
The final step in the OBD2 data logging workflow is to convert the raw OBD2 data into human-readable ‘physical values’ (e.g., kilometers per hour, degrees Celsius, RPM). This decoding process is essential for data analysis, visualization, and interpretation.
The necessary decoding information for standard OBD2 PIDs is meticulously documented in the ISO 15031-5/SAE J1979 standards and is also readily available in online resources like Wikipedia. To simplify this decoding process, we provide a free, pre-built OBD2 DBC file. This DBC file is compatible with most CAN bus software tools and facilitates seamless DBC decoding of raw OBD2 data.
It’s important to recognize that decoding OBD2 data presents a slightly greater level of complexity compared to decoding typical CAN signals. This complexity arises from the fact that multiple different OBD2 PIDs are often transmitted using the same CAN ID (e.g., responses to various PIDs from the ECM all typically use CAN ID 0x7E8). Consequently, relying solely on the CAN ID is insufficient to uniquely identify the specific signals encoded within the CAN data payload.
To address this challenge, effective OBD2 data decoding requires considering not only the CAN ID but also the OBD2 mode and the specific OBD2 PID. This approach is a form of multiplexing, often referred to as ‘extended multiplexing‘. Extended multiplexing allows for efficient use of CAN IDs by transmitting multiple signals within the same CAN message, but it necessitates a more sophisticated decoding strategy. This extended multiplexing scheme can be effectively implemented using DBC files. DBC files provide a structured way to define the decoding rules that incorporate CAN ID, mode, and PID information, enabling accurate conversion of raw OBD2 data into physical values.
CANedge: Your Dedicated OBD2 Data Logger
The CANedge is engineered to simplify the process of recording OBD2 data. It efficiently logs data directly to a removable 8-32 GB SD card, providing ample storage for extended data acquisition sessions. To start logging, simply connect the CANedge to your vehicle’s OBD2 port – whether it’s a car, truck, or other OBD2-compliant vehicle. For data analysis, leverage our free software tools and APIs in conjunction with our OBD2 DBC file to decode and interpret the logged data.
OBD2 logger intro
CANedge
OBD2 Multi-Frame Communication Examples: ISO-TP in Action
As previously mentioned, all OBD2 communication adheres to the ISO-TP (transport protocol) standard, as defined in ISO 15765-2. While many common OBD2 interactions involve single-frame messages, certain diagnostic operations, such as retrieving the VIN or DTCs, require multi-frame communication to accommodate larger data payloads. In this section, we present practical examples illustrating multi-frame OBD2 communication sequences.
Multi-frame OBD2 communication inherently involves flow control frames to manage the data exchange process (for detailed information on flow control mechanisms, refer to our UDS introduction). In practical CANedge configurations for multi-frame OBD2 requests, a common technique is to transmit a static flow control frame approximately 50 milliseconds after the initial request frame. This pre-emptive flow control approach simplifies configuration and ensures reliable multi-frame data transfer.
Furthermore, processing multi-frame OBD2 responses necessitates CAN software or API tools that provide robust ISO-TP support. The CANedge MF4 decoders are specifically designed to handle ISO-TP segmentation and reassembly, enabling seamless decoding of multi-frame OBD2 data.
Example 1: Retrieving the OBD2 Vehicle Identification Number (VIN)
The Vehicle Identification Number (VIN) is a critical piece of information for various automotive applications, including telematics, diagnostics, vehicle identification, and more (for further details, consult our UDS introduction). To retrieve the VIN from a vehicle using OBD2 requests, you utilize Mode 0x09 (Request Vehicle Information) and PID 0x02 (Request Vehicle Identification Number):
The diagnostic tester tool initiates the VIN retrieval process by sending a Single Frame request message. This request frame contains the PCI field (set to 0x02 to indicate a Single Frame), the request service identifier (Mode 0x09), and the PID (0x02 for VIN).
The vehicle’s ECU responds with a multi-frame response sequence. The first frame of this sequence is a First Frame, which contains the PCI field (indicating a First Frame), the total length of the multi-frame message (0x014, which is 20 bytes in decimal), the response service identifier (0x49, derived by adding 0x40 to the request mode 0x09), and the PID (0x02, echoing the requested PID). Following the PID in the First Frame data payload is the byte 0x01, which represents the Number Of Data Items (NODI). In this case, NODI is 1, indicating that a single VIN is being returned (refer to ISO 15031-5 / SAE J1979 for comprehensive details on NODI). The remaining 17 bytes in the multi-frame sequence constitute the VIN itself. These bytes are typically encoded in HEX format and need to be converted to ASCII characters to obtain the human-readable VIN string. Methods for HEX-to-ASCII conversion are discussed in our UDS introduction.
Example 2: OBD2 Multi-PID Request (Requesting 6 PIDs Simultaneously)
The OBD2 standard allows diagnostic tools to request up to 6 Mode 0x01 OBD2 PIDs within a single request frame. This capability enables more efficient data acquisition, reducing communication overhead and potentially increasing data sampling rates. When a multi-PID request is made, the vehicle’s ECU is expected to respond with data for all supported PIDs included in the request. If any of the requested PIDs are not supported by the ECU, those PIDs are simply omitted from the response. The ECU may respond with the requested data across multiple frames if the total response data exceeds the capacity of a single CAN frame, utilizing ISO-TP for multi-frame segmentation.
This multi-PID request feature offers efficiency benefits but introduces complexities in data interpretation. The signal encoding within the response becomes dependent on the specific set of PIDs requested, making it challenging to use generic OBD2 DBC files for decoding in such scenarios. Therefore, while technically feasible, we generally do not recommend using multi-PID requests in practical OBD2 data logging applications, especially when aiming for broad compatibility and ease of data processing.
However, for illustrative purposes, the example trace below demonstrates a multi-PID request and response sequence:
The multi-frame response structure in a multi-PID request scenario is conceptually similar to the VIN example, but with a key difference. The response payload includes not only the data values for the requested PIDs but also the PIDs themselves. In the example trace, the PIDs in the response are typically ordered in the same sequence as they were requested, which is a common practice in implementations but not strictly mandated by the ISO 15031-5 standard.
Decoding multi-PID responses using generic DBC files becomes significantly challenging in practice. The primary hurdle is that the data payload structure is dynamically determined by the specific PIDs requested, making it difficult to create a static DBC definition that applies universally across different multi-PID requests or across different vehicles that may support varying subsets of PIDs. Effectively, you encounter a complex case of extended multiplexing, where the multiplexing scheme itself changes depending on the request. To decode such data, you would need a DBC file that explicitly accounts for the payload position of each PID within the multi-PID response. Creating and managing such DBC files for diverse multi-PID request scenarios is cumbersome and not scalable. Furthermore, if you send multiple different multi-PID requests, distinguishing between the responses and associating them with the correct requests solely based on DBC manipulation becomes virtually impossible.
Potential workarounds for decoding multi-PID responses might involve custom scripting and recording both the request and response messages. A script could then implement logic to interpret the response payload in the context of the corresponding request message, effectively demultiplexing the data based on the known PID order in the request. However, such script-based approaches are complex to develop, maintain, and scale, especially when dealing with large datasets or diverse vehicle types. For most practical OBD2 data logging applications, focusing on single-PID requests and utilizing standard DBC decoding techniques offers a more robust, manageable, and broadly applicable solution.
Example 3: Retrieving OBD2 Diagnostic Trouble Codes (DTCs)
OBD2 provides a standardized mechanism for retrieving emissions-related Diagnostic Trouble Codes (DTCs) using Mode 0x03, ‘Show stored Diagnostic Trouble Codes’. In a DTC request, no PID is included in the request message itself. When an ECU receives a Mode 0x03 request, it responds with information about the DTCs it has currently stored. The response includes the number of DTCs stored (which may be zero if no DTCs are active) and the actual DTC codes. Each DTC is represented by a 2-byte value. If an ECU has more than two DTCs stored, the response will require multi-frame communication to transmit all the DTC data.
The 2-byte DTC value is structured according to ISO 15031-5 and ISO 15031-6. The first two bits of the first byte define the ‘category’ of the DTC (e.g., Powertrain, Chassis, Body, Network). The remaining 14 bits of the 2-byte code form a 4-digit code, typically displayed in hexadecimal format. This 4-digit code provides specific information about the detected fault. Decoded DTC values can be looked up in various online OBD2 DTC lookup tools, such as repairpal.com, to obtain detailed descriptions of the fault conditions and potential causes.
The example below illustrates an OBD2 DTC retrieval sequence from an ECU that has 6 DTCs stored.
OBD2 Diagnostic Trouble Code (DTC) Decoding Example and DBC Interpretation
OBD2 Data Logging: Real-World Use Case Examples
OBD2 data logging from cars and light trucks has a wide array of practical applications across various industries and use cases:
Logging Data from Cars for Efficiency and Analysis
OBD2 data logging in passenger cars can be leveraged for numerous purposes, including fuel efficiency optimization, driver behavior improvement programs, prototype component testing and validation, and usage-based insurance (UBI) applications.
obd2 logger
Real-Time Vehicle Diagnostics and Monitoring
OBD2 interfaces and data streaming capabilities enable real-time car diagnostics. This is invaluable for technicians in repair shops, roadside assistance services, and vehicle inspection centers, allowing for rapid identification and troubleshooting of vehicle issues.
obd2 streaming
Predictive Maintenance and Fleet Management
Integrating OBD2 data loggers with IoT (Internet of Things) cloud platforms enables predictive maintenance strategies for cars and light trucks, particularly within fleet management contexts. By continuously monitoring OBD2 parameters and analyzing trends, potential breakdowns and maintenance needs can be predicted, allowing for proactive interventions and minimizing vehicle downtime.
predictive maintenance
Vehicle Black Box Recording for Incident Analysis
An OBD2 data logger can serve as a ‘black box’ recorder for vehicles and mobile equipment. Continuously logging OBD2 data provides valuable objective evidence in the event of accidents, disputes, warranty claims, or for in-depth post-incident diagnostics and analysis.
can bus blackbox
Do you have a specific OBD2 data logging use case in mind? We offer free consultation and sparring to help you define and implement your OBD2 data acquisition strategy.
Contact us
Explore our guides section for more in-depth introductions to CAN bus and related technologies, or download the comprehensive ‘Ultimate Guide’ PDF for offline access.
Ready to start logging or streaming OBD2 data?
Acquire your OBD2 data logger today!
Buy now
Contact us
Recommended Resources
OBD2 DATA LOGGER: EASILY LOG & CONVERT OBD2 DATA
CANEDGE2 – PRO CAN IoT LOGGER
CAN BUS INTERFACE: STREAMING OBD2 DATA WITH SAVVYCAN