Board and Pinout Overview
The Raspberry Pi Pico and Pico W use the RP2040 microcontroller and share the same 40-pin external connector arrangement. Both boards expose 26 user GPIO signals, including three external ADC inputs.
The principal pinout difference concerns internal GPIO assignments. On the original Pico, GP25 controls the onboard LED. On the Pico W, the LED is connected to the CYW43439 wireless controller, while several RP2040 GPIO signals are reserved for wireless communication.
| Feature | Raspberry Pi Pico | Raspberry Pi Pico W |
|---|---|---|
| Microcontroller | RP2040 | RP2040 |
| Processor | Dual-core Cortex-M0+ | Dual-core Cortex-M0+ |
| SRAM | 264 KB | 264 KB |
| Onboard flash | 2 MB | 2 MB |
| External user GPIO | 26 | 26 |
| External ADC inputs | 3 | 3 |
| GPIO logic voltage | 3.3 V | 3.3 V |
| Main connector | 40 pins | 40 pins |
| Onboard LED | GP25 | WL_GPIO0 |
| Wireless | None | CYW43439 |
| Debug interface | SWD | SWD |
Pico H and Pico WH have the same functional pinouts as Pico and Pico W respectively, but include pre-soldered headers.
This reference covers RP2040-based Pico boards. Pico 2 and Pico 2 W use RP2350 and require separate consideration of internal pin functions and electrical characteristics.
Complete 40-Pin Header Reference
Physical pin numbers refer to the board connector. GPIO numbers refer to RP2040 signals.
| Physical pin | Signal | Function |
|---|---|---|
| 1 | GP0 | GPIO / UART0 TX / I2C0 SDA |
| 2 | GP1 | GPIO / UART0 RX / I2C0 SCL |
| 3 | GND | Ground |
| 4 | GP2 | GPIO / I2C1 SDA |
| 5 | GP3 | GPIO / I2C1 SCL |
| 6 | GP4 | GPIO / UART1 TX / I2C0 SDA |
| 7 | GP5 | GPIO / UART1 RX / I2C0 SCL |
| 8 | GND | Ground |
| 9 | GP6 | GPIO / I2C1 SDA |
| 10 | GP7 | GPIO / I2C1 SCL |
| 11 | GP8 | GPIO / UART1 TX / I2C0 SDA |
| 12 | GP9 | GPIO / UART1 RX / I2C0 SCL |
| 13 | GND | Ground |
| 14 | GP10 | GPIO / I2C1 SDA |
| 15 | GP11 | GPIO / I2C1 SCL |
| 16 | GP12 | GPIO / SPI1 RX |
| 17 | GP13 | GPIO / SPI1 CSn |
| 18 | GND | Ground |
| 19 | GP14 | GPIO / SPI1 SCK |
| 20 | GP15 | GPIO / SPI1 TX |
| 21 | GP16 | GPIO / SPI0 RX |
| 22 | GP17 | GPIO / SPI0 CSn |
| 23 | GND | Ground |
| 24 | GP18 | GPIO / SPI0 SCK |
| 25 | GP19 | GPIO / SPI0 TX |
| 26 | GP20 | GPIO / I2C0 SDA |
| 27 | GP21 | GPIO / I2C0 SCL |
| 28 | GND | Ground |
| 29 | GP22 | GPIO |
| 30 | RUN | RP2040 reset input |
| 31 | GP26 / ADC0 | GPIO / analogue input 0 |
| 32 | GP27 / ADC1 | GPIO / analogue input 1 |
| 33 | AGND | Analogue ground |
| 34 | GP28 / ADC2 | GPIO / analogue input 2 |
| 35 | ADC_VREF | ADC reference supply |
| 36 | 3V3(OUT) | Regulated 3.3 V output |
| 37 | 3V3_EN | Regulator enable |
| 38 | GND | Ground |
| 39 | VSYS | System supply input |
| 40 | VBUS | USB 5 V connection |
The peripheral functions shown are selected examples. Most GPIO pins support several alternative peripheral assignments.
Pin numbering warning: Physical pin 20 is GP15. When writing firmware, use the GPIO identifier rather than the physical connector number.
Physical Pin Arrangement
Viewed from the component side with the USB connector at the top, the header numbering is:
| Left side | Signal | Signal | Right side |
|---|---|---|---|
| 1 | GP0 | VBUS | 40 |
| 2 | GP1 | VSYS | 39 |
| 3 | GND | GND | 38 |
| 4 | GP2 | 3V3_EN | 37 |
| 5 | GP3 | 3V3(OUT) | 36 |
| 6 | GP4 | ADC_VREF | 35 |
| 7 | GP5 | GP28 / ADC2 | 34 |
| 8 | GND | AGND | 33 |
| 9 | GP6 | GP27 / ADC1 | 32 |
| 10 | GP7 | GP26 / ADC0 | 31 |
| 11 | GP8 | RUN | 30 |
| 12 | GP9 | GP22 | 29 |
| 13 | GND | GND | 28 |
| 14 | GP10 | GP21 | 27 |
| 15 | GP11 | GP20 | 26 |
| 16 | GP12 | GP19 | 25 |
| 17 | GP13 | GP18 | 24 |
| 18 | GND | GND | 23 |
| 19 | GP14 | GP17 | 22 |
| 20 | GP15 | GP16 | 21 |
This orientation is particularly useful when wiring a Pico directly on a breadboard.
GPIO Electrical Characteristics
RP2040 GPIO operates from the 3.3 V I/O supply.
| Parameter | Reference |
|---|---|
| GPIO logic supply | 3.3 V nominal |
| 5 V tolerant | No |
| Digital input/output | GP0–GP22, GP26–GP28 on header |
| Internal pull-up | Available |
| Internal pull-down | Available |
| Configurable drive strength | 2, 4, 8 or 12 mA nominal settings |
| Schmitt-trigger input | Supported |
| GPIO interrupt detection | Edge and level |
| PWM capability | Available through GPIO function selection |
| PIO capability | Available on user GPIO |
The GPIO drive-strength setting is not a guaranteed safe continuous load current for every circuit. Respect RP2040 output voltage specifications, total I/O loading and thermal constraints.
GPIO pins are not protected against arbitrary overvoltage.
Do not connect a 5 V output directly to a Pico input. Use a level shifter or a correctly designed voltage divider for suitable unidirectional signals.
Internal Pull Resistors
The RP2040 provides software-selectable pull-up and pull-down resistors.
Typical use:
| Input arrangement | Recommended configuration |
|---|---|
| Button to GND | Pull-up |
| Button to 3.3 V | Pull-down |
| Open-drain output | Pull-up |
| Push-pull output | Usually no internal pull required |
| Unused input | Defined level or suitable configuration |
Internal pull resistors are relatively weak and have tolerance. They are not substitutes for appropriately sized external resistors on timing-sensitive or noise-sensitive interfaces.
Power and Control Pins
| Pin | Signal | Description |
|---|---|---|
| 40 | VBUS | USB 5 V supply |
| 39 | VSYS | Main system supply input |
| 38 | GND | Ground |
| 37 | 3V3_EN | Regulator enable, active high |
| 36 | 3V3(OUT) | Regulated 3.3 V output |
| 35 | ADC_VREF | ADC reference supply |
| 33 | AGND | Analogue ground |
| 30 | RUN | Active-low reset |
The Pico board accepts a VSYS supply in the documented range of 1.8–5.5 V.
VBUS is connected to the USB supply and should not be treated as a regulated 5 V output when USB is absent.
The 3V3(OUT) pin can power suitable low-current external devices, provided the onboard regulator has sufficient available capacity.
Pulling RUN low resets the RP2040. Releasing it allows the device to restart.
Pulling 3V3_EN low disables the onboard regulator, removing the normal 3.3 V supply.
Power design: When using an external supply alongside USB, consider the onboard power path and prevent unwanted backfeeding. Do not connect unrelated power supplies together without suitable isolation.
I2C Pin Assignments
The RP2040 provides two hardware I2C controllers.
I2C0
| SDA | SCL |
|---|---|
| GP0 | GP1 |
| GP4 | GP5 |
| GP8 | GP9 |
| GP12 | GP13 |
| GP16 | GP17 |
| GP20 | GP21 |
I2C1
| SDA | SCL |
|---|---|
| GP2 | GP3 |
| GP6 | GP7 |
| GP10 | GP11 |
| GP14 | GP15 |
| GP18 | GP19 |
| GP26 | GP27 |
These are valid hardware-function pairings. Firmware must select the corresponding I2C controller and configure the GPIO function correctly.
I2C Wiring Reference
| Pico | External device |
|---|---|
| SDA | SDA |
| SCL | SCL |
| GND | GND |
| Suitable supply | VCC |
SDA and SCL require pull-up resistors. A typical starting point for a short 3.3 V bus is 4.7 kΩ on each line.
Some modules already include pull-ups. Multiple modules with parallel pull-ups can produce an excessively low effective resistance.
For two equal pull-ups:
R_effective = R / 2
Two 4.7 kΩ resistors in parallel produce approximately 2.35 kΩ.
Check bus rise time, capacitance and the sink-current limits of connected devices.
SPI Pin Assignments
The RP2040 provides SPI0 and SPI1 controllers.
SPI0
| RX / MISO | CSn | SCK | TX / MOSI |
|---|---|---|---|
| GP0 | GP1 | GP2 | GP3 |
| GP4 | GP5 | GP6 | GP7 |
| GP16 | GP17 | GP18 | GP19 |
| GP20 | GP21 | GP22 | — |
The final row is not a complete four-signal hardware SPI group: GP20, GP21 and GP22 provide SPI0 RX, CSn and SCK respectively, but the corresponding TX function is not available on the external header in that group.
SPI1
| RX / MISO | CSn | SCK | TX / MOSI |
|---|---|---|---|
| GP8 | GP9 | GP10 | GP11 |
| GP12 | GP13 | GP14 | GP15 |
| GP24 | GP25 | GP26 | GP27 |
The GP24/GP25/GP26/GP27 group is not a practical complete external-header assignment because GP24 and GP25 are not exposed on the main connector and have board-specific internal uses.
Recommended convenient assignments:
| Controller | MISO | MOSI | SCK | CS |
|---|---|---|---|---|
| SPI0 | GP16 | GP19 | GP18 | GP17 |
| SPI1 | GP12 | GP15 | GP14 | GP13 |
Software-controlled chip select can use another available GPIO.
SPI clock polarity, phase, data order and maximum clock frequency must match the connected device.
UART Pin Assignments
The RP2040 provides two hardware UART controllers.
UART0
| TX | RX |
|---|---|
| GP0 | GP1 |
| GP12 | GP13 |
| GP16 | GP17 |
| GP28 | GP29 |
GP29 is not exposed on the main header and has an internal board function, so the final pairing is unsuitable as a normal two-wire external UART connection.
UART1
| TX | RX |
|---|---|
| GP4 | GP5 |
| GP8 | GP9 |
| GP20 | GP21 |
| GP24 | GP25 |
GP24 and GP25 are not available as a normal external pair.
UART Signal Requirements
| Parameter | Reference |
|---|---|
| Logic voltage | 3.3 V |
| TX connection | Connect to receiver RX |
| RX connection | Connect to transmitter TX |
| Ground | Common ground required |
| Typical configuration | 115200 baud, 8N1 |
| RS-232 voltage compatibility | Requires transceiver |
The RP2040 UART also supports hardware flow-control signals on suitable alternate-function GPIO assignments.
A direct connection to conventional ± voltage RS-232 equipment can damage the Pico.
ADC Pinout
The RP2040 provides a 12-bit ADC with five selectable inputs, including an internal temperature sensor. Only three external ADC inputs are exposed on the standard Pico header.
| ADC channel | GPIO | Physical pin | Function |
|---|---|---|---|
| ADC0 | GP26 | 31 | External analogue input |
| ADC1 | GP27 | 32 | External analogue input |
| ADC2 | GP28 | 34 | External analogue input |
| ADC3 | GP29 | Not on header | Board-specific internal connection |
| ADC4 | Internal | Not applicable | Temperature sensor |
On the standard Pico, GP29 is connected to a divided VSYS measurement circuit.
On Pico W, GP29 is shared with wireless-controller interfacing, so VSYS measurement requires additional coordination.
ADC Conversion
The raw 12-bit ADC result ranges from 0 to 4095.
Voltage ≈ ADC_result × VREF / 4095
With a nominal 3.3 V reference:
ADC result 0 ≈ 0.000 V
ADC result 2048 ≈ 1.650 V
ADC result 4095 ≈ 3.300 V
These are nominal values. Actual accuracy depends on reference voltage, analogue input conditions and ADC error.
The ideal quantisation step at 3.3 V is approximately 0.806 mV.
Do not apply analogue voltages outside the permitted ADC input range.
PWM Pin Mapping
The RP2040 has eight PWM slices, each with channels A and B.
| GPIO | PWM slice | Channel |
|---|---|---|
| GP0 | 0 | A |
| GP1 | 0 | B |
| GP2 | 1 | A |
| GP3 | 1 | B |
| GP4 | 2 | A |
| GP5 | 2 | B |
| GP6 | 3 | A |
| GP7 | 3 | B |
| GP8 | 4 | A |
| GP9 | 4 | B |
| GP10 | 5 | A |
| GP11 | 5 | B |
| GP12 | 6 | A |
| GP13 | 6 | B |
| GP14 | 7 | A |
| GP15 | 7 | B |
| GP16 | 0 | A |
| GP17 | 0 | B |
| GP18 | 1 | A |
| GP19 | 1 | B |
| GP20 | 2 | A |
| GP21 | 2 | B |
| GP22 | 3 | A |
| GP26 | 5 | A |
| GP27 | 5 | B |
| GP28 | 6 | A |
GPIO signals separated by 16 can map to the same PWM slice and channel.
For instance, GP0 and GP16 both map to PWM slice 0, channel A. They cannot generate independently configured PWM waveforms through that same hardware channel.
Channels A and B within a slice share the PWM counter frequency but have separate duty-cycle compare settings.
For edge-aligned PWM:
PWM frequency = System clock / (Divider × (TOP + 1))
Pico and Pico W Internal GPIO Differences
The main header assignments are identical, but internal GPIO usage differs.
| GPIO | Pico | Pico W |
|---|---|---|
| GP23 | Regulator power-save control | Wireless power control |
| GP24 | VBUS detection | Wireless data/interrupt |
| GP25 | Onboard LED | Wireless SPI chip select |
| GP29 | VSYS ADC measurement | Wireless SPI clock and shared VSYS measurement |
These signals are not available on the external 40-pin connector.
On Pico W, the onboard LED is controlled through the wireless controller’s WL_GPIO0 signal.
MicroPython Onboard LED
For current official MicroPython firmware supporting the board’s LED alias:
from machine import Pinled = Pin("LED", Pin.OUT)led.on()
The "LED" alias is preferable to hard-coding GP25 when sharing code between Pico and Pico W.
Pico SDK Onboard LED
On the original Pico, GP25 can be controlled using standard RP2040 GPIO functions.
On Pico W, use the SDK’s wireless-board LED facilities, such as the appropriate CYW43 driver API, rather than treating the LED as an ordinary RP2040 GPIO.
MicroPython Pin Configuration
Digital Output
from machine import Pinoutput = Pin(15, Pin.OUT)output.value(1)output.value(0)
Digital Input
from machine import Pinbutton = Pin(14, Pin.IN, Pin.PULL_UP)if button.value() == 0: print("Pressed")
I2C on GP4 and GP5
from machine import Pin, I2Ci2c = I2C( 0, sda=Pin(4), scl=Pin(5), freq=100000)print(i2c.scan())
SPI0 on GP16–GP19
from machine import Pin, SPIspi = SPI( 0, baudrate=1000000, sck=Pin(18), mosi=Pin(19), miso=Pin(16))cs = Pin(17, Pin.OUT, value=1)
UART0 on GP0 and GP1
from machine import UART, Pinuart = UART( 0, baudrate=115200, tx=Pin(0), rx=Pin(1))uart.write(b"Test\r\n")
ADC on GP26
from machine import ADC, Pinadc = ADC(Pin(26))raw = adc.read_u16()voltage = raw * 3.3 / 65535print(voltage)
The 16-bit MicroPython result is scaled from the hardware ADC resolution.
Pico SDK GPIO Configuration
The following example configures GP15 as a digital output using the Raspberry Pi Pico C/C++ SDK.
#include "pico/stdlib.h"
int main(void) {
const uint pin = 15;
gpio_init(pin);
gpio_set_dir(pin, GPIO_OUT);
while (true) {
gpio_put(pin, 1);
sleep_ms(500);
gpio_put(pin, 0);
sleep_ms(500);
}
}
Common GPIO Functions
| Function | Purpose |
|---|---|
gpio_init() |
Initialise GPIO |
gpio_set_dir() |
Configure input or output |
gpio_put() |
Write output level |
gpio_get() |
Read input level |
gpio_pull_up() |
Enable internal pull-up |
gpio_pull_down() |
Enable internal pull-down |
gpio_disable_pulls() |
Disable pull resistors |
gpio_set_function() |
Select peripheral function |
gpio_set_irq_enabled_with_callback() |
Configure GPIO interrupt and callback |
SWD Debug Connections
The Pico and Pico W expose a three-signal SWD interface separate from the main 40-pin header.
| Debug signal | Purpose |
|---|---|
| SWCLK | Debug clock |
| SWDIO | Bidirectional debug data |
| GND | Ground reference |
The debug pads or connector are located at the end of the board opposite the USB connector.
SWD supports hardware debugging, firmware programming, breakpoint control and register inspection through a compatible debug probe.
The target must be powered, and the debug probe must share its ground reference.
Pin Selection and Common Conflicts
| Requirement | Practical choice | Restriction |
|---|---|---|
| Basic digital output | GP0–GP22 | Avoid GPIO already allocated to another peripheral |
| Digital input | GP0–GP22 | Configure pull resistor as required |
| Analogue input | GP26–GP28 | Must remain within ADC voltage limits |
| I2C0 | GP4/GP5 | Shared with other alternate functions |
| I2C1 | GP6/GP7 | Requires suitable pull-ups |
| SPI0 | GP16–GP19 | Check chip-select handling |
| SPI1 | GP12–GP15 | Conflicts with other uses of those GPIO |
| UART0 | GP0/GP1 | Cannot simultaneously use same pins for I2C0 |
| UART1 | GP4/GP5 | Cannot simultaneously use same pins for I2C0 |
| PWM | Any suitable user GPIO | Slice and channel sharing |
| Onboard LED | GP25 on Pico | Not valid for Pico W |
| External reset | RUN | Active-low control |
| Hardware debug | SWD connector | Separate from main header |
Pinout Troubleshooting
| Symptom | Likely cause | Corrective action |
|---|---|---|
| Output connected to wrong pin | Confusion between physical pin and GPIO number | Check the 40-pin header table |
| Input changes randomly | Floating GPIO | Enable appropriate pull resistor |
| GPIO damaged or unresponsive | Exposure to excessive voltage | Verify signal levels before reconnecting |
| I2C device not detected | Wrong controller or SDA/SCL pair | Check valid I2C mapping |
| I2C bus remains low | Wiring fault or excessive pull-up loading | Disconnect devices individually and inspect idle levels |
| SPI device returns invalid data | Wrong SPI pin mapping or mode | Confirm RX, TX, SCK, CS and clock settings |
| UART output is corrupted | Baud-rate or framing mismatch | Verify 8N1 and matching baud rates |
| ADC reads full scale | Input near or above reference | Measure input voltage independently |
| PWM outputs behave identically | Shared PWM channel | Select GPIO mapped to independent channels |
| Pico W LED does not respond | GP25 used instead of wireless LED control | Use board-aware LED API |
| VSYS measurement fails on Pico W | Shared GP29 wireless function | Use firmware-supported measurement procedure |
| SWD connection fails | Incorrect debug wiring or target power | Verify SWCLK, SWDIO, ground and supply |
Pinout Design Notes
The following restrictions should be checked before committing a circuit to a PCB or soldered prototype.
- GPIO signals are 3.3 V logic and are not 5 V tolerant.
- GP26, GP27 and GP28 are the only external ADC inputs on the standard Pico and Pico W header.
- GPIO alternate functions are multiplexed; one pin cannot perform unrelated peripheral functions simultaneously.
- GP23, GP24, GP25 and GP29 have board-specific internal functions and are not normal external-header GPIO.
- Pico W wireless-controller signals must not be repurposed as general GPIO.
- PWM channels can share hardware resources even when they appear on different physical pins.
- I2C pull-up resistors must reference a suitable voltage for every connected device.
- SPI and UART pin assignments must match the selected hardware controller.
- RUN is a reset input, not a general-purpose GPIO.
- ADC_VREF is a reference-supply connection, not an additional analogue input.
- The three SWD connections are separate from the 40-pin user header.
The Pico and Pico W can generally share external-header wiring and RP2040 GPIO assignments. Firmware must still account for the different onboard LED arrangement, internal GPIO allocation and wireless-controller requirements.
Free Download
Raspberry Pi Pico and Pico W Pinout
