CAN Adapters

In this chapter, two USB-to-CAN adapters are discussed. These adapters are used to connect a computer to a CAN bus, and to send and receive CAN messages. Some adapters also support CAN FD.

comma.ai red panda

The comma.ai red panda is a USB-to-CAN adapter. It's mainly designed to work with the comma.ai openpilot project, but can also be used as a generic USB-to-CAN adapter. It is based on the STM32H725 microcontroller and has open source firmware. It supports CAN FD on all three main buses, plus the multiplexed bus.

The panda is mainly intended to be used through comma.ai's Python API, which makes it easy to build custom tools for interacting with a vehicle. The Python API has support for efficiently sending and receiving CAN messages, but also implements high-level protocols such as ISO-TP, UDS, and CCP.

The red panda exposes vehicle signals through comma's OBD-C connector. To break this out for bench use, use an OBD-C cable and a CAN Bus Throwing Star.

The comma.ai red panda USB-to-CAN adapter.The comma.ai red panda USB-to-CAN adapter.

PEAK-System PCAN

PEAK-System makes a range of PCAN adapters. The PCAN-USB FD is a single-channel USB adapter for CAN and CAN FD. It uses a DB-9 connector, supports ISO and non-ISO CAN FD, has galvanic isolation, and is supported by the Linux SocketCAN driver stack. PEAK also provides PCAN-View and the PCAN-Basic API for Windows.

The classic PCAN-USB is also available if CAN FD is not needed.

The PEAK-System PCAN-USB FD adapter, with a DB-9 connector and USB cable.The PEAK-System PCAN-USB FD adapter, with a DB-9 connector and USB cable.

Standard DB-9 Pinout for CAN

Many CAN adapters use a DB-9 connector to expose the CAN bus. The most common pinout is shown below. Usually a separate DB-9 connector is used for each CAN bus, but sometimes two are combined on the same connector. Hover over a pin or row to highlight the matching function.

DB-9 — Standard CAN Pinout

Male connector, as seen from the connector side
1L23L456H7H89
FunctionMnemonicPinsDescription
CAN 1CAN17, 2Primary CAN bus. High on pin 7, low on pin 2.
CAN 2CAN28, 4Optional second CAN bus, used when two buses share one connector.
GroundGND3, 5, 6Signal and shield ground.
12 V+VB9Optional +12 V supply for bus-powered devices.