Home / Reference

Raspberry Pi Pico pinout: every pin explained

A Raspberry Pi Pico from above, with 40 pins along its two long edges and the micro USB socket at the top
Beginner

The Raspberry Pi Pico, Pico H, Pico W and Pico 2 all share the same 40-pin layout. That means wiring and code from one usually work on the others. This page lists every pin and explains the power pins, which cause most beginner problems.

Logic level: 3.3 V. The Pico's GPIO pins work at 3.3 V. Don't feed 5 V signals into them unless you have checked the chip's rules: the original Pico (RP2040) is not 5 V tolerant at all. The Pico 2 (RP2350) tolerates 5 V on its digital pins only while the board is powered, and never on the ADC pins.

The pins

Hold the Pico with the USB socket at the top. Pin 1 is top left, pins run down the left side to 20, then continue from 21 at the bottom right up to 40 at the top right. The table lists them in that order, so each row is one pair of pins facing each other across the board.

Power Ground GPIO / signal Control

Also used forFunctionPinPinFunctionAlso used for
UART0 TXGP0140VBUSUSB 5 V
UART0 RXGP1239VSYS1.8–5.5 V in
GND338GND
GP24373V3_ENLow turns 3.3 V off
GP35363V3(OUT)3.3 V out
I²C0 SDAGP4635ADC_VREFADC reference
I²C0 SCLGP5734GP28ADC2
GND833AGNDAnalogue ground
GP6932GP27ADC1
GP71031GP26ADC0
GP81130RUNReset when pulled low
GP91229GP22
GND1328GND
GP101427GP21
GP111526GP20
GP121625GP19SPI0 TX
GP131724GP18SPI0 SCK
GND1823GND
GP141922GP17SPI0 CSn
GP152021GP16SPI0 RX

Almost every GPIO pin can do I²C, SPI, UART or PWM. The "also used for" column shows the defaults in Raspberry Pi's C/C++ SDK. Other choices work too, and the RP2040 and RP2350 datasheets list them all. In MicroPython, always pass the pin numbers you wired, for example I2C(0, sda=Pin(4), scl=Pin(5)), rather than relying on defaults.

The pins you can't see

A few GPIOs aren't on the header because the board uses them itself. On the Pico and Pico 2, GP25 drives the on-board LED, GP24 detects USB power, GP29 measures VSYS through a divider, and GP23 controls the power supply's mode. On the Pico W and Pico 2 W, the LED is wired to the wireless chip instead. In MicroPython, Pin("LED", Pin.OUT) works on all of them.

Powering the Pico

  • VBUS (pin 40) is the 5 V from the USB socket. Use it to power 5 V parts while the Pico is plugged in.
  • VSYS (pin 39) is the main input, accepting 1.8 to 5.5 V. Power the Pico from batteries here, for example 3 AA cells. It's fed from VBUS through a diode, so USB and a battery can both be connected.
  • 3V3(OUT) (pin 36) is the regulated 3.3 V output. Use it for 3.3 V sensors. Raspberry Pi recommends keeping the load under about 300 mA.
  • 3V3_EN (pin 37) turns the 3.3 V supply, and so the whole Pico, off when pulled to ground.
  • RUN (pin 30) resets the chip when pulled to ground. A push button from RUN to GND makes a handy reset button.

Analogue inputs

GP26, GP27 and GP28 are analogue inputs ADC0 to ADC2. The ADC is 12 bit, and MicroPython's read_u16() scales the reading to 0 to 65,535 across 0 to 3.3 V. For cleaner readings, use AGND (pin 33) as the ground for analogue sensors. Our guide to ADCs covers noise, reference voltages and averaging.

Current limits

Each GPIO pin has a programmable drive strength of 2, 4, 8 or 12 mA, and 4 mA is the default. Treat GPIO pins as signals: a small LED through a resistor is fine, but switch anything bigger with a transistor.

from machine import Pin
import time

led = Pin("LED", Pin.OUT)   # works on Pico, Pico W, Pico 2 and Pico 2 W
while True:
    led.toggle()
    time.sleep(0.5)

Sources

The main references behind this guide. Numbers we worked out ourselves, such as the code outputs, come from running the code.