Site Information

 Loading... Please wait...

Blog

Exploring the PiCAN Series and SocketCAN: A Powerful Duo for Raspberry Pi CAN Bus Applications

Posted by Wilfried Voss on

The PiCAN series from Copperhill Technologies brings robust CAN Bus capabilities to Raspberry Pi systems, providing essential tools for automotive, industrial, and robotics projects. These boards are compact, powerful, and compatible with SocketCAN, the standard CAN interface for Linux systems. Whether you’re developing diagnostic tools, data loggers, or real-time communication systems, PiCAN HATs offer a reliable and open-source-based path forward.

This blog post introduces the PiCAN family of HATs, explores their compatibility with SocketCAN, and provides a concise technical description of each board.


What is SocketCAN?

SocketCAN is a set of open-source CAN drivers and a networking stack that is built into the Linux kernel. It abstracts CAN devices in a way similar to how Ethernet devices are handled, using the Berkeley socket API. This allows developers to work with CAN interfaces just like they would with standard network interfaces, simplifying development and integration on Linux platforms such as the Raspberry Pi.

Core Benefits of SocketCAN:

  • Standardized Programming Interface: Applications can communicate with CAN devices using familiar socket APIs (AF_CAN, SOCK_RAW, etc.).

  • Multi-Protocol Support: Compatible with CAN 2.0, CAN FD (Flexible Data Rate), ISO-TP, and other higher-layer protocols.

  • Diagnostic & Debugging Tools: Compatible with tools such as can-utils, Wireshark, and libraries like python-can.

  • Scalable & Flexible: Supports multiple CAN interfaces running simultaneously.

Every PiCAN board mentioned below is fully compatible with SocketCAN, enabling seamless configuration and development using Linux tools and scripts.


The PiCAN Series: Board-by-Board Overview

The PiCAN product line includes a variety of HATs designed to serve different functional requirements. All of them are mechanically and electrically compatible with standard Raspberry Pi headers and powered through the Pi itself.

1. PiCAN2 – CAN Bus Interface for Raspberry Pi

  • CAN Controller: MCP2515 (SPI interface)

  • Transceiver: MCP2551 or TJA1050 (depending on revision)

  • Connector: DB9 and 3-way screw terminal

  • Termination: Onboard 120Ω resistor with jumper

  • Special Features: Optional onboard SMPS (Switch Mode Power Supply)

The PiCAN2 is a classic and widely-used CAN HAT. It supports 11-bit (standard) and 29-bit (extended) CAN identifiers and is suitable for many entry-level and intermediate projects.

2. PiCAN2 Duo – Dual CAN Bus Interface

  • CAN Controllers: Dual MCP2515

  • Transceivers: Dual MCP2551

  • Connectors: Two DB9 ports

  • Power Supply: Optional 5V regulator

  • Termination: Jumper-controlled

This version adds support for dual independent CAN channels, making it ideal for gateway applications, bridging, or multi-bus vehicle diagnostics.

3. PiCAN3 – Optimized for Raspberry Pi 4

  • CAN Controller: MCP2517FD (SPI)

  • Transceiver: TJA1051

  • CAN Support: CAN 2.0 and CAN FD

  • Connector: DB9 and screw terminal

  • Power Supply: SMPS with 7V to 24V input

  • Features: RTC (real-time clock), 120Ω termination

PiCAN3 is designed with the Raspberry Pi 4 in mind and includes support for CAN FD. It improves SPI performance and includes enhanced electrical protection, making it suitable for high-speed or harsh environments.

4. PiCAN3 Duo – Dual CAN FD Interface

  • CAN Controllers: Two MCP2517FD chips

  • CAN Support: CAN 2.0 and CAN FD on both channels

  • Connectors: Two DB9 interfaces

  • Features: RTC, onboard SMPS, GPIO breakout

This model extends the PiCAN3's capabilities to dual CAN FD channels, making it a great choice for simultaneous monitoring and control over two independent CAN FD networks.

5. PiCAN-M – Marine NMEA 2000 Interface

  • Target Use: Marine electronics (NMEA 2000)

  • CAN Transceiver: Designed for robust and long-distance applications

  • Connectors: NMEA-compatible with isolated CAN circuitry

  • Features: 120Ω termination, wide voltage input

The PiCAN-M is purpose-built for marine applications using the NMEA 2000 protocol. Its galvanic isolation and rugged features make it suited for harsh and wet environments.

6. PiCAN GPS – CAN + GPS Integration

  • Modules: CAN controller + GPS receiver

  • Use Case: Vehicle tracking and telemetry

  • Features: CAN + GPS combo, power supply input

This board is tailored for fleet tracking, autonomous vehicle prototyping, and any application requiring synchronized geographic and CAN data.


Programming and Configuration Using SocketCAN

Once a PiCAN board is connected to a Raspberry Pi and the appropriate device tree overlay is applied, the CAN interface appears as a network interface (e.g., can0, can1) in the Linux system.

Typical setup steps:

sudo ip link set can0 up type can bitrate 500000
sudo ifconfig can0 up
candump can0

You can monitor and log CAN traffic using candump, transmit frames with cansend, or build advanced scripts using Python and the python-can library.

Because all PiCAN boards are SocketCAN-compatible, developers can build scalable and portable applications that work across different hardware configurations without rewriting core communication logic.


Summary

The PiCAN series offers a reliable, professional-grade way to interface Raspberry Pi devices with CAN and CAN FD networks. Thanks to full SocketCAN compatibility, developers benefit from powerful Linux tools and a standardized development framework, allowing for rapid prototyping and deployment across a broad range of applications—from automotive diagnostics to industrial automation and marine systems.

Each board in the PiCAN lineup addresses a specific niche while maintaining the same ease of use and software interface through SocketCAN, making them an ideal foundation for any CAN-based development project on the Raspberry Pi. More information...


Programming the Raspberry Pi, Third Edition: Getting Started with PythonProgramming the Raspberry Pi: Getting Started with Python

This is your fully updated guide to building creative projects and fun games on the Raspberry Pi—no prior programming experience needed. This edition reflects the latest hardware updates, OS enhancements, and setup procedures introduced with Raspberry Pi OS version 4.

You’ll learn how to configure your Raspberry Pi, set up its software environment, and begin writing Python scripts from scratch. The book covers the essentials of Python programming while guiding you through the creation of user-friendly graphical interfaces and the control of external electronic components.

Step-by-step projects include a working digital clock and a fully functional Raspberry Pi-powered robot.

What you’ll learn:

  • Set up and configure your Raspberry Pi hardware and software

  • Write, run, and debug Python programs

  • Master Python fundamentals, including strings, lists, functions, and dictionaries

  • Explore advanced concepts such as modules, classes, and object-oriented development

  • Create interactive games using the Pygame library

  • Design user interfaces with the guizero framework

  • Control LEDs, sensors, and motors using the gpiozero library

  • Build electronics projects via the Raspberry Pi’s GPIO pins

Whether you're a student, educator, or hobbyist, this hands-on guide offers everything you need to start programming and prototyping with confidence. More information...

Exploring the PiCAN2: CAN Bus HAT for Raspberry Pi

The PiCAN2 HAT by Copperhill Technologies is a robust and feature-rich CAN Bus interface board designed for seamless integration with the Raspberry Pi. It opens up exciting opportunities for CAN Bus development in automotive, industrial, and embedded applications. Developed by SK Pang Electronics and distributed by various vendors, the PiCAN2 is popular among professionals and [...]

Read More »


The PiCAN3 CAN Bus Board for Raspberry Pi: A Comprehensive Development Environment for CAN Bus Applications

The PiCAN3 CAN Bus Board, available from Copperhill Technologies, is a powerful and versatile hardware expansion for the Raspberry Pi. Designed to support CAN (Controller Area Network) applications, this board enables developers to turn their Raspberry Pi into a professional-grade platform for embedded system development in automotive, industrial, and other demanding environments. PiCAN3 CAN Bus Board [...]

Read More »