CAN BUS - MCP2515 CAN Bus Module Board TJA1050

SKU: TP6006
MCP2515 CAN bus module with TJA1050 transceiver, top view showing the 7-pin SPI header and blue CAN screw terminal
MCP2515 CAN module labelled diagram: controller, 8 MHz crystal, TJA1050 transceiver, termination header, screw terminal
MCP2515 CAN bus module dimension drawing showing 39.7 mm by 27.5 mm

CAN BUS - MCP2515 CAN Bus Module Board TJA1050

SKU: TP6006
Default
Regular price $7.99
/
  • Free shipping on all orders over $100
  • Secure payments
  • In stock, ready to ship
  • Inventory on the way

Add $94.01 more for free shipping

Tax included. Shipping calculated at checkout.

You'll also need

Choose a quantity and add it to your cart.

Breadboard 400 holes
$4.4910+ in stock
Breadboard Jumper Wire - 140pcs
$11.9910+ in stock

An SPI CAN bus module that pairs the MCP2515 CAN controller with a TJA1050 CAN transceiver, so a microcontroller can join a CAN bus with four SPI wires.

The MCP2515 handles CAN V2.0B frames in hardware and the TJA1050 drives the CANH and CANL bus lines, so your Arduino sketch only has to talk SPI. It suits Arduino-based projects that need to send and receive CAN messages, and an 8 MHz crystal is fitted on the board.

CAN controller
MCP2515
Transceiver
TJA1050
CAN bit rate
Up to 1 Mb/s
Supply
5 V DC

Why choose it

  • Two chips, one complete CAN node — the MCP2515 (CAN V2.0B, 0 to 8 data bytes) plus the TJA1050 transceiver (ISO 11898) means the microcontroller needs only an SPI port.
  • Buffers and filters on the chip — the MCP2515 has three transmit buffers, two receive buffers, six acceptance filters and two masks, so it can ignore traffic you do not need.

Specifications

Core
CAN controller MCP2515 (Microchip)
CAN transceiver TJA1050 (NXP)
CAN protocol CAN V2.0B
Maximum bit rate 1 Mb/s
Data field 0 to 8 bytes
Frame types Standard, extended and remote
Host interface SPI (MCP2515 supports SPI modes 0,0 and 1,1, up to 10 MHz)
Crystal 8 MHz
Power
Supply voltage 5 V DC (TJA1050 supply range 4.75 V to 5.25 V)
Operating temperature −40 °C to +85 °C (MCP2515 industrial grade)
Connections and physical
SPI header (J4) 7 pins, in this order: INT, SCK, SI, SO, CS, GND, VCC
Mounting holes 4 × 3 mm
Dimensions Approx. 44 × 28 mm

Compatibility

Platform Works Notes
Arduino UNO / Nano (5 V) ✓ Yes Direct SPI wiring, no level shifter needed.
ESP32 / ESP8266 (3.3 V) ◐ With adapter The module is powered at 5 V and its SO pin outputs 5 V logic, so use a level shifter on the SPI lines.
Raspberry Pi Pico (3.3 V) ◐ With adapter Needs a level shifter. We have not verified a MicroPython driver for the MCP2515, so no Pico code is given.
Software ✓ Yes Arduino IDE with the arduino-mcp2515 library (autowp).

In the box

Included
  • 1 × MCP2515 CAN bus module (TJA1050)

Applications

  • Linking an Arduino to other CAN bus nodes over a twisted pair
  • A two-node CAN test bench on your desk
  • Learning how CAN frames, IDs and filters work

Tutorial

What you'll build: a loopback test where the module sends a CAN frame to itself and your board prints it back on the Serial Monitor. You do not need a second CAN node for this test. · About 20 minutes.

How it works

Your board talks to the MCP2515 over SPI. The MCP2515 builds and checks CAN frames, and the TJA1050 puts them on the two bus wires, CANH and CANL. In loopback mode the MCP2515 sends a frame to itself, so you can test the module and the wiring without any other CAN device.

  • SPI — four wires: SCK is the clock, SI is data into the module, SO is data out of the module, and CS tells the module it is being spoken to.
  • GND — the return path; every GND must be joined.
  • CANH / CANL — the two bus wires; they are not used in the loopback test.
  • Bit rate — every node on a real CAN bus must use the same speed.
Arduino UNO Tutorial

You need: Arduino UNO R3, a USB data cable, 6 jumper wires and the CAN module.

MCP2515 CAN module wired to an Arduino UNO: SCK to D13, SI to D11, SO to D12, CS to D10, GND to GND, VCC to 5V Arduino UNOMCP2515 module (J4)5 V logicINTnot used hereSCKD13SID11SOD12CSD10GNDGNDVCC5V

■ Power ■ GND ■ SPI (clock, data in, data out) ■ Chip select (CS) INT is not used in this tutorial.

# Arduino UNO pin Module pin Wire Notes
1 5V VCC Red Module is powered at 5 V
2 GND GND Black Common ground
3 D10 CS Green Chip select
4 D11 SI Blue Data from the UNO to the module (MOSI)
5 D12 SO Blue Data from the module to the UNO (MISO)
6 D13 SCK Blue SPI clock

Watch out: Check the pin labels printed on your module before wiring (J4 reads INT, SCK, SI, SO, CS, GND, VCC). Unplug the USB cable while you connect the wires.

1
Install the Arduino IDE
Download and install the Arduino IDE.
2
Install the MCP2515 library
Open the arduino-mcp2515 page on GitHub, choose Code → Download ZIP, then in the Arduino IDE choose Sketch → Include Library → Add .ZIP Library and pick the file. Restart the IDE.
3
Wire it up
With the USB cable unplugged, connect the six wires in the table above.
4
Upload the example
Plug in the UNO, choose Tools → Board → Arduino UNO and the right Port, paste the sketch below and click Upload. If no port appears, use a data USB cable and install the USB driver for your board.
▸ Example 1 — CAN loopback test
// Wiring: VCC->5V, GND->GND, CS->D10, SI->D11, SO->D12, SCK->D13
#include <SPI.h>
#include <mcp2515.h>

const int CS_PIN = 10;              // CS pin, same as the pin table
MCP2515 mcp2515(CS_PIN, 8000000);   // 8 MHz SPI clock (safe for the Uno)

struct can_frame txFrame;
struct can_frame rxFrame;

void setup() {
  Serial.begin(115200);
  mcp2515.reset();
  // This module has an 8 MHz crystal, so tell the library: MCP_8MHZ
  bool ok = (mcp2515.setBitrate(CAN_125KBPS, MCP_8MHZ) == MCP2515::ERROR_OK);  // you can change this speed
  ok = ok && (mcp2515.setLoopbackMode() == MCP2515::ERROR_OK);  // loopback = the chip talks to itself
  if (!ok) {
    Serial.println("MCP2515 not found - check wiring");
    while (true) {}
  }
  Serial.println("OK - epartners.co.nz test");

  txFrame.can_id  = 0x036;          // you can change this ID
  txFrame.can_dlc = 4;              // number of data bytes (0 to 8)
  txFrame.data[0] = 0x01;
  txFrame.data[1] = 0x02;
  txFrame.data[2] = 0x03;
  txFrame.data[3] = 0x04;
}

void loop() {
  mcp2515.sendMessage(&txFrame);    // send one frame
  delay(100);
  if (mcp2515.readMessage(&rxFrame) == MCP2515::ERROR_OK) {   // read it back
    Serial.print("Loopback OK - ID 0x");
    Serial.print(rxFrame.can_id, HEX);
    Serial.print(", data:");
    for (int i = 0; i < rxFrame.can_dlc; i++) {
      Serial.print(" ");
      Serial.print(rxFrame.data[i], HEX);
    }
    Serial.println();
  } else {
    Serial.println("Loopback failed - no frame received");
  }
  delay(900);
}
5
Read the result
Open Tools → Serial Monitor and set it to 115200 baud.

✓ Check: The Serial Monitor prints OK - epartners.co.nz test once, then Loopback OK - ID 0x36, data: 1 2 3 4 every second.

Troubleshooting

Board Problem Likely cause Fix
All Serial Monitor says "MCP2515 not found - check wiring" SPI wires swapped or loose, CS on the wrong pin, or no 5 V on VCC Re-check the pin table. SI must go to MOSI and SO to MISO. Check that the red POW LED on the module is lit.
All Serial Monitor shows unreadable characters Baud rate does not match Set the Serial Monitor to 115200 baud.
All Loopback works, but two real nodes do not talk Different bit rate or clock setting, no termination, or CANH and CANL swapped Use the same bit rate on every node and MCP_8MHZ for this module. Put a 120 Ω termination at each end of the bus and join H to H and L to L.
All No port appears when you plug in the board Charge-only USB cable or missing USB driver Use a data USB cable and install the USB driver for your board.

Try next: connect a second MCP2515 module and a second board, join CANH to CANH and CANL to CANL, and run the library's CAN_write and CAN_read examples. Change their setBitrate line to setBitrate(CAN_125KBPS, MCP_8MHZ) for this module.

Spotted a problem in this tutorial? Email support@epartners.co.nz and we'll check it and update the tutorial.

Good to know
  • The module runs from 5 V. Use a level shifter on the SPI lines with 3.3 V boards such as the ESP32.
  • The crystal is 8 MHz, so set MCP_8MHZ in the library. The library's default clock setting is 16 MHz, which gives the wrong bit rate on this module.
  • A CAN bus normally has a 120 Ω termination at each of its two ends, and every node must use the same bit rate.

Video guide

Datasheet

Key figures from the manufacturer's datasheet for the MCP2515, the CAN controller on this module.

MCP2515 CAN controller
CAN protocol CAN V2.0B
Maximum bit rate 1 Mb/s
Data field 0 to 8 bytes
Transmit buffers 3, with prioritisation and abort
Receive buffers 2
Acceptance filters and masks Six 29-bit filters, two 29-bit masks
SPI interface 10 MHz, modes 0,0 and 1,1
Operating voltage 2.7–5.5 V
Active current 5 mA (typical)
Sleep current 1 µA (typical)
Temperature range Industrial −40 °C to +85 °C, extended −40 °C to +125 °C
Other One-shot mode, programmable clock-out pin, interrupt output pin

Download the MCP2515 datasheet (PDF)

▸ Preview the datasheet

If the preview does not load on your device, use the download link above.

Source: Microchip Technology, MCP2515 Stand-Alone CAN Controller with SPI Interface, document DS20001801K.

Resources

Which one should I choose?

Product Key difference Best for
This product — MCP2515 + TJA1050 module CAN controller and transceiver on one board, SPI interface to the host Boards without a built-in CAN controller, such as the Arduino UNO
TJA1050 CAN Transceiver Module Transceiver only: no CAN controller; operating voltage 4.75 V to 5.25 V Hosts that already have a CAN controller
MCP2551 CAN bus module MCP2551 transceiver; listing states ISO-11898, 1 Mb/s and up to 112 nodes Hosts that already have a CAN controller

FAQ

▸ Do I need two modules to try it?

No. The loopback example in the Tutorial sends a frame to the module itself, so one module and one board are enough. A real CAN network needs at least two nodes.

▸ What CAN speed does it support?

Up to 1 Mb/s, with CAN V2.0B frames and 0 to 8 data bytes. Every node on the bus must use the same bit rate.

▸ Which clock setting do I use in the library?

Use MCP_8MHZ, because this module has an 8 MHz crystal. For example, mcp2515.setBitrate(CAN_125KBPS, MCP_8MHZ);.

▸ Can I use it with an ESP32 or Raspberry Pi Pico?

Yes with care. The module runs at 5 V and outputs 5 V logic on SO, so use a level shifter on the SPI lines. The Tutorial has tested wiring and code for the ESP32; we have not verified a MicroPython driver for the Pico.

Technical question about this part? Email support@epartners.co.nz with your board and wiring, and we'll help you get it working.

Shipping: $5.99 urban, $9.99 rural. Free shipping on orders of $100 or more.

Order by 10:30am (NZT), Monday to Friday, and we dispatch the same day. Orders placed after 10:30am, on weekends or on public holidays are dispatched the next business day.

Delivery usually takes 1–2 business days after dispatch (2–3 for rural addresses). See our Shipping Policy for full details.

This site is protected by hCaptcha and the hCaptcha Privacy Policy and Terms of Service apply.

Recently viewed