Blog Details

Home Blog Details

Raspberry Pi Pico and Pico W Pinout Explanation:

This article goes into detail about the Raspberry Pi Pico and Pico W pinout. The Raspberry Pi Pico comes with 40 pins that can be used to connect electronic components like LEDs, motors, and sensors. Learn what each pin does, what it can be used for, and its specific functions.

Raspberry Pi Pico and Pico W Pinout Explained

Table of Contents

In this article, we’ll cover the following topics:

  • Introducing the Raspberry Pi Pico GPIOs
  • Raspberry Pi Pico GPIO Interfaces
  • Raspberry Pi Pico Pinout Diagram
  • Raspberry Pi Pico W Pinout Diagram
    • Power Pins
    • General Purpose Input/Output Pins
    • PWM Pins
    • Analog Pins
    • I2C Pins
    • SPI Pins
    • UART Pins
    • Built-in LED
    • Onboard Temperature Sensor
    • Debugging Pins

Introducing the Raspberry Pi Pico GPIOs

The Raspberry Pi Pico and Raspberry Pi Pico W have a row of 20 pins on each side, which makes a total of 40 pins. Of those 40 pins, 26 are programmable GPIOs that you can use to connect peripherals like LEDs, motors, and sensors, or even establish a communication with other microcontroller boards.

Raspberry Pi Pico W

The Raspberry Pi Pico GPIOs are labeled on the back. When you use the Raspberry Pi Pico on a breadboard, it might be difficult to identify each pin. So, it’s handy to always have a pinout diagram.

Raspberry Pi Pico Back Pi Labels

Raspberry Pi Pico W and Raspberry Pi Pico

Before explaining all about the Raspberry Pi Pico GPIOs, it’s important to notice that there are two different variants of the Raspberry Pi Pico board:

  • Raspberry Pi Pico: no wireless connectivity (no Wi-Fi, no Bluetooth)
  • Raspberry Pi Pico W: comes with wireless connectivity (Wi-Fi and Bluetooth)
Raspberry Pi Pico Family
Raspberry Pi Pico, Pico H, Pico W, Pico WH (Image source)
 

You may also see those versions referenced with an H, like Raspberry Pi Pico H, or Raspberry Pi Pico WH, which means they come with soldered header pins.

The pinout for the different variants is very similar, the only difference is the GPIO pin that controls the onboard LED and the location of the debug pins. We provide a different diagram for the Raspberry Pi Pico and for the Raspberry Pi Pico W.

Raspberry Pi Pico GPIO Interfaces

The Raspberry Pi Pico comes with 40 pins, 26 of which are programmable GPIOs that you can use to connect peripherals.

The Raspberry Pi Pico supports the following peripheral interfaces on its GPIOs:

  • 2x UART
  • 2x I2C
  • 2x SPI
  • 16x PWM channels
  • 4x ADC pins (12-bit 500ksps)

The Raspberry Pi Pico GPIOs run at 3.3V.

Raspberry Pi Pico Pinout Diagram

The following picture shows the Raspberry Pi Pico pinout (which functions are supported by each pin).

Raspberry Pi Pico R3 A4 Board RP2040 Pinout Diagram GPIOs
Image source: raspberrypi.com

Raspberry Pi Pico W Pinout Diagram

The following picture shows the Raspberry Pi Pico W pinout (which functions are supported by each pin).

Raspberry Pi Pico W RP2040 Rev3 Board Pinout Diagram GPIOs
Image source: raspberrypi.com

Power Pins

  • The Raspberry Pi Pico has several power pins, 3V3 (OUT), VSYS, and VBUS marked as red on the pinout diagrams.
  • The 3V3(OUT) pin provides a 3.3V power output that can be useful to power external circuits.
  • The VBUS (USB Power Input) is the micro-USB input voltage. So, if you’re powering the Raspberry Pi Pico via the USB port using 5V, you’ll get 5V on the VBUS pin.
  • VSYS (External Power Input) is the main system input voltage. This means this pin allows for an external power supply to be connected to provide power to the board if you’re not using the micro-USB input. VSYS minimum input is 1.8V and maximum is 5.5V.
  • The GND pins are colored in black in the diagram.
  • There are other power pins for special cases:
  • 3V3_EN: connects to the board SMPS enable pin, which is the same as saying it is responsible for a hardware power on/off (hardware reset)—set to LOW to reset;
  • ADC_REF: ADC pin power supply voltage;
  • AGND: GND reference for the ADC pins;
  • RUN: this is the enable pin; set to LOW to reset the microcontroller chip RP2040 (software reset).

General Purpose Input/Output Pins

The Raspberry Pi Pico comes with 40 pins, 26 of which are programmable GPIOs (general-purpose input/output pins) that you can use to connect peripherals.

Raspberry Pi Pico GPIO pins

These pins are colored in a light green color on the diagrams. They are numbered from GPIO0 to GPIO29. Four of these pins are not exposed on the pin header but are dedicated to internal board functions: GPIO23, GPIO24, GPIO25, and GPIO29. See the following section.

GPIOs Dedicated to Internal Board Functions

There are GPIOs that are not exposed on the pin header, but that you can use to control or monitor internal board functions:

GPIO29internal ADC (ADC3) for measuring VSYS 
GPIO25Connected to the built-in onboard LED (on the Pico) 
GPIO24Indicator for VBUS presence
GPIO23Controls on-board SMPS (Switched Power Mode Supply)

PWM Pins

All Raspberry Pi Pico GPIOs can output PWM signals—they are marked in the diagrams in light green color.

The Raspberry Pi Pico has 8 independent PWM generators called slices. Each slice has two channels (A and B), which makes a total of 16 PWM channels.

GPIO

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

PWM Channel

0A0B1A1B2A2B3A3B4A4B5A5B6A6B7A7B

GPIO

16

17

18

19

20

21

22

23

24

25

26

27

28

29

  

PWM Channel

0A0B1A1B2A2B3A3B4A4B5A5B6A6B  

The same PWM output can be selected on two GPIO pins; the same signal will appear on each GPIO.

Analog Pins

The Raspberry Pi Pico has a 12-bit ADC with four channels on a fixed set of pins (plus an extra internal temperature sensor). This means it can transform an analog signal into a digital signal as a number ranging from 0 to 4095.

It has five ADC channels, but only four are accessible on the GPIOs: GPIO26, GPIO27, GPIO28, and GPIO29.

The first three GPIOs (26, 27, and 28) can be used to read voltage from peripherals, while GPIO29 can be utilized to measure the voltage level of the VSYS supply on the Raspberry Pi Pico board (VSYS is the input voltage that powers the board).

The fifth ADC channel is connected to a built-in temperature sensor.

ADC Channel

GPIO

Function

ADC0GPIO26Read analog signals from peripherals
ADC1GPIO27Read analog signals from peripherals
ADC2GPIO28Read analog signals from peripherals
ADC3GPIO29Measure voltage level of VSYS power supply
ADC4———Read built-in temperature sensor

In summary, here are the key features of the analog pins of the Raspberry Pi Pico board:

  • 12-bit resolution – transforms an analog signal into a value between 0 and 4095;
  • 4 ADC channels on external GPIOs;
  • GPIOs 26, 27, and 28 can be used to read output voltage from peripherals;
  • GPIO29 can measure the input voltage that powers the board (VSYS);
  • There’s a fifth ADC channel that is connected to an internal temperature sensor.

I2C

There are two I2C peripherals available, named I2C1 and I2C0. You can use two different buses (I2C1 and I2C2) simultaneously, but you can’t use two I2C1 or two I2C2 at the same time. You can use I2C communication on any of the I2C pins available.

The default I2C pins are GPIO 4 (SDA) and GPIO 5 (SCL).

The following table shows all the pins you can use for I2C communication.

I2C Controller

SDA GPIOs

SCL GPIOs

I2C0

GPIO0, GPIO4, GPIO8, GPIO12, GPIO16, GPIO20GPIO1, GPIO5, GPIO9, GPIO13, GPIO17, GPIO21

I2C1

GPIO2, GPIO6, GPIO10, GPIO14, GPIO18, GPIO26GPIO3, GPIO7, GPIO11, GPIO15, GPIO19, GPIO27

SPI

There are also two SPI peripherals available, SPI0 and SPI1. You can use two SPI buses on different peripherals simultaneously, but you cannot use two buses on the same peripheral at the same time. You can use SPI on any of the available SPI pins, but the default are GPIO19 (TX), GPIO18 (SCK), GPIO17 (CS), and GPIO 16 (RX).

Raspberry Pi Pico Default SPI Pins: GPIO19 (MOSI/TX), GPIO18 (SCK), GPIO17 (CS) and GPIO 16 (MISO/RX)

The following table shows all the pins you can use for SPI communication:

SPI Controller

RX GPIOs (MISO)

TX GPIOs (MOSI)

CLK GPIOs

CS GPIOs

SPI0

GPIO0, GPIO4, GPIO16GPIO3, GPIO7, GPIO19GPIO2, GPIO6, GPIO18GPIO1, GPIO5, GPIO17

SPI1

GPIO8, GPIO12GPIO11, GPIO15GPIO10, GPIO14GPIO9, GPIO13

UART

Similarly to I2C and SPI, there are two UART peripherals: UART0 and UART1. You can use UART in any of the available pins, but GPIO0(TX) and GPIO1(RX) are the default UART pins.

Raspberry Pi Pico Default UART Pins: GPIO0(TX) and GPIO1(RX)

The following table shows all the pins you can use for UART:

UART Interface

TX GPIOs

RX GPIOs

UART0

GPIO0, GPIO12, GPIO16GPIO1, GPIO13, GPIO17

UART1

GPIO4, GPIO8GPIO5, GPIO9

Built-in LED

Raspberry Pi Pico W onboard LED on

The Raspberry Pi Pico comes with a built-in onboard LED that is useful for testing and debugging purposes (see the green LED in the picture above). You can control the built-in LED via GPIO25 (Raspberry Pi Pico).

  • Raspberry Pi Pico: built-in LED connected to GPIO 25

On the Raspberry Pi Pico W, usually you refer to it as ‘LED’ in MicroPython or LED_BUILTIN in Arduino IDE.

Onboard Temperature Sensor

As we’ve mentioned previously, the Raspberry Pi Pico comes with a built-in temperature sensor that you can read on ADC4.

Debugging Pins

The Raspberry Pi Pico comes with debug pins that you can use to connect to a Raspberry Pi Debug Probe for troubleshooting and debugging.

Raspberry Pi Pico Debug pins

The pins are located in different places on the Pico and Pico W but act similarly. These pins are labeled as SWDIO (Serial Wire Debug I/O), GND, and SWCL (Serial Wire Debug Clock) at the back of the board.