PDA

View Full Version : OBD-2 Input to the PIC



oslinux
- 1st April 2007, 18:07
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

DynamoBen
- 1st April 2007, 19:59
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.

oslinux
- 1st April 2007, 21:50
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

DynamoBen
- 1st April 2007, 22:07
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.

oslinux
- 1st April 2007, 23:43
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! :D



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.



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

DynamoBen
- 2nd April 2007, 00:41
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.

skimask
- 2nd April 2007, 04:04
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.

Ioannis
- 2nd April 2007, 07:26
Can one use the OBD-II to, say, lock or unclock the doors, or open - close the windows or control other electric devices?

Ioannis

Archangel
- 2nd April 2007, 07:44
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.

Ioannis
- 2nd April 2007, 09:18
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

skimask
- 2nd April 2007, 13:47
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...

Ioannis
- 2nd April 2007, 14:23
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

DynamoBen
- 2nd April 2007, 15:06
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.


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.

Ioannis
- 3rd April 2007, 08:32
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

Acetronics2
- 3rd April 2007, 10:06
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

Ioannis
- 3rd April 2007, 11:54
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

Acetronics2
- 3rd April 2007, 14:19
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

skimask
- 3rd April 2007, 15:04
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 :D )
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.

Ioannis
- 4th April 2007, 09:18
...or was I just happy to see them :D )
sure you were!


Now I just have to buy a car with CAN instead of ISO9141.

Thats easy. Every car dealer has one!!


... 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.


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!


...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

oslinux
- 4th April 2007, 14:00
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!