Page 1 of 4 1234 LastLast
Results 1 to 10 of 31

Thread: How to begin OBD development?

  1. #1
    Newbie
    Join Date
    Jun 2008
    Posts
    6

    How to begin OBD development?

    Hello there,
    i'am planing to play a little bit with the OBD capabilities of modern cars. Before digging a bit deaper into the topic, in nead some guidance. So i it would be very nice, if someone could answer these questions

    (1) Were to find structured information about getting data from OBD-Interface? Plugin in the Interface, connecting a computer via USB/Seriel and then - how to get the first data?

    (2) Is there a car emulator for Windows PCs? So a program which acts like a car and sends the information to the usb or serial interface as a real car would do?

    This would be a very helpful set of beginner instructions, to grab the first signal with a self developed OBD software.

    Thank you so much for any guidance
    Bye

  2. #2
    Newbie
    Join Date
    Jun 2008
    Posts
    6
    (1) Were to find structured information about getting data from OBD-Interface? Plugin in the Interface, connecting a computer via USB/Seriel and then - how to get the first data?
    I recently started a project to make a digital gauge cluster useing the OBD-II interface. The cable I bought (on ebay) connects via USB. However, it is nothing more than an emulated Serial port (COM port). So, to request and receive information from the car, I needed to communicate through the COM port. I'm not sure what language you plan on programming in, so your route may be a bit different than mine.

    These are the very basics:

    (1.) to start communications, send "ATZ" to the port. It will respond by echoing back "ATZ" and the version of the chip you are using (in my case ELM v1.2)

    (2.) to turn off echoing of your commands send "AT0" <--Thats A-T-Zero. It should reply with "OK" or something similar

    (3.) To get information for a specific item, you send it's PID. You can get a list of PIDs from here: http://en.wikipedia.org/wiki/Table_of_OBD-II_Codes

    (4.) After you send the PID it will respond with the requested information in the form of HEX values. You need to convert the Hex values to decimal values and then use the information from the "Formula" column in the PID table to calclulate your ending value.

    (5.) Request the next piece of information to continue the program.

    Those are the basic steps. If you need some source code in VB.net 2005, let me know. Its not complete, but it should give you an idea of how to get the information.

    (2) Is there a car emulator for Windows PCs? So a program which acts like a car and sends the information to the usb or serial interface as a real car would do?
    There used to be one called (I believe) Jelmulator. I haven't been able to find any working links to it though. If you find one, please let me know! It would be much easier than running out to my car to program!

    Good luck with your project!

    -Ray

  3. #3
    Newbie
    Join Date
    Jun 2008
    Posts
    6
    My last post is lost on some moderator's desk, so I'll try again:

    Once you have an OBD-II USB adapter and install it on your machine, you can use your favorite programming language to talk to it. In my case, I use Visual Basic .Net 2005. The adapter talks to the computer via an emulated serial port (or COM) port. You will need to connect to the COM port and send first an initialization command (ATZ) then the PID for the data you want to recieve. You can get a list of PIDs from wikipedia. If you search for "ODB-II PIDs" in google, you will find the page. The table they supply also gives the formulas you will need to calculate the data once you recieve it back from the COM port (the data is send and recieved as HEX codes that need to be converted to decimal).

    Hope that helps. If you need help, let me know and I'll do my best. I'm developing a digital gauge cluster based on the information from my OBD-II port. So far it seems to be working well.

    Good Luck,

    Ray

  4. #4
    It ain't easy being a green moderator meddler's Avatar
    Join Date
    Aug 2002
    Location
    Steps out the front of Henson's workshop or Sydney
    Posts
    2,782
    Quote Originally Posted by PC_Cruiser View Post
    My last post is lost on some moderator's desk, so I'll try again:
    It happens.
    Never let the truth get in the way of a good story

  5. #5
    Newbie
    Join Date
    Jun 2008
    Posts
    6
    Thank you, i would be very interested in some sample code.

    But i think without a PC based testing environment, it's very hard to start. The first point is, that i have to develop in the car, the second that i can damage it

    How develop the pros? There must be a testing environment?

  6. #6
    Variable Bitrate
    Join Date
    Nov 2007
    Posts
    303
    Write yourself a car emulator. Start by choosing (or defining) an API that your software will use to send and receive bytes. Forget about the OBD2 interface for a moment - just think in terms of bytes sent and received.

    At the same time you write your code to send and receive simple packets, also write code that acts like a car, receiving the same packets, parsing them, and responding with the appropriate packets. Test your code by running it against your fake car. When that works, then go test it in a real car. If you've done it right, it'll just work. Realistically though it probably wont work the first time, but if you have your software log all of the bytes that it sends and receives (I suggest writing to a text file, in hexadecimal), then you can study the logs to see what you're doing wrong. If the response from the car isn't what you expected, then revise your car emulator so that it behaves just like the car itself.

    Once your test harness emulates the car correctly, you can make a lot of progress in the comfort of your home. Then you can just periodically test in the car to verify that things still work there too.

    Do some research and see if your car speaks only OBD2, or if the manufacturer has a proprietary extension to OBD2 that gives better performance. Subaru uses SSM, Mitsubishi uses MUT, and so on. Then look for documentation on those protocols. Basically it's just a matter of creating the right series of bytes to send to the car, and parsing out the bytes that you receive in response. If you can find a document that describes those byte sequences, then you can write code to send and receive them.

  7. #7
    Newbie
    Join Date
    Jun 2008
    Posts
    6
    Thanks a lot for your reply My concern is, that i'am doing something wrong, sending wrong bytes through the channel, which causes a damage. I've done some socket programming in Java, which is really close to what you've described (sending some bytes, waiting for the answer, adjusting the program). But writing your own test environement makes a lot of assumptions, which are perhaps wrong. So a pre build car emulator would give me the confidence, to not damage my car.

  8. #8
    Newbie
    Join Date
    Mar 2008
    Posts
    17
    Quote Originally Posted by PC_Cruiser View Post
    .....

    (5.) Request the next piece of information to continue the program.

    Those are the basic steps. If you need some source code in VB.net 2005, let me know. Its not complete, but it should give you an idea of how to get the information.

    Hi Ray - I'm just about to begin this part of my project as well and would love to see any vb.net code that you are willing to share.

    Thank you so much!!!!!

    JoeBerni

  9. #9
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,121
    Blog Entries
    51
    Quote Originally Posted by PC_Cruiser View Post
    I recently started a project to make a digital gauge cluster useing the OBD-II interface. The cable I bought (on ebay) connects via USB. However, it is nothing more than an emulated Serial port (COM port). So, to request and receive information from the car, I needed to communicate through the COM port. I'm not sure what language you plan on programming in, so your route may be a bit different than mine.

    These are the very basics:

    (1.) to start communications, send "ATZ" to the port. It will respond by echoing back "ATZ" and the version of the chip you are using (in my case ELM v1.2)

    (2.) to turn off echoing of your commands send "AT0" <--Thats A-T-Zero. It should reply with "OK" or something similar

    (3.) To get information for a specific item, you send it's PID. You can get a list of PIDs from here: http://en.wikipedia.org/wiki/Table_of_OBD-II_Codes

    (4.) After you send the PID it will respond with the requested information in the form of HEX values. You need to convert the Hex values to decimal values and then use the information from the "Formula" column in the PID table to calclulate your ending value.

    (5.) Request the next piece of information to continue the program.

    Those are the basic steps. If you need some source code in VB.net 2005, let me know. Its not complete, but it should give you an idea of how to get the information.



    There used to be one called (I believe) Jelmulator. I haven't been able to find any working links to it though. If you find one, please let me know! It would be much easier than running out to my car to program!

    Good luck with your project!

    -Ray

    I've been looking into creating an rr extension plugin for OBD-II. If you could provide your sample code that would definitely help me get started.
    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
    Find my plugins on the MP3Car App Store!
    Follow Me on Twitter or Facebook
    Live mp3Car Facebook Chat

  10. #10
    Variable Bitrate NeonDev's Avatar
    Join Date
    Feb 2008
    Posts
    431
    But i think without a PC based testing environment, it's very hard to start. The first point is, that i have to develop in the car, the second that i can damage it
    So I am new to this as well... and I would like to know how it is possible to damage your car through OBD-II
    check us out at: www.neonboombox.com

Page 1 of 4 1234 LastLast

Similar Threads

  1. OBD II connector on an OBD I car
    By HearseNurse in forum Engine Management, OBD-II, Engine Diagnostics, etc.
    Replies: 6
    Last Post: 03-23-2009, 09:52 AM
  2. 1999 Saab 9-5 OBD, and more
    By nblracer in forum Newbie
    Replies: 1
    Last Post: 05-08-2008, 10:52 PM
  3. OBD or special hardware?
    By Jirka Jirout in forum General Hardware Discussion
    Replies: 2
    Last Post: 03-04-2007, 05:01 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
  •