Automotive test automation using the ELM327 OBD module

On-board diagnostics (OBD) conforming to the OBD-II standard are available on all modern cars manufactured for sale in the US, EU, Japan and Australia.

The ELM327 module from ELM Electronics provides a convenient interface to the OBD protocols.

To find out whether a particular vehicle supports OBD-II, check the manufacturer's documentation and/or the sites in the External Resources section at the bottom of this page.

 

ELM327 OBD Perl module

This module provides a Perl interface to a device containing an Elm Electronics ELM327 OBD Interpreter and provides access to the following functions:

  • Read OBD parameters and extract individual values from results
  • Read OBD Trouble Codes and expand them to their full form
  • Reset OBD Trouble Codes
  • Read ELM327 parameters
  • Write and write the ELM327 data byte
  • Calibrate ELM327 Voltage
  • Switchable diagnostic trace and replay function for debugging

The module is written entirely in Perl and works with both Linux and Windows. Depending on which operating system it is run on it uses either the Win32::SerialPort or Device::SerialPort module so it should work on any platform that supports one of them.

It currently supports most of the ISO standard commands and has been tested on a couple of European CAN-based vehicles (Ford and GM). I would be very interested to see debug info produced by other vehicles: particularly non-CAN models.

I currently have very little information about manufacturer specific commands and would be grateful for any information that googling doesn't turn up. There's a small amount of data on various Fords, but very little on GM models.

My next challenge will be to get the module working on android using Scripting Layer for Android (SL4A). I'm currently getting errors while trying to set up a bluetooth connection so it doesn't look quite as easy as I'd hoped.

It can be downloaded from CPAN.

Application Examples

Show some OBD parameters and any Trouble codes:

Back to top

Read and display some OBD parameters and any Trouble codes and monitor some more OBD parameters, reading values once every second:

Back to top

Display every value that the module can read from the ECU:

Back to top

Replay previously captured OBD commands and responses:

Back to top

 

External resources

OBD trouble code definitions

OBD commands

Back to top