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.
Table of Contents
In this article, we’ll cover the following topics:
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.
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.
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:
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.
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:
The Raspberry Pi Pico GPIOs run at 3.3V.
The following picture shows the Raspberry Pi Pico pinout (which functions are supported by each pin).
The following picture shows the Raspberry Pi Pico W pinout (which functions are supported by each pin).
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.
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.
There are GPIOs that are not exposed on the pin header, but that you can use to control or monitor internal board functions:
GPIO29 | internal ADC (ADC3) for measuring VSYS |
GPIO25 | Connected to the built-in onboard LED (on the Pico) |
GPIO24 | Indicator for VBUS presence |
GPIO23 | Controls on-board SMPS (Switched Power Mode Supply) |
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 | 0A | 0B | 1A | 1B | 2A | 2B | 3A | 3B | 4A | 4B | 5A | 5B | 6A | 6B | 7A | 7B |
GPIO | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | ||
PWM Channel | 0A | 0B | 1A | 1B | 2A | 2B | 3A | 3B | 4A | 4B | 5A | 5B | 6A | 6B |
The same PWM output can be selected on two GPIO pins; the same signal will appear on each GPIO.
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 |
ADC0 | GPIO26 | Read analog signals from peripherals |
ADC1 | GPIO27 | Read analog signals from peripherals |
ADC2 | GPIO28 | Read analog signals from peripherals |
ADC3 | GPIO29 | Measure 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:
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, GPIO20 | GPIO1, GPIO5, GPIO9, GPIO13, GPIO17, GPIO21 |
I2C1 | GPIO2, GPIO6, GPIO10, GPIO14, GPIO18, GPIO26 | GPIO3, GPIO7, GPIO11, GPIO15, GPIO19, GPIO27 |
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, GPIO16 | GPIO3, GPIO7, GPIO19 | GPIO2, GPIO6, GPIO18 | GPIO1, GPIO5, GPIO17 |
SPI1 | GPIO8, GPIO12 | GPIO11, GPIO15 | GPIO10, GPIO14 | GPIO9, GPIO13 |
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, GPIO16 | GPIO1, GPIO13, GPIO17 |
UART1 | GPIO4, GPIO8 | GPIO5, GPIO9 |
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).
On the Raspberry Pi Pico W, usually you refer to it as ‘LED’ in MicroPython or LED_BUILTIN in Arduino IDE.
As we’ve mentioned previously, the Raspberry Pi Pico comes with a built-in temperature sensor that you can read on ADC4.
The Raspberry Pi Pico comes with debug pins that you can use to connect to a Raspberry Pi Debug Probe for troubleshooting and debugging.
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.