I am familiar with logic controller programing, but new to Raspberry Pi. I need to read data from the CAN bus on a 2006 Ford F-250, 6.0 diesel motor; possibly through OBD-II (J1939) or perhaps directly from the bus (which I think is J2534). I would like the scan rate to be around 10Hz. That data — along with a few external 0-5v inputs — will then be fed into a fairly straight-forward program with perhaps a couple of lookup tables, which will create two PWM outputs & a couple of 0-12v on/off outputs.

My questions are thus:

a) Is the Raspberry Pi capable of doing this?

b) Is there an add-on card which can read the CAN bus data?

Thanks for your input.


Yes, it is possible.

You'll need ELM327 bluetooth device (you can buy it on Amazon etc., you can verify if it works correctly using Android device and some simple apps from Google Play - Torque is a great example). On Pi's side, USB bluetooth adapter would be needed. There is a pyObd library, written in Python, that handles OBD data transmission on Raspberry Pi.

For more details, have a look in this forum post - http://www.cowfishstudios.com/blog/obd-pi-raspberry-pi-displaying-car-diagnostics-obd-ii-data-on-an-aftermarket-head-unit

  • I appreciate your response. I have seen the ELM327, but I'd really rather avoid anything that is not hard wired; so Bluetooth is a no-go for me. Also, I won't have a display, as displaying the data is not necessary. Think along the lines of engine management; except that I only need a few outputs. I could buy a Motec System, but it has far more capability than I need; & they're very pricey! That's why I was thinking Raspberry Pi. – Cut7 Aug 10 '16 at 19:46
  • 1
    As soon as you get your data inside the Pi, you can do whatever you want using GPIO. If a wireless connection is your concern, maybe you should try USB version: google.pl/search?q=ELM327+USB According to this blog post icyntk.blogspot.com/2014/01/… it works well with Raspberry Pi. – Mark Aug 11 '16 at 8:03
  • Now we're getting closer. What I was hoping for was that someone has already done something similar in terms of the code (meaning they have figured out how to query the CAN bus to extract certain data) so I don't have to re-invent the wheel, so to speak. – Cut7 Aug 11 '16 at 19:31
  • If you have a look at a source code from the above tutorial - github.com/Pbartek/pyobd-pi/blob/master/obd_recorder.py - you'll see how to use pyObd library to fetch data. Do you know Python? – Mark Aug 12 '16 at 6:32
  • No, I don't. Can you recommend a good tutorial? – Cut7 Aug 12 '16 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.