Arduino OBD-II output - i.e. spoofing an engine

Ok, i want to do some data logging from an engine which doesnt have any ODB II in the ECU, but i would like to integrate it with the lap timer which does take an ODB II interface via Bluetooth.

Has anyone reverse engineered the OBD II interface to output data rather than just reading it in off the bus. Personally i cant see it as being a hard thing.

Or perhaps its easier to output directly to Bluetooth rather than via OBD II?

I'm afraid I don't know what you would consider "a hard thing". What do you know about obd or bluetooth?

To me implementing a "lap timer" isn't a hard thing UNTIL you introduce obd and/or bluetooth.

But try googling obduino anyway.

OBDUino is the reverse of what im after. Rather than reading in data from an OBD II port and displaying it, i want to take discrete analog and digital inputs (temp sensors, brake light, g-sensor etc) and output it to an OBD II connector.

I already have the basics of the project working:

That takes g-sensor, temp sensors, brake light, and GPS coordinates and outputs to the SD card. However, the output to SD card and the GPS serial input at 5hz absolutely rape the little Arduino, and hence i was thinking of removing those capabilities and using RaceChrono (www.racechrono.com) running on an S60 phone for that part. RaceChrono in turn takes OBD II input via a Bluetooth connection (something like http://www.ebay.com.au/itm/OBD-II-CAN-Bluetooth-Diagnostic-ELM-327-Reader-OBDII-/190517488692?pt=AU_Car_Parts_Accessories&hash=item2c5bba2c34). Hence i was wanting to take the data which my Arduino already receives and simply push it out to an OBD II compatible device.

The point of looking at obduino is so you get an idea what is involved with obd protocols and interface requirements. You have to make some decisions about what obdii interfaces and protocol(s) you want to support. Since you can't personally see it as being a hard thing to reverse engineer, then have at it.

Yeah, ive been looking at OBDuino, but cant find the source code anywhere on the site (http://obduino.ca/)

http://opengauge.googlecode.com/svn/trunk/

Though I have to think it makes more sense to keep your phone in your pocket and just use that lcd and an arduino and a gps unit to make a standalone lap timer.

RaceChrono does a lot of stuff im not overly inclined to repeat, sector timings, output to video etc. Its quite robust software.

Having the OBDII output to it will help immensely with the stuff it doesnt do.

Thanks for the link too.

Do you know what other pids racechrono is interested in? (gives some idea of what other sensors need to be incorporated into the obd stream)

Unsure at this point, i dont have the E71 i use with RaceChrono with me here at work. Ill have a squiz when I get home.

what kind of car are you driving? does it already have a reasonably standard data stream that you could convert maybe? i.e. aldl?

Unfortunately not. The engine is managed by a Haltech E6X, and the makers of Haltech are notorious for not letting anyone into their serial specs, predominantly because they sell a $2k datalogger to go with the ECU.

Just found this too: http://www.skpang.co.uk/catalog/product_info.php?products_id=706 Wonder if i could get it to write out over the CAN bus?

one other possibility, apparently racechrono uses csv files under the hood? http://bstdownload.com/under/RaceChrono/

IF you can figure out those formats and write them in realtime to a sd card or something on an arduino (or just a helper app on the racechrono device), then pop the card into your laptop to draw pretty pictures maybe?

Interestingly RaceChrono also supports this thing called "RaceLogger" (http://www.racelogger.com/). If i can find the protocol for that then im laughing.

Is there anything to stop a bluetooth to serial adaptor being connected to the arduino and this masquerading as the Bluetooth OBD2 adaptor(which I can't see being anything more)? then it would just be a case of watching serial data being produced from the phone app that requests data from a specific PID and then providing your response based on the arduino sensors? I think spoofing OBD2 itself (whichever protocol) would be tricky. Spoofing the serial data that the ELMXXX (or equiv) produces shouldn't be too bad.

I’m gonna have to try something similar myself, I will see if I can get an elm-bluetooth module and intercept the tx/rx and substitute in an atmega with a bunch of sensor readings. the elm protocol is a lot more straightforward than the obd quagmire.

I would start with a working obd module though, on an obd car, and sniff the AT commands being sent and the responses that a particular application is looking for. There are still a lot of AT commands on an elm (4 pages worth) and you don’t want to have to implement them all right off the bat, and having an actual transcript recorded of command and responses will help immensely with implementing the “dummy” commands and data structures.

http://www.elmelectronics.com/ELM327/AT_Commands.pdf

Ive bought a Bluetooth shield (http://iteadstudio.com/product/stackable-bluetooth-shield-bt-shield-v2-0/) and going to play with that. Will see how i go :)

I am about to start work on this technique as well.

I have 2 older (pre OBD) engines that I want to monitor via an Android App called "Torque". One engine is running a Megasquirt EFI system and the other is using a Megajolt Ignition system.

The Megasquirt outputs CANbus Data and the Megajolt outputs Serial Data. I have already built a little nixie tube gadget to decode and display the serial data from the Megajolt (here - http://www.youtube.com/watch?v=nHiYCZkAq5o ) and am working on the CANBus Interface for the Megasquirt for some Thermocouples at the moment.

So my next phase is to get the Arduino outputting ODB data into a Sparkfun serial-bluetooth module so I can get Torque to read it as if it is coming from an OBD2 Car.

Im busy looking around to see what I can find in this area (which is how I found this thread). If I find anything useful, I'll post it back here.. If anyone else has any pointers on an OBD output library, let us know please. Im off to have a poke through the OBDuino Code :)

Hello I am new to this forum and admittedly new to both Arduino and coding. I am getting into a project that is probably way out of my league skill wise but Id like to start somewhere. I would like to use an Arduino Uno in my car, using an input from an OBD-II port. I plan on using an OBD-II to CANBUS cable with a CANBUS Arduino shield and I am confident that I may be able to figure that part out fairly quickly. I do however have 2 pending questions. 1. How can i power the Arduino? Will i be able to use something as simple as a car charger with a usb cable? And what if i wanted something less intrusive and more permanent, is there anywhere that can power an Arduino that isnt too high of a voltage? Maybe somewhere i can hard-wire into my car? 2. I would like to use the speed of my car as in INPUT, my project is to make the arduino give an output that is either 1 or 2 based on the speed of a vehicle. So for example I could make output 1 for when the car is going under 30mph and then once the vehicle goes over 30mph the arduino sends an output to output 2. SO my question is, is this possible to do can i use something like car speed as an input? Also what about brakes, does the OBD-II port give out a signal for when the cars brakes activate?

Admittedly im not sure if this is even the right branch of the forum to ask but any help is appreciated or if you know of any other section of the forum that may have more knowledge on these questions please let me know. Thank you in advance for any help you can give me.