OBD2 Explained - A Simple Intro

OBD2 is a core topic in automotive data logging - from car diagnostics to vehicle fleet optimization.

Yet you may be asking: 

"Why another article on OBD2?"

Despite the importance, we find that most OBD2 intros are too high level, technical - or lack the practical data logging angle. 

Since visitors loved our intro to CAN bus, we again asked our non-engineer to write a simple intro; this time on OBD2.

Below we cover the basics of OBD2, the relation to CAN, how to log OBD2 data and the OBD2 parameter IDs (PIDs) - enjoy!

Note: You can also check out our video above with a smooth voice over by Samuel Fleming!


What is OBD-II?

On-Board Diagnostics (OBD) is your vehicle’s built-in self-diagnostic system. 

This is how you've probably experienced OBD in practice:

Ever noticed that malfunction indicator light pop up on your dashboard? That’s your car telling you there’s an issue and you should visit a mechanic. 

Your mechanic then uses an OBD2 scanner to connect to the OBD-II 16 pin connector under your driver’s wheel. With this, he is able to read out the Diagnostic Trouble Codes (DTCs) and understand the issue. Without taking your car apart!

So where does OBD come from?

The system originates from California where the California Air Resources Board (CARB) started requiring OBD in all new cars in 1991 for emission control purposes. By 1994, the CARB made the OBD2 standard mandatory in cars sold in 1996+. 

The OBD2 standard was recommended by the Society of Automotive Engineers (SAE) and secured a standardization of diagnostic codes and the OBD connector across manufacturers (as per SAE j1962). From there, the OBD2 standard was made mandatory across USA for cars and light trucks sold from 1996 and in EU from 2001 for gasoline cars and 2004 for diesel cars. Larger vehicles are by now also required by US legislation to support OBD2 (or OBD-II), including medium duty vehicles (since 2005) and heavy duty vehicles (since 2010).

Today, the OBD-II system is thus standard in most vehicles. It is imperative in facilitating easy error resolution and the standardization of DTCs prevents car manufacturers from “locking in” the car owners with proprietary diagnostic tools.

Is my car OBD-II compliant?

Wondering if you can log OBD-II data from your car? 

Check out the infographic below to get a quick overview! 

Note, however, that for some older vehicles the OBD-II system may not run on the CAN bus - more details on this below.

Car-Vehicle-OBD-II-Compliant-Ready-Data-Log-Read-CAN-Bus-Flow-Chart

The above infographic will let you know whether your car is OBD-II compliant

A lot of this data is also available outside the OBD-II protocol, but these CAN messages are typically proprietary. This means that you would need to decode them via a database of conversion rules/parameters, which is not always available. As such, for e.g. car hobbyist, accessing such data would require reverse engineering (CAN sniffing / hacking). 

In other words: 

The OBD-II standard is often the most convenient way to access basic data parameters from your vehicle.

Wikipedia has an excellent article on the standardized OBD-II PIDs

We also offer a OBD-II online converter tool where you can enter a message to return the PID info and converted data - check it out!

 

How does OBD-II data logging work?

In practical terms, OBD-II works as follows:

  • You connect a OBD2 scanner or OBD2 data logger to the OBD-II 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

Why is this important to understand?

It means that you will not see OBD-II data if you plug in a passive/silent CAN logger or interface to your car (though you'd see plenty of raw CAN frames). 

To log OBD-II response messages, your OBD2 data logger needs to be able to send the request messages. 
This feature was recently added to the CANLoggerX000 and you can check out our practical application (in an Astra) of it here.

Further, we've recently made it extra simple to log and convert OBD2 data via our free software CANvas.

Note: If you wish to log OBD2 data, it is helpful to set up the logger filters to only accept the valid OBD2 message range. 

Otherwise you will also get all the proprietary messages, making it harder to analyse the output.

OBD-II-Request-Car-Data-Query-Response-PID-Message-Log-Record-Acquire-Data

 

Can you please explain OBD-II PIDs for dummies?

If you want to get started with recording data from your car’s OBD-II system, it’s helpful to understand the basics of the message structure. Don’t worry, this will be kept high level!

In simplified terms, an OBD-II message is comprised of an identifier and data. Further, the data is split in Mode, PID and data bytes Ah, Bh, Ch, Dh - cf. the figure below.

OBD-II-Message-Request-Query-Response-Mode-PID-Data-CAN-Bus

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

You can try to enter the response message in our OBD-II message converter to confirm the result. 
Note that when using the calculator you need to exclude the ID (7E8) and data length (03).

Below, the various parts of the OBD-II message are explained:



Identifier: For OBD-II 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 OBD-II 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 PIDs exist - e.g. in Mode 01 PID 0D is Vehicle Speed. For the full list, check out the aforementioned Wikipedia OBD-II 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. For 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.



Importantly, not all cars support all PIDs (in particular older cars). As such, you may find it far easier to get valid OBD-II data returned in a car from 2015 vs a car from 2007 (yes, we tried).

 

I want to get started! What OBD-II recorder do I need?

For the casual hobbyist and the more advanced CAN sniffers / CAN hackers, OBD-II can be a helpful source of interesting data. For the same reason, you will find many tools that give you access to the data in different ways - examples include:

OBD2 scanners/code readers: Used mainly in static reading/clearing of diagnostic trouble codes. They are e.g. used by mechanics to look up the underlying issue behind a malfunction indicator lamp (MIL). OBD2 scanners vary by their degree of code coverage and features.

OBD2 data loggers: Used to log OBD-II data from a car over time onto e.g. an SD card - this can be helpful for post analysis and to e.g. analyse patterns, correlations etc. Further, for diagnostic / optimization purposes a data logger provides a “black box” view of data patterns before and after a diagnostic code has kicked in. OBD-II data loggers with Bluetooth or WiFi are also used in e.g. vehicle fleet management to improve fuel efficiency, prevent unsafe driving, and allow proactive remote diagnostics via the OBD-II supported parameters.

OBD2 data interfaces: Used to provide live real-time data on various OBD-II parameters.  Applications can include visual displays/apps that guide the driver on fuel or performance efficiency, or as a live health check. More advanced OBD-II interfaces can also be used to stream OBD-II data along with proprietary CAN bus data, which can be useful for CAN sniffing and car hacking.

Finally, hybrids of course exist:

The CANLoggerX000 series can e.g. act as both an CAN / OBD2 data logger and a CAN / OBD2 interface. 

To see this in action, check out our OBD2 Data Logger article.

Where can I learn more about OBD-II and CAN logging? 

You can start by checking out our GUIDES page - it contains various simple intros like this one, as well as really simple practical applications. 

To learn more about the CANLoggerX000, check out our intro page or products page.

 

This site uses cookies to enhance your experience

Got it!