Go Down

Topic: OBD2 Repeater (Read 449 times) previous topic - next topic

nomad350z

Hello,

I'm very new to Arduino and trying to skim OBD2 data so I can use the data and make a simple 'repeater' out of an Arduino micro.  

For a bit of background, I have an automotive module that relies on serial data via the OBD2 port to determine whether a series of conditions are met.  I no longer have the original ECU in the vehicle, and therefore do not have an OBD2 interface but still wish to use the standalone module.  

My intention was to create an OBD2 scanner using the CAN and OBD2 libraries (moderated by SandeepMistry) to read the required values and their format, then work on making the 'repeater' code once I knew their values.  

I'm running into issues with the OBD2 scanner.  I'm using an Arduino Uno, seeed Can Bus Shield (MP2515 chipset), and an RS232 DB9 to 16 port OBD2 cable.  For now, I'm relying on my laptop to provide power over USB while monitoring connectivity through the serial screen.  I've uploaded the basic example sketch from the OBD2 library to test out connectivity (OBD2_02_KeyStats).  Everything uploads fine, but attempting to connect to a running vehicle over OBD2 results in no connection.  

So, I have a few questions:
1. Am I missing hardware?  From the compatible hardware for the CAN and OBD2 libraries, an MP2515 shield should be sufficient.....
2. Is there a trick to connecting the arduino and the shields?  Running through the 'README' files in the library indicates the 'CS' and 'INT' connections may need to be flipped?  
3. Are the libraries I'm using only applicable to certain CAN communication formats?  As in, it might work with the older J1850W PWM but not the more modern protocols?

I realize this is a lot of information, but I'm hoping somebody has some idea of what I'm doing wrong....

Thanks,
-Garrett

TriB

Hello Garrett,

I´m not sure if I understand your attempt right.
  • Your car got an OBD2 port via K-Line (One wire serial communication) on pin 7 (and optional 15).
  • After upgrading you ECU, it now has CAN Bus (Pin 6 & 14) only.


Now you want to convert the signal from CAN to K-Line?

K-Line is not a Serial Port. So you cannot use a regular R232. But you can convert it with a L9637D.

I guess this will not end up just putting some data through. The initialization process is different between both protocols. The data might be similar, but headers and format wont.

Then you will have to create some kind of fake ECU to sniff the requests from your "module" and respond them with your findings. One command after another. Having an overview how and what the module wants, you can archive a translation between the ECU and those commands.

Don´t expect this to be easy! I can only recommend reading lots about those ISO and SEA J protocols to understand how it really works!

gilshultz

Do not forget you will have to translate the messages you get to what your existing unit requires.  OEM messages on OBDII change from year to year and manufacturer to manufacturer.  I would suggest if everything goes well you are looking at least 18 months to complete the project.  Consider replacing the unit you are trying to interface, it might cost a lot less.
This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

nomad350z

I don't believe I adequately explained the task; I removed the stock ecu (1999 GM, J1850 PWM SAE protocol) and replaced it with a stand-alone Holley unit (so no OBD2 com port at all). 

I had assembled the hardware listed above and attempted to test it on my wife's car (2014 Ford, CAN communication); I realize now that it obviously won't work.

My understanding for the OBD2 interface is there is a common PID for each type of data.  See the link: https://en.wikipedia.org/wiki/OBD-II_PIDs

My understanding is the CAN and ObD2 libraries used with the MP2515 chip and RS232 cable could pull the piDs and report out their values.  My goal was to identify the values for the PIDS I need, then replicate them and send the signal to the module. 

Go Up