OBD-2 Input to the PIC


Closed Thread
Results 1 to 20 of 20
  1. #1
    Join Date
    Mar 2007
    Posts
    30

    Default OBD-2 Input to the PIC

    Hi all!

    I need to read some infos in a car, like the Fuel Level, Vehicle Speed, and other cool things, i need to input those in a PIC, there's an easy way to do this via OBD-2 in PIC BASIC Pro?

    (The car is a FORD that use the PWM interface)

    There's also another problem, i need some documents about the system that ford uses in OBD-2 via PWM, cause i've never worked with it, (But i've already studied PWM)

    Could you help me, even only giving me some links about that?

    Thank you!

    Luca

  2. #2
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    I've created several devices that use OBDII. The hard part is coding the communications protocol and designing the communications circuit from scratch. In addition you would need to purchase the SAE standard for OBDII to even get started.

    That being said there is a simple way to communicate with your car. A company called Elm Electronics sells ICs that handle all the communications with the vehicle and spits out the results to your PC or in your case PIC in ASCII. This frees your PIC up to do what you want it to do and speeds development.

    Go to http://www.elmelectronics.com/ and check out the ELM320 which is PWM or the ELM327 which is the all-in-one chip. I personally own every OBDII chip and love them, they work well.

  3. #3
    Join Date
    Mar 2007
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    Ok, but they are simple pics from microchip, right?

    so there's a way to code a software for a pic to do that,

    anyway, with that chip i can use all of the function of OBD?

    i can use the normal software for linux or windows that works with the serial obd?

    thank you!

    Luca

  4. #4
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by oslinux View Post
    Ok, but they are simple pics from microchip, right?
    so there's a way to code a software for a pic to do that...
    True they are just pics with code. You're welcome to spend the hundreds of dollars to buy the SAE standards, and then hours and hours creating code. I can say from personal expirence its a major task. I found that spending $14 on a device the handles all the communications was money well spent. Plus by changing Elm chips I can "talk" to different cars without rewriting my code.

    with that chip i can use all of the function of OBD?
    Depends what you mean. The product was designed to be an ODBII diagnostics tool. With the chip you will get all the normal engine data and diagnostic codes. The following site has some more information about the chip plus some free software and schematics. http://scantool.net/

    i can use the normal software for linux or windows that works with the serial obd?
    Not sure what you mean. If you're asking if you can tie your computer directly to the OBD buss the answer is no. There are currently 4 OBDII communications protocols all with very different communications methods but none are RS232 or TTL.

  5. #5
    Join Date
    Mar 2007
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DynamoBen View Post
    True they are just pics with code. You're welcome to spend the hundreds of dollars to buy the SAE standards, and then hours and hours creating code. I can say from personal expirence its a major task. I found that spending $14 on a device the handles all the communications was money well spent. Plus by changing Elm chips I can "talk" to different cars without rewriting my code.
    Ehhmmmmm... i guess you're right!

    Quote Originally Posted by DynamoBen View Post
    Depends what you mean. The product was designed to be an ODBII diagnostics tool. With the chip you will get all the normal engine data and diagnostic codes. The following site has some more information about the chip plus some free software and schematics. http://scantool.net/
    Ok.

    Quote Originally Posted by DynamoBen View Post
    Not sure what you mean. If you're asking if you can tie your computer directly to the OBD buss the answer is no. There are currently 4 OBDII communications protocols all with very different communications methods but none are RS232 or TTL.
    No, i meant "I can connect the serial output from the elm chip to a PC and then use a standard software for obd over serial to read the data?"

    thank you for your help!

    Luca

  6. #6
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    No, i meant "I can connect the serial output from the elm chip to a PC and then use a standard software for obd over serial to read the data?"
    Yes, the chip is designed to be used with something as simple as hyperterminal. No special software required.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DynamoBen View Post
    Yes, the chip is designed to be used with something as simple as hyperterminal. No special software required.
    I'm using an ELM327, got a few PCBs I designed on the way. Chip works like a champ and the 'shareware' that's out there works great too. Lots of software to choose from, just have to pick whichever one fits your wants/needs.

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,803


    Did you find this post helpful? Yes | No

    Default

    Can one use the OBD-II to, say, lock or unclock the doors, or open - close the windows or control other electric devices?

    Ioannis

  9. #9
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Talking

    Quote Originally Posted by Ioannis View Post
    Can one use the OBD-II to, say, lock or unclock the doors, or open - close the windows or control other electric devices?

    Ioannis
    The only tester I've seen which will do all that is the Star tester ford uses, only $3500 or so, My MT2500 won't do all that, at least with the older software I have, maybe the newest updated . . . I doubt it though.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  10. #10
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,803


    Did you find this post helpful? Yes | No

    Default

    Once I saw a car alarm that would do all the above. It may used the can-bus of the car for that purpose. Sure it used a 18F series controller.

    Ioannis

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    Once I saw a car alarm that would do all the above. It may used the can-bus of the car for that purpose. Sure it used a 18F series controller.

    Ioannis
    I wouldn't doubt you can use the CAN bus in a vehicle to control all of that and more. Problem is getting your hands on the codes/protocol to handle that. I'd bet that stuff would cost a load of $$$...unless it's on the net somewhere. I haven't found anything like that beyond generic troubleshooting type stuff so far...been searching off and on for a couple of years now...

  12. #12
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,803


    Did you find this post helpful? Yes | No

    Default

    This kind of info's are well kept secrets and are different for each type of car. I will try to find that guy that had the alarm systems. Are interested in a specific car to look?

    Ioannis

  13. #13
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    Can one use the OBD-II to, say, lock or unclock the doors, or open - close the windows or control other electric devices?

    Ioannis
    I recently helped another forum member create such a project, use the search above.

    Quote Originally Posted by Ioannis
    This kind of info's are well kept secrets and are different for each type of car. I will try to find that guy that had the alarm systems. Are interested in a specific car to look?
    It’s not really, if you have a copy of the standard its in there. If you're creative you could hook up the Elm device to the car and start capturing codes.

    BTW if you email Elm they will tell you that they don't support this type of interaction. That being said I've seen it done and it works, you really have to educate yourself on how the standard works and the different settings in the Elm chip.

  14. #14
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,803


    Did you find this post helpful? Yes | No

    Default

    OK. Thanks. I'll check it. I thought that only CAN-Bus was meant to do such "dangerous" and "wild" things on the car, not the more "innocent" ODB known to be a diagnostic tool.

    Thanks again,
    Ioannis

  15. #15
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Wink No open doors to steal cars, please ...

    Hi, Ioannis ...

    My car is a " quite fully " computerized one ...

    and , If I want to buy a new key, I MUST go to the dedicated garage ...

    You know why ???

    All the new key logging is made being connected to the OBD plug ... YESSS !!!

    I suppose you understand what this mean ... and some functions do not have to be explained on the Web ... or at your own risks ( There's a superb .444 cal. 94' model Winchester repeating gun home ... for your info !!! )

    The answer to your doors, glasses ...etc, control is YES ( but may be not with all car models ...)

    Regards

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  16. #16
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,803


    Did you find this post helpful? Yes | No

    Default

    I think you misunderstood my position. I was talking about a central control unit to control main functions of the electric devices in a car while being able to inform the driver about faults.

    For example to power on the Heater in the seats, lock doors by remote control without intervention to the electrical connections, etc. My job is not to steal cars! I already have lost a Honda Civic VTi because I did not protect it fully... :-(

    Now we developed a positioning system with GPS-GSM-GPRS to protect any moving object, car, boat etc. Lesson learned.

    Anyway thanks.

    Ioannis
    Last edited by Ioannis; - 3rd April 2007 at 13:21.

  17. #17
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Wink Take it easy ...

    Hi, Ioannis

    I know you for a while and understand you're honest ... of course !!!

    But you're not the only one on the line ... the problem is here.

    I also owned a 1.6 i Civic ( 130 PS ... no VTEC ) for 15 Years ... and the best antitheft system I found is to cut the Starter relay wire ... of course, a simple radio switch re-enabled the line as wanted !!! ( an old Veglia alarm system dating 1981 ...) ...
    Doesn't keep from using a heli to lift the car ... I admit ...

    Now, with 2 children ( and a wife ...) It's become a 2.0l Accord !!!

    Ok, back to us ...

    I 've read a bit about ( Laughs ...) and discovered you can access all the functions physically linked to the OBD plug ... as well as engine, anti-theft, seat heating, windows shutting ...
    All those functions can be read ( and data modified ...danger here !!!) from the dedicated terminal !!!
    It was just planned at first for easy maintenance and diagnose at the garage ...

    Those function codes are simply called "reserved" in the standard coding tables ( those you can freely download ...) and belong to constructors.


    I'll make you cry a bit, now ...

    I bought a 2nd hand 2004' 1600 Civic, 4 doors for my wife ... and of course, less than a week later, she forgot the unique key inside !!!

    Took me less than 5 Minutes to re-open it ... without damaging anything !!!

    Understand, if I had been the thief with my Obd terminal ... the car had been started in seconds ...

    The simplest anti theft will here be the best ... Engine not starting !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  18. #18
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    I also owned a 1.6 i Civic ( 130 PS ... no VTEC ) for 15 Years ... and the best antitheft system I found is to cut the Starter relay wire ... of course, a simple radio switch re-enabled the line as wanted !!! ( an old Veglia alarm system dating 1981 ...) ...
    Doesn't keep from using a heli to lift the car ... I admit ...

    I bought a 2nd hand 2004' 1600 Civic, 4 doors for my wife ... and of course, less than a week later, she forgot the unique key inside !!!

    Took me less than 5 Minutes to re-open it ... without damaging anything !!!

    Understand, if I had been the thief with my Obd terminal ... the car had been started in seconds ...

    The simplest anti theft will here be the best ... Engine not starting !!!

    Alain
    I took my Dodge pickup to Vegas a few weeks ago, went to all the casino's, parked in the free parking, etc.etc. Everywhere I went, after parking, I popped the hood (bonnett?) and took the main ignition coil wire with me. (Was that an ignition coil wire in my pocket or was I just happy to see them )
    But as you say, would that stop a relatively knowledgable thief from taking a spark plug off a cylinder and putting it in the main wire's place (actually, it would in this case because the main coil wire is a lot longer than any plug wire)? Probably not...
    And you guys have given me some good ideas on what to do with the CAN bus, sniffing the bus, logging parameters, etc. Now I just have to buy a car with CAN instead of ISO9141.

  19. #19
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,803


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    ...or was I just happy to see them )
    sure you were!

    Quote Originally Posted by skimask View Post
    Now I just have to buy a car with CAN instead of ISO9141.
    Thats easy. Every car dealer has one!!

    Quote Originally Posted by Acetronics View Post
    ... and the best antitheft system I found is to cut the Starter relay wire ...
    I agree. I thought of it too late of course... Now I own a Skoda Octavia RS that has all the busses (ODB and CAN) to play with.

    Quote Originally Posted by Acetronics View Post
    Doesn't keep from using a heli to lift the car ... I admit ...
    In my town 3-4 years ago they used a fork lift to take a car (Mercedes) that was parked inside the two lines of parked cars!
    That made me proceed to the design of the GPS-GPRS system that is quite capable. Now it is selling about 0-1 pcs per month! Great success!

    Quote Originally Posted by Acetronics View Post
    ...Took me less than 5 Minutes to re-open it ... without damaging anything !!!

    ...The simplest anti theft will here be the best ... Engine not starting !!!
    Alain
    Yeap, I did the same on my father's old honda. They open easily. But a video about the latest BMW prooved that the brand new "safer" locks are super easy to unlock without damaging the car!!! The company that makes the tools is German too!

    I agree second time, make the car unable to start is best way, simple and almost full proof.

    Ioannis
    Last edited by Ioannis; - 4th April 2007 at 09:20.

  20. #20
    Join Date
    Mar 2007
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    i've already buyed two ELM320, (One SMT and one TH),
    but in the net i've found this:

    http://www.sterntech.com/obdii_pic.php

    it's an:
    " Open source hand held OBDII code reader and scanner "

    " PIC 18F8680 based open source code reader. "

    there you can find the source, also.

    maybe it's useful!

Similar Threads

  1. Midi, Interrupts and Pic better than SX28?
    By Lajko in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th September 2008, 00:26
  2. PIC to PIC cooms using PICDEM 2 Plus
    By blake in forum General
    Replies: 0
    Last Post: - 28th March 2006, 23:50
  3. First pic controls #2.....
    By robert0 in forum Schematics
    Replies: 0
    Last Post: - 26th March 2006, 09:51
  4. Output PIC module
    By freelancebee in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th September 2005, 20:10
  5. How can i control pic input pins order?
    By tanero in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th August 2005, 12:46

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

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