
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.
The CAN (Controller Area Network) BUS module is an electronic communication interface used for connecting multiple microcontrollers in applications without a host computer. It is commonly used in automotive and industrial systems for allowing microcontrollers and devices to communicate with each other within a vehicle or machinery without a central computer.

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.

This circuit features two Arduino UNO R4 WiFi microcontrollers interfaced with NS-LS2 light sensors and CAN_SN65HVD230 CAN bus transceivers. The Arduinos are configured to read light intensity data from the NS-LS2 sensors and communicate with each other over a CAN network, likely for a distributed sensing application. Power distribution is managed with 3.3V and 5V connections to the respective components, and the ground connections are shared across the devices to complete the circuit.

This circuit is an OBD-II vehicle diagnostic interface that uses an Arduino Nano to communicate with a vehicle's CAN bus via an MCP2515 CAN controller. It includes a 7805 voltage regulator to step down the vehicle's 12V supply to 5V, powering the Arduino and other components, and a 1.44-inch TFT display for visual output. A pushbutton is also included for user interaction.

This circuit integrates multiple microcontrollers (STM32F103C8T6, ESP32, and Raspberry Pi Pico W) with MCP2515 CAN controllers to facilitate CAN bus communication. The microcontrollers are connected to the MCP2515 modules via SPI interfaces, and the circuit includes USB-to-serial converters for programming and debugging purposes.
| Pin Number | Name | Description |
|---|---|---|
| 1 | VCC | Power supply (5V) |
| 2 | GND | Ground connection |
| 3 | CANH | CAN High |
| 4 | CANL | CAN Low |
| 5 | RX | Receive data (optional, for some modules) |
| 6 | TX | Transmit data (optional, for some modules) |
#include <SPI.h>
#include <mcp_can.h>
// Initialize CAN BUS module with CS pin
MCP_CAN CAN(10);
void setup() {
Serial.begin(115200);
// Initialize CAN BUS module at 500kbps speed
if (CAN_OK == CAN.begin(CAN_500KBPS)) {
Serial.println("CAN BUS Shield init ok!");
}
else {
Serial.println("CAN BUS Shield init fail");
Serial.println("Init CAN BUS Shield again");
delay(100);
}
}
void loop() {
// Check if data is available to read
unsigned char len = 0;
unsigned char buf[8];
if (CAN_MSGAVAIL == CAN.checkReceive()) {
CAN.readMsgBuf(&len, buf); // Read data, len: data length, buf: data buffer
unsigned long canId = CAN.getCanId();
Serial.println("-----------------------------");
Serial.print("Get data from ID: 0x");
Serial.println(canId, HEX);
for (int i = 0; i < len; i++) { // Print each byte of the data
Serial.print(buf[i], HEX);
Serial.print("\t");
}
Serial.println();
}
}
Q: Can I use the CAN BUS module with a 3.3V system? A: Some CAN BUS modules are 3.3V compatible, but you must check the specific module's datasheet.
Q: How many devices can be connected to a CAN BUS? A: The CAN specification allows up to 112 nodes, but practical limits are lower and depend on the total bus length and the transceiver used.
Q: What is the maximum length of a CAN BUS network? A: The maximum length depends on the baud rate; for example, at 1 Mbps, the maximum length is typically around 40 meters.
Q: Do I need to use termination resistors? A: Yes, proper termination is critical for preventing reflections and ensuring signal integrity on the CAN bus.