OBD-II Testing with an Arudino

OBD-II  (an abbreviation for  On-Board Diagnostics, Second Generation) is a set of standards for implementing a computer based system to control emissions from vehicles ( and a lot more ! ).  If you are not familiar with OBD-II you can read more about it here.

I just recently acquired an OBD-II UART board and cable

OBD-II UARTOBD-II Cable

from SparkFun.com, so I can diagnose any car problems. One end of the cable connects to the OBD-II connector on your car, the other end connects to the board.  The board can then connect to any serial port via a 6 pin header that needs to be soldered on.

The 6 pin header connects nicely to an FTDI board

FTDI Breakout 5V

that Sparkfun.com also sells.  The tutorial about this product shows how to attach an arduino and LCD monitor to capture data from your cars’ computer.

The board did not come with any OBD-II diagnostic / analysis software but there are a number of FREE and commercial offerings to choose from.

I like to write my own software and so I came up with this Python script to inquire for and analyze the OBD information. It is too big to post here so just click on the image to download it.

Python_small

If you’d like to test the Python code but do not have the OBD-II UART, you can substitute any Arduino you might have lying around. I wrote a simple sketch to emulate the OBD-II information coming from a ‘sample’ car. Just attach the arduino to your computer via any USB cable, load the sketch and run the Python script.

I tested it with my Aduino Nano.
Arduino Nano

Here is the sketch:

Leave a Reply

Your email address will not be published.