> For the complete documentation index, see [llms.txt](https://help.imotions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.imotions.com/lab/sensor-setup/recording-vehicle-data-with-can-bus-obd-ii.md).

# Recording vehicle data with CAN bus OBD-II

Connect an OBD-II adapter to iMotions Lab, choose which vehicle data to record, such as speed and throttle position, and record it in a study.

With the CAN bus OBD-II sensor, iMotions Lab reads vehicle data, such as vehicle speed, engine speed and throttle position, from a vehicle's on-board diagnostics (OBD-II) port and records it together with the other data in a study, for example in driving studies. This article explains how to connect the adapter, choose the vehicle data to record and record it.

## Requirements

* An iMotions license that includes CAN bus OBD-II.
* An ELM327-compatible OBD-II adapter that connects over USB or over Wi-Fi. Bluetooth adapters are not supported.
* A vehicle that uses one of the CAN protocols of OBD-II. Vehicles that use a non-CAN OBD-II protocol are not supported.

## Connecting the adapter

1. Plug the adapter into the vehicle's OBD-II port and turn on the ignition.
2. Connect the adapter to the computer:
   * For a USB adapter, plug it into the computer. Windows makes it available as a COM port.
   * For a Wi-Fi adapter, connect the computer to the adapter's own Wi-Fi network.
3. In iMotions, open **Preferences > Sensor Settings** and find the **CAN bus OBD-II** section.
4. Under **Connection**, select **COM port** for a USB adapter or **Wi-Fi** for a Wi-Fi adapter, and fill in the settings for that connection:

| Setting             | Connection | Description                                                                                                                                                                                   |
| ------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Adapter port**    | COM port   | The COM port of the adapter. The list shows the device name next to the port, for example COM5 · USB-SERIAL CH340. Click **Refresh** if you connected the adapter after opening the settings. |
| **Baud rate**       | COM port   | 9600, 38400, 57600, 115200 or 230400. Default 38400, which most ELM327 adapters use; some use 9600.                                                                                           |
| **Adapter address** | Wi-Fi      | The IP address of the adapter. Default 192.168.0.10, which most Wi-Fi adapters use.                                                                                                           |
| **TCP port**        | Wi-Fi      | The TCP port of the adapter. Default 35000, which most Wi-Fi adapters use.                                                                                                                    |
| **Sample rate**     | Both       | How often iMotions reads all selected PIDs: **As fast as possible** (default), 50, 20, 10, 5 or 1 Hz. A fixed rate gives evenly spaced samples.                                               |

## Choosing the vehicle data

The vehicle data is read as OBD-II parameter IDs (PIDs). **Vehicle data (OBD-II PIDs)** lists the PIDs iMotions can read, with their hexadecimal code, name and unit. Not every vehicle supports every PID, so check which ones the vehicle supports before you select them.

1. Click **Detect supported PIDs**. The adapter must be connected, the ignition on and the sensor stopped. When detection finishes, iMotions shows how many of the listed PIDs the vehicle supports.
2. Optionally, select **Only show supported PIDs** to hide the others. PIDs the vehicle does not support cannot be selected.
3. Select the PIDs you want to record. Select at least one; without a PID, iMotions turns off **Enable data collection**.
4. Select **Enable data collection** and click **OK**.

iMotions saves the result of the detection with the settings. If you use the adapter in another vehicle, click **Detect supported PIDs** again.

Each PID is recorded as a signal with the same name, for example **Vehicle speed** in km/h. Some PIDs contain several values, such as the oxygen sensor PIDs, and record one signal per value; hover over the name of the PID to see the signals it records. A selected PID the vehicle does not answer records no data.

{% hint style="info" %}
iMotions reads the selected PIDs one after the other, and each PID takes about 13 ms to read. The more PIDs you select, the lower the sample rate the vehicle can deliver. Each sample is timestamped at the middle of the time it took to read all selected PIDs.
{% endhint %}

## Recording vehicle data

The **CAN bus OBD-II** sensor widget at the bottom of the main window shows the sample rate, the adapter port and the protocol the vehicle uses, and how many PIDs are selected and signals recorded. When the adapter is missing or the vehicle is off, the widget shows **Adapter missing or vehicle off**. If the connection to the adapter or vehicle is lost, iMotions keeps trying to connect again until the sensor is stopped. If the vehicle uses a protocol that is not supported, the widget shows **Vehicle protocol not supported** and the sensor stops.

1. Create a study and select the **CAN bus OBD-II** sensor.
2. Add a respondent and start the recording. iMotions records the selected vehicle data automatically.
3. To view the data, open the [Sensor Preview](https://help.imotions.com/lab/data-collection/sensor-preview-window.md) during the recording, or the [Respondent Replay](https://help.imotions.com/lab/analysis/signal-processing-r-notebooks/my-library/respondent-replay.md) afterwards.

Changing the selected PIDs later does not change recordings that have already been made.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.imotions.com/lab/sensor-setup/recording-vehicle-data-with-can-bus-obd-ii.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
