Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use XIAO CAN Bus Expansion Board: Examples, Pinouts, and Specs

Image of XIAO CAN Bus Expansion Board
Cirkit Designer LogoDesign with XIAO CAN Bus Expansion Board in Cirkit Designer

Introduction

The XIAO CAN Bus Expansion Board is a compact and versatile add-on designed for the XIAO series microcontrollers. It enables seamless communication over the CAN (Controller Area Network) protocol, which is widely used in automotive, industrial, and embedded systems. This expansion board is ideal for applications requiring robust and reliable communication between multiple devices in a networked environment.

Explore Projects Built with XIAO CAN Bus Expansion Board

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Dual Raspberry Pi 2B CAN BUS Communication Interface with Pushbutton Interaction
Image of BSP4: A project utilizing XIAO CAN Bus Expansion Board in a practical application
This circuit features two Raspberry Pi 2B microcontrollers connected to separate CAN BUS modules, forming a CAN network for data exchange. A pushbutton is included for user interaction, interfaced with GPIO pins on both Raspberry Pis.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-S3 GPS and Wind Speed Logger with Dual OLED Displays and CAN Bus
Image of esp32-s3-ellipse: A project utilizing XIAO CAN Bus Expansion Board in a practical application
This circuit features an ESP32-S3 microcontroller interfaced with an SD card module, two OLED displays, a GPS module, and a CAN bus module. The ESP32-S3 records GPS data to the SD card, displays speed on one OLED, and shows wind speed from the CAN bus on the other OLED, providing a comprehensive data logging and display system.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-S3 GPS Logger and Wind Speed Display with Dual OLED and CAN Bus
Image of Copy of esp32-s3-ellipse: A project utilizing XIAO CAN Bus Expansion Board in a practical application
This circuit features an ESP32-S3 microcontroller interfaced with an SD card, two OLED displays, a GPS module, and a CAN bus module. It records GPS data to the SD card every second, displays speed in knots on one OLED display, and shows wind speed from the CAN bus in NMEA 2000 format on the other OLED display.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Nano Based LoRa Weather Station with BMP280 Sensor and SD Card Logging
Image of CubeSAT MYSA Circuit: A project utilizing XIAO CAN Bus Expansion Board in a practical application
This circuit is designed for environmental data acquisition and remote communication. It features an Arduino Nano interfaced with a BMP280 sensor for temperature and pressure readings, a LoRa Ra-02 SX1278 module for wireless data transmission, and a Micro SD Card Module for data logging. The I/O Expansion Shield is used to connect all components, but the Arduino Nano's code for operation is not yet provided.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with XIAO CAN Bus Expansion Board

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of BSP4: A project utilizing XIAO CAN Bus Expansion Board in a practical application
Dual Raspberry Pi 2B CAN BUS Communication Interface with Pushbutton Interaction
This circuit features two Raspberry Pi 2B microcontrollers connected to separate CAN BUS modules, forming a CAN network for data exchange. A pushbutton is included for user interaction, interfaced with GPIO pins on both Raspberry Pis.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of esp32-s3-ellipse: A project utilizing XIAO CAN Bus Expansion Board in a practical application
ESP32-S3 GPS and Wind Speed Logger with Dual OLED Displays and CAN Bus
This circuit features an ESP32-S3 microcontroller interfaced with an SD card module, two OLED displays, a GPS module, and a CAN bus module. The ESP32-S3 records GPS data to the SD card, displays speed on one OLED, and shows wind speed from the CAN bus on the other OLED, providing a comprehensive data logging and display system.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Copy of esp32-s3-ellipse: A project utilizing XIAO CAN Bus Expansion Board in a practical application
ESP32-S3 GPS Logger and Wind Speed Display with Dual OLED and CAN Bus
This circuit features an ESP32-S3 microcontroller interfaced with an SD card, two OLED displays, a GPS module, and a CAN bus module. It records GPS data to the SD card every second, displays speed in knots on one OLED display, and shows wind speed from the CAN bus in NMEA 2000 format on the other OLED display.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of CubeSAT MYSA Circuit: A project utilizing XIAO CAN Bus Expansion Board in a practical application
Arduino Nano Based LoRa Weather Station with BMP280 Sensor and SD Card Logging
This circuit is designed for environmental data acquisition and remote communication. It features an Arduino Nano interfaced with a BMP280 sensor for temperature and pressure readings, a LoRa Ra-02 SX1278 module for wireless data transmission, and a Micro SD Card Module for data logging. The I/O Expansion Shield is used to connect all components, but the Arduino Nano's code for operation is not yet provided.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Automotive systems (e.g., engine control units, sensors, and actuators)
  • Industrial automation and control systems
  • Robotics and IoT devices requiring CAN communication
  • Data logging and diagnostics in CAN-based networks

Technical Specifications

Key Technical Details

  • Operating Voltage: 3.3V or 5V (compatible with XIAO microcontrollers)
  • Communication Protocol: CAN 2.0A/2.0B
  • CAN Transceiver: MCP2551 or equivalent
  • Baud Rate: Up to 1 Mbps
  • Connector: Standard 3-pin CAN terminal (CAN_H, CAN_L, GND)
  • Dimensions: 21mm x 17.5mm (compact design)
  • Operating Temperature: -40°C to 85°C

Pin Configuration and Descriptions

The XIAO CAN Bus Expansion Board connects directly to the XIAO microcontroller via its pin headers. Below is the pin configuration:

Pin Name Description
CAN_H High line of the CAN bus
CAN_L Low line of the CAN bus
GND Ground connection for the CAN bus
VCC Power supply (3.3V or 5V)
RX CAN data receive pin (to XIAO RX)
TX CAN data transmit pin (to XIAO TX)

Usage Instructions

How to Use the Component in a Circuit

  1. Hardware Setup:

    • Mount the XIAO microcontroller onto the XIAO CAN Bus Expansion Board.
    • Connect the CAN_H, CAN_L, and GND terminals to the corresponding lines of the CAN bus.
    • Ensure the power supply (VCC) matches the operating voltage of the XIAO microcontroller (3.3V or 5V).
  2. Software Setup:

    • Install the required CAN library for your development environment (e.g., Arduino IDE).
    • Configure the CAN baud rate and initialize the CAN bus in your code.
  3. Example Circuit:

    • Connect the XIAO CAN Bus Expansion Board to a CAN network with at least one other CAN device.
    • Use a 120-ohm termination resistor at both ends of the CAN bus for proper signal integrity.

Important Considerations and Best Practices

  • Ensure the CAN bus is properly terminated with 120-ohm resistors at both ends.
  • Use twisted-pair cables for CAN_H and CAN_L to minimize noise and signal interference.
  • Verify the baud rate and CAN ID settings match across all devices on the CAN network.
  • Avoid exceeding the maximum voltage and current ratings to prevent damage to the board.

Example Code for Arduino UNO

Below is an example code snippet to initialize and send data over the CAN bus using the XIAO CAN Bus Expansion Board:

#include <mcp_can.h>  // Include the MCP CAN library
#include <SPI.h>      // Include the SPI library

// Define the SPI CS pin for the XIAO CAN Bus Expansion Board
#define CAN_CS_PIN 10  

MCP_CAN CAN(CAN_CS_PIN);  // Create an MCP_CAN object

void setup() {
  Serial.begin(115200);  // Initialize serial communication for debugging
  while (!Serial);

  // Initialize the CAN bus at 500 kbps
  if (CAN.begin(MCP_ANY, 500000, MCP_8MHZ) == CAN_OK) {
    Serial.println("CAN bus initialized successfully!");
  } else {
    Serial.println("Error initializing CAN bus.");
    while (1);
  }

  CAN.setMode(MCP_NORMAL);  // Set CAN bus to normal mode
  Serial.println("CAN bus is in normal mode.");
}

void loop() {
  // Example data to send over the CAN bus
  byte data[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};

  // Send data with CAN ID 0x100
  if (CAN.sendMsgBuf(0x100, 0, 8, data) == CAN_OK) {
    Serial.println("Message sent successfully!");
  } else {
    Serial.println("Error sending message.");
  }

  delay(1000);  // Wait 1 second before sending the next message
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. Issue: CAN bus communication is not working.

    • Solution: Verify the wiring of CAN_H, CAN_L, and GND. Ensure proper termination resistors are in place.
  2. Issue: The XIAO microcontroller is not detecting the CAN Bus Expansion Board.

    • Solution: Check the connection between the XIAO microcontroller and the expansion board. Ensure the board is powered correctly.
  3. Issue: Data is being sent but not received by other devices.

    • Solution: Confirm that the baud rate and CAN ID settings match across all devices on the CAN network.
  4. Issue: Noise or interference on the CAN bus.

    • Solution: Use twisted-pair cables for CAN_H and CAN_L. Ensure proper grounding of the system.

FAQs

  • Q: Can I use the XIAO CAN Bus Expansion Board with other microcontrollers?

    • A: The board is specifically designed for the XIAO series, but it may work with other microcontrollers that have compatible pinouts and CAN libraries.
  • Q: What is the maximum cable length for the CAN bus?

    • A: The maximum length depends on the baud rate. For example, at 1 Mbps, the maximum length is approximately 40 meters.
  • Q: Do I need to install any additional drivers for the XIAO CAN Bus Expansion Board?

    • A: No additional drivers are required. However, you need to install the MCP CAN library in your development environment.
  • Q: Can I use the board in high-temperature environments?

    • A: Yes, the board operates within a temperature range of -40°C to 85°C, making it suitable for automotive and industrial applications.