Overview
The MCP2515 + TJA1050 module gives any 5V Arduino, ESP32, or other microcontroller a fully isolated CAN bus 2.0B interface in a single small board. Combined, the two chips handle the SPI-to-CAN protocol conversion (MCP2515 controller) and the differential physical-layer transceiver (TJA1050) needed to talk on a CAN bus — the same bus used in every car built since the late 1990s, plus industrial automation, marine electronics, drones, and any kind of long-distance, multi-drop communication where reliability matters.
Use it to read OBD-II data from a car (engine RPM, vehicle speed, throttle position, fuel level, error codes), build a CAN-based home / industrial automation network, communicate between Arduinos over a 40-meter twisted-pair link, or interface with a CAN-equipped sensor or actuator. The 8 MHz crystal sets the CAN clock; the included 120 ohm jumper terminator can be enabled or disabled via a solder bridge.
The module supports CAN bit rates from 5 kbps up to 1 Mbps. Standard ID (11-bit) and extended ID (29-bit) frames are both handled. With the popular MCP_CAN Arduino library or pythonCAN on a Pi, sending and receiving CAN messages takes about 10 lines of code.
At a Glance
Specifications
| Parameter | Value |
| Controller | Microchip MCP2515 (SPI interface) |
| Transceiver | NXP TJA1050 |
| Crystal | 8 MHz |
| Operating Voltage | 5V (TJA1050 needs 5V; logic inputs are 5V) |
| CAN Standard | CAN 2.0A and 2.0B (standard + extended frames) |
| CAN Bit Rate | 5 kbps - 1 Mbps (configurable) |
| SPI Mode | Mode 0 (CPOL=0, CPHA=0) |
| SPI Clock | Up to 10 MHz |
| Termination | 120 Ω (jumper-enabled) |
| Connector | 2-pin screw terminal (CAN_H, CAN_L) |
| Pin Header | 2×5 (10 pins) 2.54 mm |
| Operating Temperature | -40°C to +85°C |
Pinout Diagram
Wiring Guide
Arduino UNO / Mega 2560 SPI Connection
| Module | Arduino UNO | Arduino Mega |
|---|---|---|
| VCC | 5V | 5V |
| GND | GND | GND |
| CS | D10 | D53 |
| SO (MISO) | D12 | D50 |
| SI (MOSI) | D11 | D51 |
| SCK | D13 | D52 |
| INT | D2 (interrupt-capable) | D2 / D3 / D18-21 |
CAN Bus Wiring (Between Modules)
Connect CAN_H to CAN_H and CAN_L to CAN_L between all modules on the bus. Use twisted-pair cable for noise immunity. The bus can be up to ~40 m at 1 Mbps and longer at lower speeds.
| Module A | Module B |
|---|---|
| CAN_H | CAN_H |
| CAN_L | CAN_L |
| 120 Ω jumper: ENABLED | 120 Ω jumper: ENABLED |
Code Examples
Send a CAN Message (Arduino, MCP_CAN library)
#include <SPI.h>
#include <mcp_can.h>
MCP_CAN CAN(10); // CS
void setup() {
Serial.begin(115200);
while (CAN.begin(MCP_ANY, CAN_500KBPS, MCP_8MHZ) != CAN_OK) {
Serial.println("CAN init fail; retrying");
delay(100);
}
CAN.setMode(MCP_NORMAL);
Serial.println("CAN init ok");
}
void loop() {
unsigned char data[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xCA, 0xFE, 0x00, 0x00};
byte sndStat = CAN.sendMsgBuf(0x100, 0, 8, data);
Serial.println(sndStat == CAN_OK ? "sent" : "fail");
delay(1000);
}
Receive a CAN Message (Arduino, MCP_CAN library)
#include <SPI.h>
#include <mcp_can.h>
MCP_CAN CAN(10); // CS
void setup() {
Serial.begin(115200);
while (CAN.begin(MCP_ANY, CAN_500KBPS, MCP_8MHZ) != CAN_OK) {
delay(100);
}
CAN.setMode(MCP_NORMAL);
}
void loop() {
if (CAN_MSGAVAIL == CAN.checkReceive()) {
long unsigned int rxId;
unsigned char len, buf[8];
CAN.readMsgBuf(&rxId, &len, buf);
Serial.print("ID: 0x"); Serial.print(rxId, HEX);
Serial.print(" data:");
for (int i = 0; i < len; i++) {
Serial.print(' '); Serial.print(buf[i], HEX);
}
Serial.println();
}
}
Frequently Asked Questions
MCP_8MHZ to begin() for this module. Some other MCP2515 boards use 16 MHz crystals — check your board before assuming.