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).
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.
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) |
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 | 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.
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 |
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.
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, GPIO20 | GPIO1, GPIO5, GPIO9, GPIO13, GPIO17, GPIO21 |
I2C1 | GPIO2, GPIO6, GPIO10, GPIO14, GPIO18, GPIO26 | GPIO3, 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 (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 |
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, GPIO16 | GPIO1, GPIO13, GPIO17 |
UART1 | GPIO4, GPIO8 | GPIO5, GPIO9 |
Built-in LED
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.
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.
Wrapping Up
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.
Do you have any examples of pico debug using the JLINK devices and the Eclipse environment? JTAG level debug nt using another Pico.
I want to program both cores to do concurrent work and share peripherals.
If so please contact me with details.
Sincerely,
Mike Fontes
Hi.
At the moment, we don’t have any tutorials about that subject.
Regards,
Sara
Sara,
Do you know of any developers using the Eclipse IDE with the Pico who I can contact? I have used it with the TI code composer environment and the TI single core devices but want to develop some code for stepper motor control that uses a round robin OS I developed over the years.
Hi.
Unfortunately, I’m not familiar with that subject.
Regards,
Sara
There are lots of resources on that subject. You might want to start with the JTAG links on Pinout: https://pinout.xyz/#
suse.com/c/debugging-raspberry-pi-3-with-jtag/
Have fun!
Hi,
There is an error in the UART table. RX GPIO should be GPIO13 not GPIO3.
UART0 GPIO0, GPIO12, GPIO16 GPIO1, GPIO3, GPIO17 <====== Original
UART0 GPIO0, GPIO12, GPIO16 GPIO1, GPIO13, GPIO17 <====== fixed GPIO
Hi.
You’re right.
Thanks for letting me know.
It’s fixed now.
Regards,
Sara
Hi Sara,
here a comment on the built-in LEDs:
The command => Serial.print(LED_BUILTIN); <= corectly reproduces the GPIO25 for the Pico-board, but in my case shows the GPIO32 for the PicoW-board. GPIO0 would conflict with UART0 anyway.
By the way, UART0 (TX => GPIO0, RX => GPIO1) is only accessed through “Serial1”. The simple “Serial” represents the connection to the USB connector.
Best regards.
Hi.
Yes.
You’re right.
I don’t know why the official pinout shows GPIO 0.
Regards,
Sara
Hello Sarah,
I am looking at this board as I am fed up with restrictions on use of IO pins and PWM frequencies on arduino nano, 8266 and esp32.
No mention of 5v tolerance, what is maximum digital input voltage?
Is the PWM frequency adjustable?
Thanks.
Terry R.
Hi.
Yes, the frequency is adjustable. You can check this tutorial: https://randomnerdtutorials.com/raspberry-pi-pico-pwm-micropython/
Regards,
Sara
Hi,
thank you for nice tutorial.
Do you think that it would be possible to use same libraries as for Arduino UNO.
For example if I would like to have it connected with ETHERNET SHIELD W5100, AUDIO SHIELD VS 1053 B (and create simple internet radio)
Best Regards,
Milan
I looked at the RPi website electrical specs for the board but was unable to find the current voltage min/max for the GPIOs in/out. Do I have to go all the way to the M0 chip manufacturer specs to find that?
If I am hooking components up to it I would want to know that.