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:
- Introducing the Raspberry Pi Pico GPIOs
- Raspberry Pi Pico GPIO Interfaces
- Raspberry Pi Pico Pinout Diagram
- Raspberry Pi Pico W Pinout Diagram
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.
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 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)
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:
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 W Pinout Diagram
The following picture shows the Raspberry Pi Pico W pinout (which functions are supported by each pin).
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.
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:
|GPIO29||internal ADC (ADC3) for measuring VSYS (check the analog pins section)|
|GPIO25||Connected to the built-in onboard LED (on the Pico) (check this section)|
|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.
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.
|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:
- 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.
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 (TX), GPIO18 (SCK), GPIO17 (CS) and GPIO 16 (RX)
The following table shows all the pins you can use for SPI communication:
|SPI Controller||RX GPIOs||TX GPIOs||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 GPIO32 (on the Raspberry Pi Pico W) or GPIO25 (Raspberry Pi Pico).
- Raspberry Pi Pico: built-in LED connected to GPIO 25
- Raspberry Pi Pico W: built-in LED connected to GPIO 32
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.
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 in a similar way. These pins are labeled as SWDIO (Serial Wire Debug I/O), GND, and SWCL (Serial Wire Debug) at the back of the board.
We hope you’ve found this guide for the Raspberry Pi Pico and Pico W GPIOs useful. For more detailed information about the Raspberry Pi Pico GPIOs, consult the datasheet: Raspberry Pi Pico datasheet.
If you’re just getting started with the Raspberry Pi, take a look at our tutorials:
- Getting Started with Raspberry Pi Pico (and Pico W)
- Programming Raspberry Pi Pico with Arduino IDE (Pico W compatible)
- Raspberry Pi Pico: Control Digital Outputs and Read Digital Inputs (Arduino IDE)
You can check all our Raspberry Pi Pico tutorials on the following link:
Thanks for reading.