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)
Open your Configuration File in the config editor
Click the bottom menu ‘car’ icon to open the ‘OBD tool’
Use the default settings and select the parameters (PIDs) you wish to record
Optionally add filters to only log the OBD responses
Optionally add control signal to stop PID requests when the GPS-based speed is 0
Click Merge files to add the OBD details to your existing Configuration File
Click ‘Review changes’ and download the file to your SD (replacing the existing)
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
Connect the CANedge to the OBD2 connector in your car via the OBD2-DB9 adapter[1]
Verify that the device turns on and logs data (CH1 LED blinking)
Disconnect the device from power and extract the SD card
Open the recorded MF4 in asammdf and display the raw CAN trace
If your car responds you should see CAN frames with ID
0x7E8in your data as below:
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.
Validation: Determine IDs, protocol and supported PIDs
This section lets you identify what OBD data your vehicle supports and how to request it[2]:
In the ‘OBD tool’ select ‘Identify supported PIDs’ and click ‘Merge files’
Download the Configuration File to your SD (replace the original) and safely eject the SD
Start your vehicle and leave it running for ~2 min[3]
Connect the CANedge to the OBD2 connector in your vehicle via the OBD2-DB9 adapter
Power it for ~3 min, then disconnect the device and extract the SD card
Convert the recorded log file to CSV via the MF4 converter
mdf2csvLoad 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:
Turn transmission on/off via a control signal - e.g. GPS speed as supported by the OBD tool
Disconnect the device between trips
Re-wire your OBD2 connector so that the power pin is linked to the ignition
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.
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