Results 1 to 6 of 6

Thread: Help a programmer who knows little about cars understand OBD-II (please?)

  1. #1
    Newbie
    Join Date
    Sep 2012
    Posts
    1

    Question Help a programmer who knows little about cars understand OBD-II (please?)

    Hello. I don't know much about cars, but I'm knowledgeable in computer software programming, and I just recently learned about the OBD-II interface and I'm very interested in it. I wanted to try developing simple software to communicate with OBD-II vehicles, but first I'd need to understand exactly how I'm communicating with the car.

    One thing I'm confused about is how the car's language is translated into a computer-readable language. I know that the data is delivered to a computer via serial connection. Assuming I'm using an OBD-II to USB adapter with an ELM327 microcontroller, what exactly is the microcontroller doing? Is it taking languages like ISO 9141-2, SAE J1850 PWM, etc. that are sent from the car's OBD-II port and translating them into the standardized OBD-II PID hex format so that my computer can understand it? What happens if you use a different microcontroller, will the computer still receive the same messages in the same format, or will they be formatted differently?

    Another thing I'm wondering is why the VAG OBD-II cable I'm using won't work with my '98 Nissan Maxima. I do understand that VAG is meant for VWs, but it should still handle generic OBD-II regardless, right? It even states on the product's page that it supports ISO9141, which I believe Nissan vehicles use. I already ordered an ELM327 cable that I'm hoping will actually work with my Maxima, but I'm just curious as to why the VAG one will not work on my car.

    I'm also just confused about the general flow of the information. As far as I know, it goes from OBD-II, then to a microcontroller that translates the information back and forth, then to a serial interface, and then, finally, to a computer.

    Can anyone help me understand OBD-II more in-depth? Thank you!

  2. #2
    North of the land of Hey Huns
    Auto Apps:loading...

    Join Date
    Jun 2004
    Location
    Westminster, MD
    Posts
    2,127
    Quote Originally Posted by Huskehn View Post
    Hello. I don't know much about cars, but I'm knowledgeable in computer software programming, and I just recently learned about the OBD-II interface and I'm very interested in it. I wanted to try developing simple software to communicate with OBD-II vehicles, but first I'd need to understand exactly how I'm communicating with the car.
    Hi! What programming languages are you familiar with? I've written a Qt/c++ library for interfacing with ELM compatible devices, as well as a .NET library.. Both of which make interfacing with an ELM device significantly easier.

    Quote Originally Posted by Huskehn View Post
    One thing I'm confused about is how the car's language is translated into a computer-readable language. I know that the data is delivered to a computer via serial connection. Assuming I'm using an OBD-II to USB adapter with an ELM327 microcontroller, what exactly is the microcontroller doing? Is it taking languages like ISO 9141-2, SAE J1850 PWM, etc. that are sent from the car's OBD-II port and translating them into the standardized OBD-II PID hex format so that my computer can understand it? What happens if you use a different microcontroller, will the computer still receive the same messages in the same format, or will they be formatted differently?
    That's pretty much what the microcontoller does. It has supporting hardware to convert the different communication voltages into microcontroller compatible voltages, and then the microcontroller handles parsing the actual protocol and communicating it to you over serial or USB. There's no "standardized OBD-II PID hex", that's just ELM327 compatible formatting. If you use a different microcontroller that dosen't support the ELM327 style formatting, it will not work with software meant to work with ELM327's (most generic software out there). What other microcontroller are you thinking of using? You thinking of rolling your own?

    Quote Originally Posted by Huskehn View Post
    Another thing I'm wondering is why the VAG OBD-II cable I'm using won't work with my '98 Nissan Maxima. I do understand that VAG is meant for VWs, but it should still handle generic OBD-II regardless, right? It even states on the product's page that it supports ISO9141, which I believe Nissan vehicles use. I already ordered an ELM327 cable that I'm hoping will actually work with my Maxima, but I'm just curious as to why the VAG one will not work on my car.
    Because your car isn't a VAG-COM car, it probably won't work with a VAG-COM cable. Makes sense to me. The second cable you ordered is an ELM327 style cable, but it is a cheap chinese clone, so it may or may not work reliably.

    Quote Originally Posted by Huskehn View Post
    I'm also just confused about the general flow of the information. As far as I know, it goes from OBD-II, then to a microcontroller that translates the information back and forth, then to a serial interface, and then, finally, to a computer.

    Can anyone help me understand OBD-II more in-depth? Thank you!

    VERY top level:
    PC: Send request to microcontroller
    Microcontroller: Translate response to a hardware protocol the ECU understands, send request to ECU
    Microcontroller: Wait for response from ECU, translate it, and send it back to PC
    PC: Receive response and parse it.

    My suggestion? Don't try to do too much. Get a ELM327 interface. I HIGHLY recommend using the ones from http://www.scantool.net, as they are superior in almost every way, and reliably connect (and connect faster) every time.
    "stop with the REINSTALLS, what do you think we got some lame-o installer!!!" - mitchjs
    RevFE
    My Shop

  3. #3
    Variable Bitrate
    Join Date
    Oct 2008
    Posts
    376
    A vag-cable with Vag-com version 5 or newer should be able to read OBD2.
    It can't read the J1850 protocols (no hardware), but I don't think Nissan uses that.
    But a '98 model does not have to be compliant to OBD2. That's only in the USA and Canada.
    So, if you live outside North-America even the ELM327 might not work on your car.

    Some info about OBD2 and EOBD (the European version):
    http://en.wikipedia.org/wiki/OBD-II_PIDs

  4. #4
    Newbie
    Join Date
    Sep 2012
    Posts
    1
    Hi All, Im trying to find out how to communicate with ELM327 bluetooth device with an Android device. Im basicly a complete novice here, but wanting to learn. How could I monitor the traffic/messages from the OBD adapter? Would I try to read the bluetooth socket after devices are paired? And are there anywhere a specification available what kind of messages I would be sending and receiving? I have a Golf mk5 my2006 which Im trying to read into. Malcom looks to be very knowledged about this but you dont happen to have Android libraries available? Thanks for any basic beginner tips or pointers where to read more about this!!

  5. #5
    VENDOR - ScanTool Vitaliy's Avatar
    Join Date
    Dec 2006
    Location
    Phoenix, AZ
    Posts
    624
    OBDLink MX: world's smallest, fastest, most advanced OBD/Bluetooth adapter with SW and MS CAN support. Read the review to learn more.
    Need to look up a diagnostic trouble code? Try the most up-to-date, free DTCsearch.com!

    You cannot send me a private message using this forum. Use my email instead: vitaliy[@]scantool.net.

  6. #6
    North of the land of Hey Huns
    Auto Apps:loading...

    Join Date
    Jun 2004
    Location
    Westminster, MD
    Posts
    2,127
    Quote Originally Posted by GGTI View Post
    Hi All, Im trying to find out how to communicate with ELM327 bluetooth device with an Android device. Im basicly a complete novice here, but wanting to learn. How could I monitor the traffic/messages from the OBD adapter? Would I try to read the bluetooth socket after devices are paired? And are there anywhere a specification available what kind of messages I would be sending and receiving? I have a Golf mk5 my2006 which Im trying to read into. Malcom looks to be very knowledged about this but you dont happen to have Android libraries available? Thanks for any basic beginner tips or pointers where to read more about this!!
    Unfortunatly, my Android libraries are not open source, however there is some open source stuff out there: http://code.google.com/p/android-obd-reader/

    Also, read the links Vitaliy posted, they are quite helpful in getting an idea exactly what's required in terms of actual communication and message parsing.
    "stop with the REINSTALLS, what do you think we got some lame-o installer!!!" - mitchjs
    RevFE
    My Shop

Similar Threads

  1. PIC Programmer
    By meddler in forum General Hardware Discussion
    Replies: 6
    Last Post: 04-26-2008, 10:45 PM
  2. WTD: USB pic programmer
    By lez in forum Classified Archive
    Replies: 0
    Last Post: 07-07-2006, 06:23 AM
  3. Which PIC Programmer??
    By Lewis187 in forum Power Supplies
    Replies: 3
    Last Post: 05-10-2006, 10:32 AM
  4. Pic Programmer
    By KyleYankan in forum Hardware Development
    Replies: 7
    Last Post: 05-02-2005, 12:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •