Reference
Raspberry Pi Pico Pinout
The complete pin reference for the Raspberry Pi Pico: 40 pins, GPIO numbers, default UART, I2C and SPI pins, ADC, boot mode and how to flash it.
- RP2040
- 40 pins
- No Wi-Fi
- Micro-USB
Overview
The Raspberry Pi Pico is a small microcontroller board built around the RP2040 chip. It has no Wi-Fi and no operating system: you flash a program onto it and it runs right away. It is a good first board if you want a fast, cheap microcontroller with a lot of flexible pins. Programs can be written in MicroPython, CircuitPython or C/C++.
No Wi-Fi, Bluetooth or Matter badge here on purpose: this board has no radio at all. Only badges for what this exact board supports are shown. For wireless, look at the W version of the board.
Chip and board
The RP2040 is a dual-core microcontroller with 264 KB of SRAM. The board adds 2 MB of QSPI flash, a micro-USB connector, a BOOTSEL button, an LED on GPIO 25 and a 3-pin DEBUG header for SWD. 2 x UART, 2 x SPI, 2 x I2C, 16 PWM channels and 8 PIO state machines are available.
In the drawing the board has the micro-USB connector at the bottom. The BOOTSEL button is on the right of the board, the LED sits next to the USB connector, and the three DEBUG pads are at the top edge. The pin numbers in this guide are the physical pin numbers of the datasheet, counted with the USB connector at the top, starting at the top left. That is why pin 1 is at the bottom right of the pictures.
Getting started
The Pico works over micro-USB. If your computer shows no drive in BOOTSEL mode, try a different cable first.
.uf2 file onto it and the board restarts and runs the program.Hello World: blink an LED
The on-board LED is connected to GPIO 25. This MicroPython script blinks it:
MicroPython
from machine import Pin
from time import sleep
led = Pin(25, Pin.OUT)
while True:
led.toggle()
sleep(0.5)
GPIO 25 is not on the header. To blink an external LED, use a pin such as GP15 with a resistor of about 330 Ω.
Specifications
Specifications from the Raspberry Pi Pico datasheet.
Compute
| Chip | RP2040, dual-core Arm Cortex-M0+, up to 133 MHz |
| SRAM | 264 KB |
| Flash | 2 MB (external, QSPI, with XIP and a 16 KB cache) |
Interfaces
| GPIO | 26 usable (GPIO 0 to 22 digital only, 26 to 28 digital or ADC), fixed 3.3 V logic |
| ADC | 3 external channels (12-bit) plus an internal temperature sensor |
| Interfaces | 2 x UART, 2 x SPI, 2 x I2C, 16 x PWM, 8 x PIO state machines |
Physical
| USB | Micro-USB, USB 1.1 device and host |
| Input voltage | 1.8 to 5.5 V on VSYS, 5 V ± 10% on VBUS |
| Operating temperature | -20 to 85 °C |
| Size | 51 x 21 mm, 1 mm thick PCB |
Dimensions
The board is a single-sided 51 x 21 mm PCB, 1 mm thick, with the micro-USB connector overhanging one end. The 40 main pins sit on a 2.54 mm grid, 17.78 mm between the two rows, with 1 mm holes, so the board fits a breadboard or veroboard. There are four mounting holes of 2.1 mm.
Source: the mechanical drawing in the datasheet. The picture is schematic.
Pinout diagram: component side
The number in the circle is the physical pin number of the datasheet. The USB connector is at the bottom, so the left row runs from pin 21 at the top to pin 40, and the right row from pin 20 at the top down to pin 1.
Pinout diagram: back
The back is mirrored: the same pins sit in the other row. There are also six test points (TP1 to TP6) on the back: ground, USB DM, USB DP, GPIO23, GPIO25 and BOOTSEL.
Pin table
The same pins as a table, counted with the USB connector at the top, as in the official documentation.
| Pin | Function | Pin | Function |
|---|---|---|---|
| 1 | GP0 | 40 | VBUS |
| 2 | GP1 | 39 | VSYS |
| 3 | GND | 38 | GND |
| 4 | GP2 | 37 | 3V3_EN |
| 5 | GP3 | 36 | 3V3 (OUT) |
| 6 | GP4 | 35 | ADC_VREF |
| 7 | GP5 | 34 | GP28 |
| 8 | GND | 33 | AGND |
| 9 | GP6 | 32 | GP27 |
| 10 | GP7 | 31 | GP26 |
| 11 | GP8 | 30 | RUN |
| 12 | GP9 | 29 | GP22 |
| 13 | GND | 28 | GND |
| 14 | GP10 | 27 | GP21 |
| 15 | GP11 | 26 | GP20 |
| 16 | GP12 | 25 | GP19 |
| 17 | GP13 | 24 | GP18 |
| 18 | GND | 23 | GND |
| 19 | GP14 | 22 | GP17 |
| 20 | GP15 | 21 | GP16 |
GPIO map at a glance
The Raspberry Pi Pico brings out 26 of the 30 GPIOs of the chip. GPIO 23, 24, 25 and 29 are used on the board.
GPIO quick reference
| Function | Default pins |
|---|---|
| UART0 | GP0 (TX) and GP1 (RX) |
| I2C0 | GP4 (SDA) and GP5 (SCL) |
| SPI0 | GP16 (RX), GP17 (CS), GP18 (SCK), GP19 (TX) |
| ADC | GP26 (ADC0), GP27 (ADC1), GP28 (ADC2) |
| On-board LED | GP25 (not on the header) |
| Power | 3V3 (OUT) on pin 36, VSYS on pin 39, VBUS on pin 40 |
| Used internally | GPIO 23 (power save pin of the regulator), GPIO 24 (VBUS sense), GPIO 25 (LED), GPIO 29 (ADC3, measures VSYS/3) |
| Ground | Pins 3, 8, 13, 18, 23, 28, 33 and 38 |
| Reset | RUN on pin 30, with a pull-up to 3.3 V of about 50 kΩ. Pull low to restart the board |
| Regulator | 3V3_EN on pin 37, pulled high to VSYS through 100 kΩ. Pull low to switch off the 3.3 V |
Almost every GPIO pin can be assigned to UART, SPI, I2C or PWM through the pin multiplexer, so the defaults above are only a starting point. The defaults come from the Pico SDK board file.
Flashing and boot
| Item | Purpose |
|---|---|
| BOOTSEL | Hold while plugging in to enter the USB bootloader |
| RUN (pin 30) | Pull to GND to reset the chip |
| DEBUG header | SWD (SWCLK, GND, SWDIO) for a debug probe |
| USB | Power, programming and serial output |
Compared with other boards
| Pico | Pico 2 | Zero 2 W | |
|---|---|---|---|
| Type | Microcontroller | Microcontroller | Linux computer |
| Chip | RP2040 | RP2350 | Quad-core Cortex-A53 (RP3A0) |
| Wi-Fi and Bluetooth | No | No | Yes |
| Pins | 40, 2.54 mm grid | 40, 2.54 mm grid | 40-pin GPIO header |
See also the Raspberry Pi Pico 2 pinout and the Raspberry Pi Zero 2 W guide.
Real gotchas
- Pin numbers versus GP numbers. Pin 1 is GP0, pin 31 is GP26. Libraries use the GP number.
- 3.3 V only. The GPIO pins are not 5 V tolerant.
- Analog pins have a diode to 3.3 V. The input may not exceed 3.3 V by more than about 0.3 V, and a voltage on GP26 to GP28 leaks into the 3.3 V rail when the board is unpowered.
- Power from VBUS and VSYS together. Do not feed power into VBUS or VSYS while also using the USB cable without a diode between them.
- No Wi-Fi. If you need that, look at the Pico W.
Safety notes
Before you wire anything up
- GPIO pins are 3.3 V. Do not connect a 5 V signal directly.
- VBUS (pin 40) is the 5 V from USB. VSYS (pin 39) is the main supply input and accepts 1.8 to 5.5 V.
- The datasheet recommends keeping the load on the 3V3 (OUT) pin below 300 mA. Do not power motors, servos or long LED strips from it.
- Each GPIO pin can only source a few mA. Use a driver or a transistor for loads.
Conclusion
The Raspberry Pi Pico is a fast, cheap microcontroller board with 26 flexible GPIO pins and a pinout that is easy to remember: use the physical pin numbers of the datasheet, keep 3.3 V logic and use BOOTSEL to flash it.
More guides
Keep building.
From ESP32 HomeKit accessories to Arduino and ATtiny reference guides, there’s more where this came from.
All guides
