Log OBD data

OBD is a protocol used in most non-EV 2008+ vehicles (cars, vans, trucks).

In this section we outline how to log OBD data with your CANedge.

Note

We strongly recommend that you read our OBD2 intro before proceeding


Configure your device (OBD tool)

  1. Open your Configuration File in the config editor
  2. Click the bottom menu ‘car’ icon to open the ‘OBD tool’
  3. Use the default settings and select the parameters (PIDs) you wish to record
  4. Optionally add filters to only log the OBD responses
  5. Optionally add control signal to stop PID requests when the GPS-based speed is 0
  6. Click Merge files to add the OBD details to your existing Configuration File
  7. Click ‘Review changes’ and download the file to your SD (replacing the existing)
  8. Safely eject the SD and insert it into your device

Note

This transmits common OBD2 PIDs with 500K bit-rate and 11-bit IDs (supported by most non-EV cars). See also below on how to systematically determine what your vehicle supports


Record OBD2 data

  1. Connect the CANedge to the OBD2 connector in your car via the OBD2-DB9 adapter[1]
  2. Verify that the device turns on and logs data (CH1 LED blinking)
  3. Disconnect the device from power and extract the SD card
  4. Open the recorded MF4 in asammdf and display the raw CAN trace
  5. If your car responds you should see CAN frames with ID 0x7E8 in your data as below:
asammdf OBD2 7E8

Note

If your raw data does not contain any ID 0x7E8 OBD2 responses, go to our ‘Validation’ section


DBC decode OBD2 data

To DBC decode OBD2 data we recommend to use our free OBD2 DBC.

You can decode your data via the processing tools - start with asammdf.

OBD2 data logger asammdf GUI

Validation: Determine IDs, protocol and supported PIDs

This section lets you identify what OBD data your vehicle supports and how to request it[2]:

  1. In the ‘OBD tool’ select ‘Identify supported PIDs’ and click ‘Merge files’
  2. Download the Configuration File to your SD (replace the original) and safely eject the SD
  3. Start your vehicle and leave it running for ~2 min[3]
  4. Connect the CANedge to the OBD2 connector in your vehicle via the OBD2-DB9 adapter
  5. Power it for ~3 min, then disconnect the device and extract the SD card
  6. Convert the recorded log file to CSV via the MF4 converter mdf2csv
  7. Load the CSV in the OBD tool within ‘Select from supported PIDs’

This auto-configures the ID/protocol and limits the PID list to those supported by your vehicle.


Note

If your CSV is empty, review the raw CAN bus trace in asammdf to see if it only contains CAN errors - if so, try changing the bit-rate e.g. from 500K to 250K


OBD requests & battery drainage

The CANedge consumes <1W[4], which is not an issue for your car battery in practical use cases.

In most cases, the device also turns off with your vehicle ignition. However, if this is not the case then OBD2 requests may ‘wake up’ the car ECUs. In such scenarios consider below solutions:

  1. Turn transmission on/off via a control signal - e.g. GPS speed as supported by the OBD tool
  2. Disconnect the device between trips
  3. Re-wire your OBD2 connector so that the power pin is linked to the ignition
  4. Use a DB9-DB9/DC splitter and a cigarette-to-DC adapter to power the device

Advanced: Multi-frame OBD2 data (ISO TP)

Some OBD2 communication involves multi-frame data, e.g. DTCs, VIN and more. To request such data, you need to use flow control frames - see our OBD2 intro for detailed examples. Below is an example request for the Vehicle Identification Number. You can DBC decode and visualize multi-frame data using the MF4 decoders and e.g. Grafana dashboards.

obd2-request-vin-multi-frame

Note

The OBD tool also includes some ISO TP PIDs for the OBD2 protocol (e.g. DTCs, VIN). These use ‘physical’ request IDs (e.g. 7E0) which may need to be changed in your use case


[1]We strongly recommend using one of our OBD-DB9 adapters as 3rd party cables often use different pinouts.
[2]The OBD tool simplifies the process of validating what PIDs are supported by your vehicle. If you prefer, you can find our old ‘manual’ guide here
[3]The vehicle ECUs may take some time to boot up and acknowledge CAN frames, hence it is useful to wait for a few minutes with the vehicle turned on
[4]The CANedge3 consumes up to 2.5W during active LTE transfer