7

Is there a way to connect CANBUS sniffer device to a PC (computer) with CAN-H and CAN-L pairs and test the sniffer device?

I want to convert my PC to an ECU emulator, connect a CANBUS sniffer device's CAN-H and CAN-L cable pair directly to a PC's COM port or Virtual COM over USB, and send data to the CANBUS sniffer device from my PC, to test that the CANBUS sniffer device is working properly.

1 Answer 1

8

Sadly you are not going to be able to do what you want simply connecting CAN-H and CAN-L to a serial port. Here is a pointer to the physical interface layer for CANBUS.

CANBUS Physical layer ISO 11898

What you will find is that while CAN is a "serial bus" that just means that the data is transmitted one bit at a time. It does not mean that it can be connected to a serial port. The serial port on your PC or the one on a USB to serial adapter require RS-232 input levels. CAN is roughly 2 or 3 volts and not the +3 to +15 or -3 to -15 required by RS-232. In addition the serial ports require a start and stop bit with 8 bits of data between them. That's not at all how data is transmitted on CANBUS.

What you need is a evaluation board for a CANBUS transceiver which will likely have an output you can connect to a PC via serial or USB.

To help describe this, here is a diagram of the standard architecture for these kinds of system:

Standard CAN bus architecture

Your PC would have to be at the other end of one of these connections on the "CAN BusLine" and hence would need an embedded CAN controller to talk to. The device you're trying to test will have a matching stack inside it, and you need one connected to your PC in order to talk to it. It's all possible by finding an evaluation board for an embedded CAN controller who's interface is serial or USB.

Hope that helps!

5
  • Your very welcome.
    – cdunn
    Commented Apr 12, 2016 at 11:15
  • Can you provide the links and directions for what hardware to buy and what software stack to use? E.g., canable.io looks like the right device, but how do we connect it to the CAN bus? likely there's a software stack too? Commented Dec 8, 2017 at 1:22
  • The diagnostic connector in most modern cars has pins on it for CAN bus and some of the other common buses. If you Google the pinout of an OBD-II connector you'll see pins for CAN. There are daughter boards for many popular micros.
    – cdunn
    Commented Dec 11, 2017 at 17:26
  • so you suggest buying an arduino or raspberry pi and the board(s) that allow connection of OBD2 to something like serial? Commented Dec 15, 2017 at 21:59
  • Looks like Kvaser kvaser.com has windows support and claims to work for linux with less documentation. Arduino board options are more manual. If there is a specific hardware/software stack, that's good, i'm interested. Commented Jan 5, 2018 at 21:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .