Introduction: OBD-Pi

In this instructable you will learn how to connect your Raspberry Pi to a Bluetooth OBD-II adapter and display realtime engine data to your cars aftermarket head unit!

Step 1: Hardware Required:

  1. Raspberry Pi Model B or B+
  2. Aftermarket head unit (Note: Must support Auxiliary input)

  3. Plugable USB Bluetooth 4.0 Low Energy Micro Adapter

  4. 2A Car Supply / Switch or Micro USB Car Charger

  5. ELM327 Bluetooth Adapter or ELM327 USB Cable

  6. RCA cable

  7. Keyboard (*optional)

Step 2: What Is OBD-II?

OBD stands for On-Board Diagnostics, and this standard connector has been mandated in the US since 1996. Now you can think of OBD-II as an on-board computer system that is responsible for monitoring your vehicle’s engine, transmission, and emissions control components.

Vehicles that comply with the OBD-II standards will have a data connector within about 2 feet of the steering wheel. The OBD connector is officially called a SAE J1962 Diagnostic Connector, but is also known by DLC, OBD Port, or OBD connector. It has positions for 16 pins, and looks like this:

Step 3: PyOBD?

pyOBD (aka pyOBD-II or pyOBD2) is an open source OBD-II (SAE-J1979) compliant scantool software written entirely in Python. It is designed to interface with low-cost ELM 32x OBD-II diagnostic interfaces such as ELM-USB. It will basically allow you to talk to your car's ECU, display fault codes, display measured values, read status tests, etc.

I took a fork of pyOBD’s software from their GitHub repository, https://github.com/peterh/pyobd, and used this as the basis for my program.

The program will connect through the OBD-II interface, display the gauges available dependent on the particular vehicle and display realtime engine data to the cars aftermarket head unit in an interactive GUI.

Step 4: Software Installation

Before you start you will need a working install of Raspbian with network access.

We'll be doing this from a console cable connection, but you can just as easily do it from the direct HDMI/TV console or by SSH'ing in. Whatever gets you to a shell will work!

Note: For the following command line instructions, do not type the '#', that is only to indicate that it is a command to enter.

Before proceeding, run:

#  sudo apt-get update
#  sudo apt-get upgrade
#  sudo apt-get autoremove
#  sudo reboot

Install these components using the command:

#  sudo apt-get install python-serial
#  sudo apt-get install bluetooth bluez-utils blueman
#  sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-i18n libwxgtk2.8-dev
#  sudo apt-get install git-core#  sudo reboot

Next, download the OBD-Pi Software direct from GitHub.


Or using the command:

#  cd ~
#  git clone https://github.com/Pbartek/pyobd-pi.git

Step 5: Vehicle Installation

The vehicle installation is quite simple.

1. Insert the USB Bluetooth dongle into the Raspberry Pi along with the SD card.

2. Insert the OBD-II Bluetooth adapter into the SAE J196216 (OBD Port) connector.

3. Connect you RCA cable to the back of your aftermarket head unit and plug the other end into your Raspberry Pi.

4.Install your 2A Car Supply / Switch or Micro USB Car Charger.

5. Finally turn your key to the ON position and navigate your head unit to Auxiliary input.

6. Enter your login credentials and run:

# startx 

7. Launch BlueZ, the Bluetooth stack for Linux. Pair + Trust your ELM327 Bluetooth Adapter and Connect To: SPP Dev. You should see the Notification "Serial port connected to /dev/rfcomm0"

Note: Click the Bluetooth icon, bottom right (Desktop) to configure your device. Right click on your Bluetooth device to bring up Connect To: SPP Dev.

8. Open up Terminal and run:

# cd pyobd-pi

# sudo su

# python obd_gui.py

Use the Left and Right arrow keys to cycle through the gauge display.

To exit the program just press Control and C or Alt and Esc.

Step 6: Data Logging

If you would like to log your data run:

#  cd pyobd-pi
#  python obd_recorder.py

The logged data file will be saved under:


Enjoy and drive safe!

Step 7: Step by Step Video



    • Paper Contest 2018

      Paper Contest 2018
    • Pocket-Sized Contest

      Pocket-Sized Contest
    • Science of Cooking

      Science of Cooking

    We have a be nice policy.
    Please be positive and constructive.


    2 Questions

    great project Where can I get an aftermarket head unit? My car is old, a 2000 SAAB

    or can I use a laptop in lieu of the head unit?

    thanks for a great start on OBD-II

    Can we add other functionality along with diagnostics to the Raspberry pi ?( viz. sensors)


    Total Pi noob here... I followed your instructions and can't get the piobd-py.git part to work for me. It does nothing when I type that line in. I tried the link which sent me to github, and searched not knowing wth to do there. I'm sure it's on my end, the knowledge part. This is all experimental for me, I can already do this and more with my phone, like checking the other modules, airbag, ABS, etc.. There's also a wall I'd like to breakthrough here, the one between car types and computer types. I'd eventually like to run my car reliably on a PI or a stack if need be. I'd be impressed if the stock ecu runs at 20mhz. Anywho, step 1 is getting this to work.

    I assume your talking about
    git clone https://github.com/Pbartek/pyobd-pi.git

    There should be some output from running that command

    when you type git clone does it tell you command not found? If so, run the command sudo apt-get install git (this will install git) and then try again.

    Are you getting a permissions error? add sudo before git clone -or- run the command on a directory that you have permission to write in.

    When you run this command successfully, it should create a directory and download all of the files from the repository into it.

    Hi. Thank you for sharing this great project! But I have one question about fuel level is "fuel system stat" means fuel level (because I getting 0100 all the time and S-T and L-T fuel trim at 0)?

    ST and LT are short term and long term fuel trim. That has nothing to do with how full your gas tank is. It’s a measurement on if your engine is running lean or rich. If they are both running at 0 that’s perfect for your engine.

    Can you update the instructions using a RPi3 or Zero W? Thanks!

    Hi install and bt connection all good however I get a blank screen and this:


    Opening interface (serial port)

    Interface successfully /dev/rfcomm0 opened

    Connecting to ECU...

    atz response:ELM327 v2.1

    Got nothing

    Got nothing

    Got nothing

    Got nothing

    Got nothing

    ate0 response:ate0

    0100 response:0100NO DATA

    Connected to /dev/rfcomm0

    Any suggestions??

    I have used this for a month now it works good. Just a few problems. The numbers are refresing only every second if not longer. Is this a limitation on my ELM327 USB Cable?? But i have the exact same as on the link. Or is this how the cars ECU outputs.

    Can anyone explain how to establish a bluetooth connection to the obd adapter with pi3, it always raises the error, no service found for that device... . I asked in several forums but no luck.

    I had the same problem,bought a usb bluetooth on amazon and started researching on forums,to be honest i don't know what worked as i tryed too many thing at the same time,i thing everything revolves around bluez.i know it doesn't help but it is possible to make it work

    Very good!!!

    Does it work without X and GUI?

    I`m interested in elm327 <-> bluetooth <-> virtual serial port channel?