Page 1 of 1

Read vehicle speed with CANBUS

Posted: 21 Oct 2017 08:41
by kartal_0689
Hi,

How can I read vehicle speed with the CAN BUS protocol?
I plan to show this data on the LCD screen on my car.
can you give sample code?

Thank you,

Best Regards.

Re: Read vehicle speed with CANBUS

Posted: 25 Oct 2017 14:02
by dusan.poluga
Hello,

It should be possible to read the vehicle speed over can if you know what packet contains that information on the can bus.
Unfortunately there are no practical examples showing how this can be done.

Best Regards,

Re: Read vehicle speed with CANBUS

Posted: 25 Oct 2017 16:32
by kartal_0689
dusan.poluga wrote:Hello,

It should be possible to read the vehicle speed over can if you know what packet contains that information on the can bus.
Unfortunately there are no practical examples showing how this can be done.

Best Regards,
Thanks,

Can I use the "CAN" library in the compiler for this?

Best Regards

Re: Read vehicle speed with CANBUS

Posted: 26 Oct 2017 10:41
by dusan.poluga
Hello,

You can use our compiler library as a base configuration for your project.

Best Regards,

Re: Read vehicle speed with CANBUS

Posted: 14 Jun 2018 23:54
by GShettlesworth
Wikipedia has an in-depth discussion of the On-Board Diagnostics (OBD-II) and the Parameter Identification Codes (PID's). Using the CAN-Bus, you send the On-Board Computer (OBC) a code with the appropriate Address and PID (e.g.,
0x7DF : Address
0x02 : Two valid bytes following
0x01 : Show Current Data
0x0D : Show Vehicle Speed
0x5555555555 : Filler bytes - ignored
The OBC will respond with an Address and PID in CAN-Bus FrameFormat (8-bytes) e.g.,
0x7EF : Address
0x04 : Four bytes in this response
0x41 : Current Data Snapshot
0x0D : Vehicle Speed
[byte] : Speed between 0-255 Km/h
0x00000000 : Filler bytes - ignore these
Continue querying for updates on the vehicle speed.

Hope this helps - you'll probably need to adjust these values for your specific vehicle, but at least this is the general sequence you'll need to get the data from your car. Good luck.