Introduction: OBD-Pi

Picture of 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:

Picture of 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?

Picture of 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,, 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

Picture of 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

Step 5: Vehicle Installation

Picture of 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

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

Picture of Data Logging

If you would like to log your data run:

#  cd pyobd-pi
#  python

The logged data file will be saved under:


Enjoy and drive safe!

Step 7: Step by Step Video


MariusV26 (author)2017-05-15

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)?

JeffA110 (author)MariusV262017-12-13

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.

dconsuegra (author)2017-12-06

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

michaelpko (author)2017-08-20

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??

alphazero1990 (author)2017-08-13

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.

TimoR13 (author)2017-03-28

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.

Ruzrox (author)TimoR132017-07-20

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

makarov_itworks (author)2015-04-09

Very good!!!

Does it work without X and GUI?

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

CowFish (author)makarov_itworks2015-04-09

Thanks for reaching out! I actually have a non GUI version which outputs via terminal. If you are interested in this version please let me know! I will be more than happy to post it on my Github page ;)

pippo92 (author)CowFish2017-06-14

which file in your Github page is non GUI version? obd_capture? I ask you this because that file doesn't return anything in console. Thanks for the attention :)

PrasanthR1 (author)CowFish2016-05-16

Nice work Cowfish, I am eagerly looking for the non GUI version to get the output through terminal. could you please give the link for the code page??!

PrasanthR1 (author)CowFish2016-05-16

Nice work Cowfish, I am eagerly looking for the non GUI version to get the output through terminal. could you please give the link for the code page??!

mdias7 (author)CowFish2016-03-22

Hi CowFish, I'm working on a C++ RPi project and I need to send some variables to my application like rpm and load. I would love to get an non-GUI version if you don't mind.

I would be very thankful.

Here is my email rdbg.03(at)gmail(dot)com

BrandonF5 (author)CowFish2015-07-07

I'd be very interested in a non-GUI version (as well as the GUI version). I would love to be able to ssh into my Pi and get readings from the car in the driveway :)

I'm also having trouble with using the desktop bluetooth manager to connect-the icon is there but the GUI never shows up when I click on it. Any idea why that might be? I'm considering just getting a USB OBDII connector to avoid that particular hurdle...

makarov_itworks (author)CowFish2015-04-09

I want to manage my Raspberry Pi using the buttons on the steering wheel. I hope your utility can help me identify the button codes. And to learn how it works =).

Biff_T (author)2017-03-30

Great project CowFish, thanks for sharing. I was thinking about using the new Raspberry Pi Zero W instead, as it has build in bluetooth. I was looking around for other projects and fell over this

It seems to do some of the same things. I will see if I can get the head unit or maybe a tablet.
Anyway, thank you :-)

chrisking (author)2017-02-13

Great tutorial, questions from a new guy; What is an aftermarket head unit and will it work with a PI3?

campervancoder (author)2016-08-17

Great project CowFish ..

Thanks for posting such a detailed tutorial. Have forked pyobd-pi and works a treat with a USB OBD reader and an Ubuntu laptop.

We are looking to port this to Kivy which we already have some animated RPM, Temp gauges ect developed.

Happy to send through the repo once done :)

CowFish (author)campervancoder2016-08-24

Morning campervancoder,

Sounds like an awesome project, can't wait to see it up and running!


campervancoder (author)2016-08-24

Quick update on the Kivy port .. We now have the ECU telemetry being displayed on our beta rev gauge..

We will publish the codebase on github once we have cleaned it up and added some exception handling for the OBD connection (Which does not always connect first time :) ..)

Thanks again to CowFish for the great work.

Issue with embedded link please go to https: //

AntoineB27 (author)2016-07-24

hello cowfish or any1 who can help
I am unable to connect my bluetooth obd to the Serial Port i dont seem to have the option to connect as mentioned in the instructions. Also the bluetooth package mentioned in the instructions have been replaced. So i instead of bluez-utils i just installed bluez. Could this be the reason for my problems?
thanks u

TusharS53 (author)AntoineB272016-07-27

Any solution yet. I was facing the same problem. The thing is that the old bluez-util is discontinued and is replaced by "bluez5.0" which is supposedly causing this problem. I tried recompiling the old Bluetooth utility but due to lack of time was not able to fully operate it. If you have found any solution, please post me about it.


R-A (author)2016-07-26

Which make / model head unit did you use for this?

Tomtom629 (author)2016-07-12

It's stuck on "trying to connect..." Do you know how to fix this?

AntoineB27 (author)Tomtom6292016-07-24

r u having trouble connecting the bluetooth obd to the pi? If so, I am having the same issue. Maybe we can help eachother out. I cant connect the OBD to a serial port.

ZacWolf (author)2016-03-12

Great instructable. I'm confused on how you're interfacing the touch display on your Alpine with the Pi. I have a Jensen, and it supports AUX Video input, but how do you interface the touch?

ZackJ1 (author)2016-03-11

I am having some trouble,

I type the command

sudo apt-get install git-core which works fine

then i type sudo reboot and the pi starts to reboot but when it boots back on there is just a black screen with one blinking underscore, I cant type anything or get anywhere at this point

JoshuaL48 (author)2016-02-19

sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-i18n libwxgtk2.8-dev

is this the install request line if we choose to use the hardwired OBDII snesor instead of the BT OBDII?

klange1964 (author)2016-02-03

Great Work, and Great Project. I am new to the RPi but i am going to give this project a try because I would like to track my vehicles Performance.

lesincostan (author)2015-11-10


i have worked my way through the tutorial today and it worked really well. I have combined the Rasperry Pi with the new Rasperry touch screen and I am looking forward to finish a contineous installation. I think it will be a great asset to my car.

Thanks a lot for the instructable!

CowFish (author)lesincostan2015-11-30

Hi lesincostan,

No problem, love your setup!


gcarlyle22 (author)2015-11-26


I too have worked my way through the tut. But I however am having an issue I'm hoping you can help with. I am by no means a programmer so coding and figuring out what errors mean is something I am incapable of dealing is what I'm using:

RPi 2

CSR V4.0 Bluetooth adapter

Raspbian wheezy

Here is the error:

pi@raspberrypi ~/pyobd-pi $ python

(python:2639): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-button-images after class was initialised

(python:2639): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-scrolled-window-placement after class was initialised

(python:2639): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-label-select-on-focus after class was initialised


Opening interface (serial port)

Interface successfully /dev/rfcomm0 opened

Connecting to ECU...

atz response:ELM327 v2.1

ate0 response:OK


Connected to /dev/rfcomm0

Traceback (most recent call last):

File "", line 394, in connect


File "", line 50, in get_output

return self.c.capture_data()

File "/home/pi/pyobd-pi/", line 44, in capture_data

self.supp = self.port.sensor(0)[1]

File "/home/pi/pyobd-pi/", line 226, in sensor

r = self.get_sensor_value(sensor)

File "/home/pi/pyobd-pi/", line 215, in get_sensor_value

data = sensor.value(data)

File "/home/pi/pyobd-pi/", line 112, in hex_to_bitstring

v = eval("0x%s" % i)

File "<string>", line 1



SyntaxError: invalid token

Thanks for any help you can give
Thomas Paine (author)2015-11-07

Good Morning.

I have been working on this instructable, but have ran into a snag. I have a TAXO USB 2.5 OBD cable I got for my car to reprogram a couple of keys for it.

I can't seem to get this cable to work with the Pi. Is this due to the cable? Here is an amazon link of what I have, and it really only talks about the Volkswagen card, not more generic OBD data collection.

Would the python script automatically detect a usb cable plugged into the Pi and initialize if it was working? I don't have a bluetooth one yet. I have ordered one, but it isn't here yet.

jawood (author)2015-09-18

Hi I have been trying to get this working on my RPi2 but have issues with the USB serial port i have a UART GPS connected to the GPIO pins and when i connect my usb obdii device the gps stops working if you have any ideas would be appreciated. I'm sure its not a power issue i have a 5Amp 5V power supply connected to the powered USB hub and have set USB_MAX_CURRENT=1 on the Pi

JoãoC7 (author)2015-09-12

Hello CowFish, first of all congrats for your Instructable.

I'm writing you because I'm having problems lauching the The system keeps saying there's an error with the Import wx , line 11, "modules".

Can you enlighten me on this ? Is there anything I can do to repair the installation or make it to work ?

Dplus12 (author)2015-04-09

I have a OBD-II wifi adapter, would the setup be similar?

CowFish (author)Dplus122015-04-09

Hello Dplus12,

To answer your question yes! You will need to modify file "".


MrinmoyG (author)CowFish2015-08-18

Hi CowFish can you please help me to configure my for wifi connection?

saumya06 (author)2015-07-08


I want to log the data using But is it printing "logging items" and then "not connected". What may be the problem? Can you please help asap.

Ps: i am able to get real time data by

saumya06 (author)saumya062015-07-08

*using bluetooth adapter.

SaraWest (author)2015-06-16

Good idea!!

hengemann (author)2015-06-10

Awesome... i do it in my CarPC proyect and this is so interesting

UmerS (author)2015-05-23

Hi! Thanks so much for this great Instuctable with clear steps; however, I am having some issues.

I can get the RPi to connect to the Bluetooth ODBII adapter and the Bluetooth on the RPi says it's connected on the serial port, but the gui is displaying what is attached (images).

Any suggestions on what the problem may be?

Thanks again. This is actually my first project with the RPi, however I would consider myself quite well versed in Linux.

UmerS (author)UmerS2015-05-24

UPDATE: I got it to work. I edited and changed "len(self.supp)" to "32" on line 50.

dm13dv1b (author)2015-05-21

Hi CowFish! Really amazing project! I cant find the for the wifi adapter. Would you please help me?

UmerS (author)dm13dv1b2015-05-23

It is located on the RPi in /home/(username)/pyobd-pi/

You can either use the file viewer in x, or you can use the terminal. Since my username is 'pi', I can run "nano /home/pi/pyobd-pi/" to edit it.

johnso51 (author)2015-04-28

Great project, I am going to do a similar project this summer! Just a note for the Linux side of things: the # is typically used to denote a command run as root, and the $ is used for non-root user. e.g. # apt-get update
is just a simpler way of saying $ sudo apt-get update.

trenzalorian (author)2015-04-27

I was just thinking about this last week! I even ordered a Bluetooth OBDII device on Friday! I was going to use that really popular mini screen for a backup camera, so looks like I'm sticking that and this together! Maybe I'll learn to make a basic GUI in python and make the pi switch to its camera when backing up.

CowFish (author)trenzalorian2015-04-27

Sounds like a great project! Good luck :)

About This Instructable




More by CowFish:OBD-Pi
Add instructable to: