Has anyone interface ODB-II to zbasic

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Has anyone interface ODB-II to zbasic

Post by FFMan »

Has anyone interface ODB-II to a zbasic cpu ?

It ought to be quite straightforward using an interfade cable to serial, just a case of understanding the protocol in a bit more depth.

I have yet to find detailed command and response examples and if wondered if nayone had a woring code to get me started ?

thanks
pdubinsky
Posts: 70
Joined: 24 November 2005, 18:19 PM
Location: South Carolina
Contact:

Has anyone interface ODB-II to zbasic

Post by pdubinsky »

Ah, that devil in the details. For a number of years I made a product, the DataCam2, that read operating data from the OBDII port and overlayed it on a video feed which was then recorded for later viewing.

The interface is not a simple serial connection. First, the ZX24 family has a TTL interface and the OBDII port uses one of a number of protocols that are not compatible with the TTL or RS232 interface. The OBD protocol timing is precise enough to make it nearly impossible for the ZX24 to keep up.

I used a couple of different chips that are readily available rather than try to do the interface with the ZX24. The most commonly used chip is from Elm Electronics, the ELM327. I suggest you investigate this page:

http://elmelectronics.com/obdic.html#ELM329

BTW, what are you trying to do?

P
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Post by FFMan »

thanks for the info - after the post I found the elm site and this does seem like the way to go. i found various bits of sample code also.

first step to make sure the elm based product talks to the vehicle in question.

i have some testing etc to.

in terms of what i'm trying to do, i have another post about developing a cruise control for my van. i have still not decided whether the control of speed will come rpm (from obd) or from speed obtained via gps.

just toying with ideas at the moment
pdubinsky
Posts: 70
Joined: 24 November 2005, 18:19 PM
Location: South Carolina
Contact:

Has anyone interface ODB-II to zbasic

Post by pdubinsky »

If the vehicle is in the US and has an OBD connector, you can go to any of the chain Auto Parts stores and ask them to do a scan. They will be able to tell you what protocol the vehicle uses.

You can google the vehicle's VIN number to find it's origin. If the vehicle is an automobile or light truck, it will have an accessible OBDII system.

If you use the rpm data, you'll need to know what gear the vehicle is in and that data may not be accessible through the OBDII system. I would guess that the best/easiest data to get is the OBD vehicle speed.

You'll easily get 4 updates per second using the Elm327. GPS, on the other hand, unless you use a fairly sophisticated GPS receiver, you be limited to one update per second (and have the usual GPS reception issues ie. tunnels, trees, building canyons, etc.)

Good Luck,
P
kurakaira
Posts: 77
Joined: 21 March 2007, 1:21 AM
Location: Finland

Post by kurakaira »

I have a question about the ELM327 , is it easy to read OBD trouble codes with it ?
I have a project that needs to read a few specific trouble codes and if present reset them .
I was thinking that a ELM327 and ZX-328n would do the trick ?
Better suggestions / insight would be greatly appreciated .
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Post by FFMan »

Something elm based and a 328 would be just the job,

just check the elm reads your car. not all supposedly obd compliant stuff reads, diesels had a later incept date and my ford requires one of the rarer protocols that my elm won't read.

you can get an elm device with a serial (as opposed to usb) connector ifyou look around.
Post Reply