|
OBDuinoInterface
OBDuino OBD2 cable and Interfaces
IntroductionYou cannot directly connect pins from the OBD-II plug to the Arduino board. You need a small interface that convert the signal. Whatever the interface needed, you also need a cable that will bring you the signals from the OBD-II plug to your OBDuino. For all cases: The Arduino is powered by the 12V line coming from the cable too so you need to bring some wires from the DB9M to the Arduino like this: Arduino 12V input ------------------ DB9M pin 9 (12V Battery) Arduino GND input ------------------ DB9M pin 2 (Chassis Ground) Some cars have only one ground so you may have to use DB9M pin 1 instead of pin 2 to power the board or just solder pin 1 and 2 together CableTo keep compatibility with already existing cable, the OBDuino Interface pinout for the OBD-II to DB9F cable is wired like this: DB9F OBD-II 1---------------5 (Signal ground) 2---------------4 (Chassis ground) 3---------------6 (CAN High) 4---------------7 (ISO K line) 5---------------14 (CAN Low) 6---------------10 (J1850 bus-) 7---------------2 (J1850 bus+) 8---------------15 (ISO L Line) 9---------------16 (Battery) Do not plug it into a PC!!! This goes to an interface only!!! Example of my home made cable:
A nice place to get OBD-II plugs and already made cable is Senso which are located in Canada. You can also find plugs at http://www.carplugs.com/ or http://www.obd2allinone.com/sc/details.asp?item=obd2cable and others. CAN only cableA proposed CAN only cable, smaller and thinner, can be wired like this: RJ-10 OBD-II 1 (black) ------5 (Signal ground) 2 (red)---------14 (CAN Low) 3 (green)-------6 (CAN High) 4 (yellow)------16 (Battery) source http://www.controllerareanetwork.com/CANcables.htm InterfacesInterface for ISOThis interface converts the ISO signals for the Arduino inputs. It consists of a small IC (Freescale MCZ33290EF), a 510 ohms resistor, a DB9M that will be plugged with the cable mentioned above, and few wires that connect to the Arduino board. The MC33290 is a small chip, you can solder some wires on it for better handling. Schematic is like this: MC33290
+-------+
Arduino pin 1 -------------5|TX ISO|4-----------------+------- DB9M pin 4 (ISO K Line)
| | |
Arduino pin 0 -------------6|RX GND|3--DB9M pin 1 / between MC pin 4 and pin 1
| | \ goes a 510 ohms resistor
Arduino 5V pin output -----7|VDD NC|2-- /
| | |
Arduino 5V pin output -----8|CEN VBB|1-----------------+------- DB9M pin 9 (12V Battery)
+-------+Interface front:
Interface back:
Interface with ELMCAN protocol is not easy to program so as a phase 1 I am using an ELM327 for this. This chip integrates all protocol so it could be used for ISO/VPW/PWM as well, but it's a $32+s/h chip that add to the duino and LCD, plus a few components. Note that for PWM/VPW it should be possible to use an ELM320 or ELM323 respectively, which is cheaper than the ELM327 and would require almost no change to the code, but you would still need to do some hadware, schematics are avalaible on some web site. Diagram of the interface (adaptation of the generic diagram found in the PDF of the ELM327):
On the diagram, note that CAN-L (OBD2 pin 14) go to a DB9M pin 5 and CAN-H (OBD2 pin 6) go to a DB9M pin 3. +5V comes from the Arduino board.
Interface for CANMicrochip offers solution for CAN bus, mainly their MCP2551 for the physical layer (as on the ELM327 diagram above) and their MCP2515 for the protocol. The advantage is that it costs only a few $. To manipulate CAN message, I use a free library made by Fabian Greif called libcan, his library also supports manipulation of the MCP2515 through SPI with an AVR, it's a little bit technical but let's say it helps me a lot as I do not have to re-invent the wheel! Design/Board will follow |
Great job. I’m interested in the Interface with ELM do you have a part list? Since I found some discrepancies between the diagram and the picture 6 caps in the diagram, 5 in the picture
Say I build the circuit with the MC33290 chip. What command would I send to the OBD port to get the vehicle speed and how would I be able to capture the response? Looking for some sample code, so I can start understanding the process. Thanks!
The ISO schematic has been removed, was it inaccurate? I've been using it as a starting point (but added some components for cleaner power).
It's still here, it's just on the other wiki page: http://code.google.com/p/opengauge/wiki/OBDuinoDiagram
Thanks so much for the tips on this! Has anyone implemented talking to the MCP2515 through SPI from a microcontroller? Are you able to get fairly real-time data throughput? thanks!
Great, I'm working at a similar project. I want to show data like oil temperature, boost pressure etc, wich I read from the CAN in my VW. Do you have a lists where I can find the object identifiers for the different values send by the engine control unit?
I'm planning to use the Arduino plus ODBII Interface to control the Exhaust Flaps (B&B Fusion Dual Mode Exhaust) of my 2000 Corvette Coupe. The Plan is to control the Valve what changes from silent mode to loud freeflow based on Engine RPM and Load. Hopefully it works, anybody here who used the Interface in a Corvette?
Where can I get help building the software for reading OBD II codes?
I have a workshop manual for a Passat with the codes