# Adafruit PiCowbell CAN Bus for Pico

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/120/787/medium800/adafruit_products_5728-05.jpg?1683139975)

Ding dong! Hear that? It's the PiCowbell ringing, letting you know that the new **Adafruit PiCowbell CAN Bus** board is in stock and ready to assist your [Raspberry Pi Pico](https://www.adafruit.com/product/4864) and [Pico W](https://www.adafruit.com/product/5526) project in connecting to CAN bus networks for automotive or robotics projects.

[CAN Bus is a small-scale networking standard](https://en.wikipedia.org/wiki/CAN_bus), originally designed for cars and, yes, busses, but is now used for many robotics or sensor networks that need better range and addressing than I2C and don't have the pins or computational ability to talk on Ethernet. CAN is a 2 wire differential standard, which means it's good for long distances and noisy environments.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/788/medium800/adafruit_products_5728-03.jpg?1683140041)

Messages are sent at about a 1 Mbps rate - you set the frequency for the bus and then all 'joiners' must match it, and have an address before the packet so that each node can listen in to messages just for it. New nodes can be attached easily because they just need to connect to the two data lines anywhere in the shared net. Each CAN device sends messages whenever it wants, and thanks to some clever data encoding, can detect if there's a message collision and retransmit later.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/789/medium800/adafruit_products_5728-02.jpg?1683140075)

If you'd like to connect your Raspberry Pi Pico to a CAN Bus, the **Adafruit PiCowbell CAN Bus board** has a MCP2515 controller and TJA1051/3 transceiver! [The controller used is the MCP2515, an extremely popular and well-supported chipset](https://www.microchip.com/en-us/product/MCP2515) that has drivers in Arduino and [CircuitPython](https://github.com/adafruit/Adafruit_CircuitPython_MCP2515) and only requires an SPI port and two pins for chip-select and IRQ. Use it to send and receive messages in either standard or extended format at up to 1 Mbps.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/790/medium800/adafruit_products_5728-04.jpg?1683140137)

Adafruit has added a few nice extras to this PiCowBell to make it useful in many common CAN scenarios:

- [**5V charge-pump voltage generator**](https://www.adafruit.com/product/3661), so even though you are running 3.3V on a Pico board, it will generate a nice clean 5V as required by the transceiver.
- **[3.5mm terminal block](https://www.adafruit.com/product/725)** pre-soldered on the board to get quick access to the High and Low data lines as well as a ground pin.
- **120-ohm termination resistor on board** , you can remove the termination easily by cutting the jumper marked **Term** on the top of the board.
- **Pre-connected CS and INT pins** on Pico GPIO #20 and #21. You can cut the bottom solder jumpers and use the breakout pads to connect to any two IO pins you like.

Each order comes with an assembled PCB and header. You will need to solder in the header yourself, but it's a quick task.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/791/medium800/adafruit_products_5728-01.jpg?1683140199)

 **Please Note!** There are a lot of possible configurations, and we stock various headers depending on how you want to solder and attach. Especially if you want the Pico on top so that the **BOOTSEL** button and LED are accessible.

1. [Use the Pico Stacking Headers](https://www.adafruit.com/product/5582) if you want to be able to plug into a breadboard or other accessory with sockets.
2. [Use the Pico Socket Headers](https://www.adafruit.com/product/5583) if you want to plug directly in and have a nice solid connection that doesn't have any poking-out-bits.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/792/medium800/adafruit_products_5728-00.jpg?1683140272)

The PiCowbell CAN Bus provides you with:

- **Right angle JST SH connector for I2C / Stemma QT / Qwiic** connection. Provides 3V, GND, IO4 (SDA), and IO5 (SCL).
- **Reset button** - Press to restart your program.
- **Every pad on the 'bell has a duplicate hole pad** next to them for solder-jumpering
- **The ground pads have white silkscreen rectangles** for easy identification, plus one long ground strip near the reset button.
- **Gold-plated pads for easy soldering.**

If you are using the Philhower Arduino core, the Wire peripheral is already set up to use **GPIO4** and **GPIO5** , and SPI is default on **GPIO16** , **GPIO18** and **GPIO19**. If you use CircuitPython or MicroPython, you'll need to let the code know to look at **4** + **5** for SDA+SCL pins, and configure the SPI port for SCK= **18** , MOSI= **19** and MISO= **16**.

# Adafruit PiCowbell CAN Bus for Pico

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/120/796/medium800/adafruit_products_croppedFront.jpg?1683145316)

![](https://cdn-learn.adafruit.com/assets/assets/000/120/797/medium800/adafruit_products_croppedBack.jpg?1683145323)

## Power

- **VB (VBUS)** - This is the micro-USB input voltage, connected to the micro-USB port on the Raspberry Pi Pico. It is nominally 5V.
- **VS (VSYS)** - This is the main system input voltage. It can range from 1.8V to 5.5V and is used to generate the 3.3V needed for the RP2040 and the GPIO pins.
- **EN (3V3\_EN)** - This connects to the enable pin on the Raspberry Pi Pico, and is pulled high (to VSYS) via a 100kΩ resistor.
- **3V** - This is the 3.3V output from the Raspberry Pi Pico.
- **VR (ADC\_VREF)** - This is the ADC power supply and reference voltage. It is generated on the Raspberry Pi Pico by filtering the 3.3V supply. It can be used with an external reference when ADC performance is required.
- **G** - This is the common ground for power and logic. All **GND pins are highlighted in white on the silk** , with the exception of the ground pin for the CAN Bus terminal block. It is labeled **- (minus sign).**

## I2C Logic

- **SCL** - I2C clock pin on the PiCowbell. It is connected to your microcontroller I2C clock line, which is **GPIO5** on the Pico. This connection is shared with the STEMMA QT port on the end of the board.
- **SDA** - I2C data pin on the PiCowbell. It is connected to your microcontroller I2C data line, which is **GPIO4** on the Pico. This connection is shared with the STEMMA QT port on the end of the board.
- **[STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt) -** These connectors allow you to connect to dev boards with STEMMA QT connectors or to other things with [various associated accessories](https://www.adafruit.com/category/619). The port is located on the end of the PiCowbell.

## Duplicate GPIO Hole Pads

The following pads on the PiCowbell CAN Bus have a duplicate hole pad next to it for solder-jumpering:

- **GP0-GP15** , **GP16-GP22** , **Reset** , **A0-A2** , **VR** , **3V** , **EN** , **VS** and **VB**. Ground pins that have a duplicate hole pad are highlighted in white on the board silkscreen.
  - Note that **GP20** and **GP21** are connected by default to CAN Bus **CS** and **INT**. They can be disconnected from these GPIO pins by cutting the CS and INT jumpers described below.

## Reset Button

In the center of the board, to the right of the STEMMA QT connector, is the reset button. It is routed to the **reset pin on the PiCowbell** and is labeled **RST** on the board silk. You can press it to restart your program.

## Terminal Block Pins

On the front of the board is the terminal block with the three pins for communicating with the CAN Bus standard.

- **L** - the CAN low signal for the CAN Bus standard.
- **-** - common ground shared between the two CAN connections
- **H** - the CAN high signal for the CAN Bus standard.

Both **L** and **H** are connected to a [**5V charge-pump voltage generator**](https://www.adafruit.com/product/3661). Even if you are using 3.3V logic on a Pico board, it will generate a nice clean 5V as required by the CAN Bus transceiver.

## Terminator Jumper

The terminator jumper is located on the front of the board, to the left of the terminal block. It is labeled **Term** and is outlined in white on the board silk.

- **Term** - The board has a 120 ohm termination resistor connected between **H** and **L**. You can disable (remove) the resistor by **cutting** the **Term** jumper, if your bus is already terminated.

## MCP2515 Reset Pin and Jumper

- **Reset Jumper** - located on the back of the board, below the PiCowbell icon on the board silk, is the reset jumper. It is outlined in white on the board silk. You can cut this jumper to disconnect the **MCP2515 reset pin** from the **Pico reset pin**.
- **Reset Pin** - located on the front of the board to the right of the **reset button**. It is labeled **RST** on the silk. If you cut the **reset jumper** , you can use this pin to connect the **MCP2515 reset pin** to a different IO pin.

## Chip Select Pin and Jumper

- **CS Jumper** - located on the back of the board, next to **PiCowbell pin 20** , is the chip select jumper. It is labeled **CS** and is outlined in white on the board silk. By default, the **MCP2515 chip select pin** is connected to **GPIO20** on the PiCowbell. You can cut this jumper to disconnect the **MCP2515 CS pin** from **PiCowbell pin 20**.
- **CS pin** - located on the front of the board to the right of the **reset button**. It is labeled **CS** on the silk. If you cut the **CS jumper** , you can use this pin to connect the **MCP2515 CS pin** to a different IO pin.

## Interrupt Pin and Jumper

- **INT Jumper** - located on the back of the board, next to **PiCowbell pin 21** , is the interrupt jumper. It is labeled **INT** and is outlined in white on the board silk. By default, the **MCP2515 interrupt pin** is connected to **GPIO21** on the PiCowbell. You can cut this jumper to disconnect the **MCP2515 INT pin** from **PiCowbell pin 21**.
- **INT pin** - located on the front of the board to the right of the **reset button**. It is labeled **INT** on the silk. If you cut the **INT jumper** , you can use this pin to connect the **MCP2515 INT pin** to a different IO pin.

## Silent Mode Pin

- **SLNT pin** - located on the front of the board to the right of the **reset button**. It is labeled **SLNT** on the silk. This pin can be pulled high to put the TJA1051/3 transceiver into silent mode. From the datasheet:

> In Silent mode, the transmitter is disabled, releasing the bus pins to recessive state. All other IC functions, including the receiver, continue to operate as in Normal mode. Silent mode can be used to prevent a faulty CAN controller from disrupting all network communications.

# Adafruit PiCowbell CAN Bus for Pico

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/116/349/medium800/adafruit_products_PiC_angle_with_PIco_and_sensor.jpg?1667002341)

Info: 

There are four ways to get your PiCowbell board working with your Pico. To keep things flexible, PiCowbells do not come with headers: there's a lot of possible configurations and we stock various headers depending on how you want to solder and attach. Especially since you want the Pico on top, so that the BOOTSEL button and LED are accessible.

The options are as follows.

1. [Use the Pico Stacking Headers](https://www.adafruit.com/product/5582) if you want&nbsp;to be able to&nbsp;plug into a breadboard or other accessory with sockets.
2. [Use the Pico Socket Headers](https://www.adafruit.com/product/5583) if you want to plug directly into the Pico and have a nice solid connection that doesn't have any poking-out-bits.
3. For some PiCowbells: [Use the Short Socket Headers](https://www.adafruit.com/product/5585) for a very slim but pluggable design, note that you'll want to trim down the Pico's headers or [use the short plug headers on the Pico](https://www.adafruit.com/product/5584) to have a skinny sandwich.
4. For some PiCowbells: Solder the PiCowbell directly to the standard headers already soldered to your Pico. Of course this is very compact and inexpensive but you won't be able to remove the PiCowbell. However, this method is not possible for some PiCowbell variants depending on the clearance of the components on the PiCowbell (i.e. the PiCowbell Adalogger and its coin cell battery holder).

The next page shows how to solder standard headers onto a Pico board. The following four pages walk you through each type of PiCowbell assembly so you can choose the one that will work best for you!

Danger: 

If you're unsure about soldering up the Pico and PiCowbell, check out our [FAQ on soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/soldering-faq).

# Adafruit PiCowbell CAN Bus for Pico

## Pico

Three out of four of the assembly methods included in this guide assume you have a Raspberry Pi Pico soldered up with standard male headers in preparation for using it with the PiCowbell Proto. This page will show you how to solder a set of standard headers to a Pico.

(The shorty header assembly method uses short male headers on the Pico. The soldering concept is exactly the same, but use the shorty male headers on the Pico instead of standard ones. You can follow these instructions with the shorty headers and you'll be set for that.)

Follow the steps below to solder the standard male headers to a Pico. The process is the same for all flavors of Pico, such as Pico W.

## Assembly Steps
Use the Pico to line up the headers on a breadboard. This is the easiest way to ensure the headers are soldered on straight.&nbsp;

![adafruit_products_PiC_Pico_lining_up_headers.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/458/medium640/adafruit_products_PiC_Pico_lining_up_headers.jpg?1667589515)

![adafruit_products_PiC_lining_headers_up.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/459/medium640/adafruit_products_PiC_lining_headers_up.jpg?1667589715)

Solder the pins on each end of the two header strips, so the four corners of the Pico are soldered. This ensures the Pico and headers are attached properly while you continue to solder the rest of the pins.

![adafruit_products_PiC_Pico_four_corners.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/460/medium640/adafruit_products_PiC_Pico_four_corners.jpg?1667589885)

Solder the rest of the pins.

![adafruit_products_PiC_Pico_fully_soldered_in_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/461/medium640/adafruit_products_PiC_Pico_fully_soldered_in_bb.jpg?1667589966)

Remove it from the breadboard. You're done!&nbsp;

![adafruit_products_PiC_fully_assembled_Pico.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/462/medium640/adafruit_products_PiC_fully_assembled_Pico.jpg?1667590191)

For a bit more detail on the process of soldering standard male headers to a board, check out [the How to Solder Headers' Male Headers page](https://learn.adafruit.com/how-to-solder-headers/male-headers).

# Adafruit PiCowbell CAN Bus for Pico

## Stacking Headers

The first PiCowbell assembly method uses stacking headers, which allows you to use a breadboard with your PiCowbell-Pico sandwich. This is super helpful when you're still prototyping other parts of your project, or simply want jumper-wire access to the Pico pins in addition to the PiCowbell.

This page assumes you have already soldered standard male headers to your Pico. If you have not, please return to the [Pico assembly page](https://learn.adafruit.com/picowbell-proto/pico) and follow the steps there.

Follow the steps below to solder stacking headers to your PiCowbell.

Info: 

## Assembly Steps
Place a standard-header-soldered Pico upside down on the table, so the long side of the header pins are facing up. Press the female sockets of each stacking header onto one of the rows of standard headers attached to the Pico, until they are fully attached.&nbsp;

![adafruit_products_PiC_stacking_on_Pico.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/469/medium640/adafruit_products_PiC_stacking_on_Pico.jpg?1667602072)

 **Ensure the PiCowbell is oriented correctly before beginning assembly.&nbsp;** The PiCowbell should be top-down, so that you are looking at the bottom of the PiCowbell. **The STEMMA QT connector should be on the same end as the Pico USB connector, and the reset button should be on the opposite end with the Pico debug pins.**

The PiCowbell pins must match the pinout on the Pico.

![adafruit_products_PiC_stacking_Pico_with_Cowbell_oriented.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/470/medium640/adafruit_products_PiC_stacking_Pico_with_Cowbell_oriented.jpg?1667602198)

Remember, the pins are labeled on the bottom of the Pico. In this case, that works well because they are labeled on both sides of the PiCowbell, allowing for direct comparison before attaching the PiCowbell to the stacking header assembly.

Warning: 

Press the PiCowbell onto the male pins sticking up from the stacking headers. You may need to push the stacking header pins in or out a bit to get the PiCowbell attached.

With the stacking header male pins sticking up, the bottom of the PiCowbell should be facing up as well.

![adafruit_products_PiC_stacking_with_PiCowbell.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/471/medium640/adafruit_products_PiC_stacking_with_PiCowbell.jpg?1667602725)

Solder the pins on each end of each stacking header, so that the opposite four corners of the PiCowbell are soldered on.

![adafruit_products_PiC_stacking_four_corners.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/472/medium640/adafruit_products_PiC_stacking_four_corners.jpg?1667603161)

Solder the rest of the pins onto the PiCowbell.&nbsp;

![adafruit_products_PiC_stacking_assembled.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/473/medium640/adafruit_products_PiC_stacking_assembled.jpg?1667603424)

You're done! Now you can attach the whole sandwich to a breadboard, have access to the pins via the breadboard, and still be able to use the PiCowbell as well.

![adafruit_products_PiC_stacking_assembled_noBB.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/474/medium640/adafruit_products_PiC_stacking_assembled_noBB.jpg?1667603622)

![adafruit_products_PiC_stacking_assembled_BB.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/475/medium640/adafruit_products_PiC_stacking_assembled_BB.jpg?1667603755)

# Adafruit PiCowbell CAN Bus for Pico

## Socket Headers

This PiCowbell assembly method uses female socket headers on the PiCowbell to create a standalone sandwich when attached to a Pico with standard male headers.&nbsp;

This page assumes you have already soldered standard male headers to your Pico. If you have not, please return to the [Pico assembly page](https://learn.adafruit.com/picowbell-proto/pico) and follow the steps there.

Follow the steps below to solder socket headers to your PiCowbell.

Info: 

## Assembly Steps
Place a standard-header-soldered Pico upside down on the table, so the long side of the header pins are facing up. Press the female sockets onto one of the rows of standard headers attached to the Pico, until both are fully attached.&nbsp;

![adafruit_products_PiC_socket_on_soldered_Pico.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/476/medium640/adafruit_products_PiC_socket_on_soldered_Pico.jpg?1667605165)

![adafruit_products_PiC_socket_on_soldered_Pico_side.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/477/medium640/adafruit_products_PiC_socket_on_soldered_Pico_side.jpg?1667605291)

 **Ensure the PiCowbell is oriented correctly before beginning assembly.&nbsp;** The PiCowbell should be top-down, so that you are looking at the bottom of the Cowbell. **The STEMMA QT connector should be on the same end as the Pico USB connector, and the reset button should be on the opposite end with the Pico debug pins.**

The PiCowbell pins must match the pinout on the Pico.

![adafruit_products_PiC_socket_with_Cowbell_oriented.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/478/medium640/adafruit_products_PiC_socket_with_Cowbell_oriented.jpg?1667605413)

Remember, the pins are labeled on the bottom of the Pico. In this case, that works well because they are labeled on both sides of the PiCowbell, allowing for direct comparison before attaching the PiCowbell to the stacking header assembly.

Warning: 

Press the PiCowbell onto the pins sticking up from the socket headers. You may need to push the stacking header pins in or out a bit to get the PiCowbell attached.

![adafruit_products_PiC_socket_with_Cowbell_unsoldered.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/479/medium640/adafruit_products_PiC_socket_with_Cowbell_unsoldered.jpg?1667605559)

![adafruit_products_PiC_socket_with_Cowbell_unsoldered_side.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/480/medium640/adafruit_products_PiC_socket_with_Cowbell_unsoldered_side.jpg?1667605784)

Solder the pins on each end of each socket header, so that the opposite four corners of the PiCowbell are soldered on.

![adafruit_products_PiC_socket_four_corners.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/481/medium640/adafruit_products_PiC_socket_four_corners.jpg?1667606431)

Solder the rest of the pins onto the PiCowbell.

![adafruit_products_PiC_socket_assembled.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/482/medium640/adafruit_products_PiC_socket_assembled.jpg?1667606442)

That's it, you're done!&nbsp;

![adafruit_products_PiC_assembled_with_Pico.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/484/medium640/adafruit_products_PiC_assembled_with_Pico.jpg?1667606721)

# Adafruit PiCowbell CAN Bus for Pico

## CircuitPython

It's easy to use the **PiCowbell CAN Bus** with CircuitPython and the [Adafruit\_CircuitPython\_MCP2515](https://github.com/adafruit/Adafruit_CircuitPython_MCP2515) module. This module allows you to easily write Python code that lets you utilize the MCP2515 CAN bus controller.

## CircuitPython Usage

To use with CircuitPython, you need to first install the MCP2515 library, and its dependencies, into the **lib** folder onto your **CIRCUITPY** drive. Then you need to update **code.py** with the example script.

Thankfully, we can do this in one go. In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file.

Connect your Feather board to your computer via a known good data+power USB cable. The board should show up in your File Explorer/Finder (depending on your operating system) as a flash drive named **CIRCUITPY**.

Extract the contents of the zip file, and copy the **entire lib folder** and the **code.py** file to your **CIRCUITPY** drive.

Your **CIRCUITPY/lib** folder should contain the following folders:

- **adafruit\_bus\_device/**
- **adafruit\_mcp2515/**

![CIRCUITPY](https://adafruit.github.io/Adafruit_CircuitPython_Bundle/mcp2515_mcp2515_simpletest.py.png )

## Simple Test Example

Once everything is saved to the **CIRCUITPY** drive, [connect to the serial console](https://learn.adafruit.com/welcome-to-circuitpython/kattni-connecting-to-the-serial-console) to see the messages printed out!

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/PiCowbell_CAN_Bus_Examples/CircuitPython_PiCowbell_CAN_Bus/code.py

In the code, the instantiation of `can_bus` sets `loopback` and `silent` to `True`. This allows you to test the CAN Bus messaging without another CAN device.

```python
can_bus = CAN(
    spi, cs, loopback=True, silent=True
)  # use loopback to test without another device
```

In the REPL, you'll see the byte array message be sent successfully every second.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/878/medium800/adafruit_products_cpSimpleTest.png?1683563827)

## Testing with Two CAN Bus PiCowbells

You can test with two CAN Bus PiCowbells by preparing two Raspberry Pi Pico boards with two CAN Bus PiCowbells. Prepare two Raspberry Pi Pico boards with two PiCowbell CAN Bus boards using your preferred header method described in the [Assembly pages](https://learn.adafruit.com/adafruit-picowbell-can-bus-for-pico/assembly).

Once you have two Pico boards connected to CAN Bus PiCowbells, you can connect the CAN signals:

- **PiCowbell A CANH** terminal block to **PiCowbell B CANH** terminal block **(blue wire)**
- **PiCowbell A -** (ground) terminal block to **PiCowbell B -** (ground) terminal block **(black wire)**
- **PiCowbell A CANL** terminal block to **PiCowbell B CANL** terminal block **(yellow wire)**

![adafruit_products_two_picowbells_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/120/880/medium640/adafruit_products_two_picowbells_bb.jpg?1683564317)

Upload the Project Bundle to both **CIRCUITPY** drives. In the code, change the `can_bus` instantiation on both Pico boards to have `loopback` and `silent` be `False`.

```python
can_bus = CAN(
    spi, cs, loopback=False, silent=False
)  # use loopback to test without another device
```

When you run the code on both Pico boards, you can check each serial monitor window and see messages being exchanged between the two boards.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/931/medium800/adafruit_products_cpSimpleTest.png?1683739387)

# Adafruit PiCowbell CAN Bus for Pico

## Python Docs

# Adafruit PiCowbell CAN Bus for Pico

## Arduino

Using the PiCowbell CAN Bus&nbsp;with Arduino involves wiring up the two PiCowbells to two Raspberry Pi Picos, installing the [Adafruit\_MCP2515](https://github.com/adafruit/Adafruit_MCP2515) library and running the provided example code.

## Wiring

Since CAN bus is a two-way communication protocol, you'll need two devices talking to each other over CAN. Prepare two Raspberry Pi Pico boards with two PiCowbell CAN Bus boards using your preferred header method described in the [Assembly pages](https://learn.adafruit.com/adafruit-picowbell-can-bus-for-pico/assembly).

Once you have two Pico boards connected to CAN Bus PiCowbells, you can connect the CAN signals:

- **PiCowbell A CANH** terminal block to **PiCowbell B CANH** terminal block **(blue wire)**
- **PiCowbell A -** (ground) terminal block to **PiCowbell B -** (ground) terminal block **(black wire)**
- **PiCowbell A CANL** terminal block to **PiCowbell B CANL** terminal block **(yellow wire)**

![adafruit_products_two_picowbells_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/120/881/medium640/adafruit_products_two_picowbells_bb.jpg?1683564833)

## Library Installation

You can install the **Adafruit MCP2515** library for Arduino using the Library Manager in the Arduino IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/889/medium800/adafruit_products_Arduino_Open_Library_Manager.png?1683592119)

Click the **Manage Libraries ...** menu item, search for **Adafruit MCP2515** and select the **Adafruit MCP2515** library:

![](https://cdn-learn.adafruit.com/assets/assets/000/120/894/medium800/adafruit_products_libInstall.png?1683636964)

If asked about dependencies for any of the libraries, click "Install all".

![](https://cdn-learn.adafruit.com/assets/assets/000/120/895/medium800/adafruit_products_libDepends.png?1683636973)

If the "Dependencies" window does not come up, then you already have the dependencies installed.

Warning: 

## Example Send Code
https://github.com/adafruit/Adafruit_MCP2515/blob/main/examples/MCP2515_CAN_Sender/MCP2515_CAN_Sender.ino

## Example Receive Code
https://github.com/adafruit/Adafruit_MCP2515/blob/main/examples/MCP2515_CAN_Receiver/MCP2515_CAN_Receiver.ino

Upload the Example Send Code to the first Pico and then upload the Example Receive Code to the second Pico. When you open the Serial Monitor for the Pico running the Send code, you'll see confirmations that packets have been sent.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/887/medium800/adafruit_products_sendCAN.png?1683591323)

When you open the Serial Monitor for the Pico running the Receive code, you'll see the messages coming in via CAN.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/888/medium800/adafruit_products_recieveCAN.png?1683591182)

# Adafruit PiCowbell CAN Bus for Pico

## Arduino Docs

# Adafruit PiCowbell CAN Bus for Pico

## Downloads

## Files

- [MCP2515 Datasheet](https://cdn-learn.adafruit.com/assets/assets/000/119/530/original/MCP2515-Family-Data-Sheet-DS20001801K.pdf?1679491405)
- [TJA1051/3 Datasheet](https://cdn-learn.adafruit.com/assets/assets/000/119/531/original/TJA1051.pdf?1679491410)
- [EagleCAD PCB files on GitHub](https://github.com/adafruit/Adafruit-PiCowbell-CAN-Bus-PCB)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20PiCowbell%20CAN%20Bus.fzpz)

## Schematic and Fab Print

Dimensions are in inches.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/793/medium800/adafruit_products_schem.png?1683141628)

![](https://cdn-learn.adafruit.com/assets/assets/000/120/794/medium800/adafruit_products_fab.png?1683141636)


## Primary Products

### Adafruit PiCowbell CAN Bus for Pico - MCP2515 CAN Controller

[Adafruit PiCowbell CAN Bus for Pico - MCP2515 CAN Controller](https://www.adafruit.com/product/5728)
Ding dong! Hear that? It's the PiCowbell ringing, letting you know that the new **Adafruit&nbsp;PiCowbell CAN Bus** &nbsp;is in stock&nbsp;and ready to assist your [Raspberry Pi Pico](https://www.adafruit.com/product/4864) and <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/5728)
[Related Guides to the Product](https://learn.adafruit.com/products/5728/guides)

## Featured Products

### Raspberry Pi Pico RP2040

[Raspberry Pi Pico RP2040](https://www.adafruit.com/product/4864)
The Raspberry Pi foundation changed single-board computing [when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new **Raspberry Pi Pico**. This...

In Stock
[Buy Now](https://www.adafruit.com/product/4864)
[Related Guides to the Product](https://learn.adafruit.com/products/4864/guides)
### Raspberry Pi Pico W

[Raspberry Pi Pico W](https://www.adafruit.com/product/5526)
The Raspberry Pi foundation changed single-board computing [when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new **Raspberry Pi Pico W**. This...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5526)
[Related Guides to the Product](https://learn.adafruit.com/products/5526/guides)
### Stacking Headers for Raspberry Pi Pico - 2 x 20 Pin

[Stacking Headers for Raspberry Pi Pico - 2 x 20 Pin](https://www.adafruit.com/product/5582)
These two&nbsp; **Stacking**** &nbsp;Headers**&nbsp;alone are, well, lonely. But pair them with the&nbsp;[Raspberry Pi Pico](https://www.adafruit.com/category/875), and you're in business!

What do they do? They stack. Put the headers through your...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5582)
[Related Guides to the Product](https://learn.adafruit.com/products/5582/guides)
### Socket Headers for Raspberry Pi Pico - 2 x 20 pin Female Headers

[Socket Headers for Raspberry Pi Pico - 2 x 20 pin Female Headers](https://www.adafruit.com/product/5583)
These&nbsp; **Socket Headers** &nbsp;alone are, well, lonely. But pair them with the&nbsp;[Raspberry Pi Pico](https://www.adafruit.com/category/875), and you're in business!

Socket headers are like the duct tape of electronics. They're great for connecting...

In Stock
[Buy Now](https://www.adafruit.com/product/5583)
[Related Guides to the Product](https://learn.adafruit.com/products/5583/guides)

## Related Guides

- [AWS IoT and Adafruit WICED Feather](https://learn.adafruit.com/aws-iot-and-adafruit-wiced-feather.md)
- [Building and Running MicroPython on the ESP8266](https://learn.adafruit.com/building-and-running-micropython-on-the-esp8266.md)
- [Adafruit FunHouse](https://learn.adafruit.com/adafruit-funhouse.md)
- [Capturing Camera Images with CircuitPython](https://learn.adafruit.com/capturing-camera-images-with-circuitpython.md)
- [Controlling a Classic Nintendo R.O.B. Robot Using Circuit Playground Express](https://learn.adafruit.com/controlling-a-classic-nintendo-r-o-b-robot-using-circuit-playground-express.md)
- [4x12 Ortho Mechanical Keyboard](https://learn.adafruit.com/4x12-ortho-mechanical-keyboard.md)
- [How we designed an injection-molded case](https://learn.adafruit.com/how-we-designed-an-injection-molded-case-for-raspberry-pi.md)
- [Adafruit 555 PWM Output STEMMA](https://learn.adafruit.com/adafruit-555-pwm-output-stemma.md)
- [AS5600 Super Smooth Rotary Encoder](https://learn.adafruit.com/as5600-smooth-rotary-encoder.md)
- [Garmin Lidar Lite Range Finder](https://learn.adafruit.com/garmin-lidar-lite-range-finder.md)
- [Adafruit I2S MEMS Microphone Breakout](https://learn.adafruit.com/adafruit-i2s-mems-microphone-breakout.md)
- [Working with I2C Devices](https://learn.adafruit.com/working-with-i2c-devices.md)
- [Music Box with Dancing Adabot](https://learn.adafruit.com/music-box-with-circuit-python.md)
- [Adafruit NeoSlider](https://learn.adafruit.com/adafruit-neoslider.md)
- [Halo Energy Sword RP2040](https://learn.adafruit.com/halo-energy-sword-rp2040.md)
