If you are wiring sensors, motors, or displays to a Raspberry Pi Pico, guessing pin functions or mixing up regional wiring color standards will lead to fried logic levels and silent I2C failures. The RP2040 chip is highly flexible—almost any GPIO can be mapped to almost any peripheral—but that flexibility is a trap if you don't establish a hard standard for your bench.

This guide gives you the exact pi pico pinout data, translates regional wiring color codes for your peripheral harnesses, and provides a concrete decision tree to lock in your GPIO assignments.

The Complete Pi Pico Pinout Reference (40-Pin DIP)

The standard Raspberry Pi Pico (and Pico W) uses a 40-pin DIP footprint. Below is the functional map. Note that while the RP2040 allows multiplexing, these are the hardware-default and optimal assignments for clean PCB routing and standard breadboard layouts.

Pin # GPIO / Label Primary Function Alternative / Notes
1GP0UART0 TX / SPI0 RXI2C0 SDA (requires pull-up)
2GP1UART0 RX / SPI0 CSnI2C0 SCL
3GNDGround ReferenceCommon return path
4GP2I2C1 SDA / SPI0 SCKDefault I2C1 bus
5GP3I2C1 SCL / SPI0 TXDefault I2C1 bus
6GP4I2C0 SDA / SPI0 RXDefault I2C0 bus
7GP5I2C0 SCL / SPI0 CSnDefault I2C0 bus
8GNDGround Reference
9GP6I2C1 SDA / SPI0 SCKGeneral Digital I/O
10GP7I2C1 SCL / SPI0 TXGeneral Digital I/O
11GP8I2C0 SDA / SPI1 RXGeneral Digital I/O
12GP9I2C0 SCL / SPI1 CSnGeneral Digital I/O
13GNDGround Reference
14GP10I2C1 SDA / SPI1 SCKGeneral Digital I/O
15GP11I2C1 SCL / SPI1 TXGeneral Digital I/O
16GP12I2C0 SDA / SPI1 RXGeneral Digital I/O
17GP13I2C0 SCL / SPI1 CSnGeneral Digital I/O
18GNDGround Reference
19GP14I2C1 SDA / SPI1 SCKGeneral Digital I/O
20GP15I2C1 SCL / SPI1 TXGeneral Digital I/O
21GP16SPI0 RX / I2C0 SDADefault SPI0 MISO
22GP17SPI0 CSn / I2C0 SCLDefault SPI0 CS
23GNDGround Reference
24GP18SPI0 SCK / I2C1 SDADefault SPI0 SCK
25GP19SPI0 TX / I2C1 SCLDefault SPI0 MOSI
26GP20SPI0 RX / I2C0 SDAGeneral Digital I/O
27GP21SPI0 CSn / I2C0 SCLGeneral Digital I/O
28GNDGround Reference
29GP22SPI0 SCK / I2C1 SDAGeneral Digital I/O
30RUNReset / EnablePull low to reset RP2040
31GP26 (ADC0)Analog Input 0 / I2C1 SDA12-bit ADC, 3.3V max
32GP27 (ADC1)Analog Input 1 / I2C1 SCL12-bit ADC, 3.3V max
33AGNDAnalog GroundUse for ADC sensor returns
34GP28 (ADC2)Analog Input 2 / SPI1 RX12-bit ADC, 3.3V max
35ADC_VREFADC Reference VoltageInternally tied to 3.3V
363V3 OUT3.3V Regulated OutputMax ~300mA draw safe
373V3 ENEnable 3.3V SMPSPull low to disable rail
38GNDGround Reference
39VSYSSystem Input (2V-5.5V)External battery/power input
40VBUSUSB 5V InputTied to USB VBUS

Peripheral Wiring Color Codes: IEC vs. NEC vs. Maker Standards

When building wire harnesses for your Pico projects, mixing up regional electrical standards with low-voltage maker standards is a fast track to shorting 5V into a 3.3V GPIO. Here is how to interpret wire colors based on the standard you are following.

IEC 60446 (EU/UK Control Circuits)

In European industrial control panels and IEC-compliant DC wiring, Brown is the positive supply (VCC/L+) and Blue is the negative return (GND/L-). If you are buying industrial NPN/PNP sensors (like Omron or Sick) to wire to your Pico's GPIOs, they will almost universally use Brown for VCC and Blue for GND. Warning: Industrial sensors often output 12V or 24V. You must use an optocoupler or logic-level MOSFET before connecting these to the Pico's 3.3V GPIOs.

NEC / US Low-Voltage Adaptation

While the NEC primarily governs AC mains, US low-voltage HVAC and automotive adaptations frequently use Red for VCC (Hot/Positive) and Black for GND (Neutral/Negative). If you are salvaging PC fans or US-market 5V peripherals, expect Red/Black power pairs.

The 'Maker' Standard (Adafruit / SparkFun Qwiic)

For direct 3.3V logic wiring on the breadboard, the hobbyist industry has standardized on a specific color map for data lines to prevent I2C/SPI cross-wiring:

  • Red: VCC / VIN (3.3V or 5V)
  • Black: GND
  • Blue: I2C SDA / UART RX
  • Yellow: I2C SCL / UART TX
  • Green: SPI MOSI / Data
  • Orange: SPI SCK / Clock
Bench Rule: Always adopt the Maker Standard for the data lines on your Pico breadboard. Reserve Brown/Blue strictly for external 12V/24V sensor power feeds to create a hard visual boundary between safe 3.3V logic and hazardous industrial voltages.

The 'Rows People Get Wrong' Trap

Even with the datasheet in hand, these specific pin assignments trip up experienced engineers moving from Arduino or ESP32 ecosystems.

1. The Pico W 'Stolen' Pins (GP23, GP24, GP25, GP29)

If you are using the Raspberry Pi Pico W (the board with the CYW43439 Wi-Fi/Bluetooth chip), you lose access to several pins. GP23, GP24, GP25, and GP29 are internally routed to manage the Wi-Fi chip's SPI bus and VBUS detection. If you wire an external I2C sensor to GP25 on a Pico W, it will clash with the internal Wi-Fi SPI bus, causing brownouts and network stack crashes. Default to GP0-GP22 for external peripherals on the Pico W.

2. VSYS vs. VBUS (Backpowering Destruction)

Pin 40 (VBUS) is directly tied to the USB 5V line. Pin 39 (VSYS) is the input to the onboard RT6154 buck-boost converter. If you are powering the Pico from an external 3.7V LiPo battery, you must wire the battery to VSYS. If you accidentally wire 5V into VSYS while USB is also plugged in, you will back-feed the USB port and potentially fry your host computer's USB controller. The Pico has a Schottky diode to prevent USB-to-VSYS backfeed, but external-to-USB backfeed is unprotected.

3. ADC Digital Noise on GP26-GP28

Pins 31, 32, and 34 double as ADC0, ADC1, and ADC2. If you use these for analog readings, do not route high-frequency PWM or SPI clock traces on the adjacent PCB layer. The RP2040 ADC is notoriously susceptible to digital crosstalk. Always use Pin 33 (AGND) as the ground return for your analog sensors, not the standard digital GND pins.

Faded Silk? How to Safely Identify Unmarked Pico Pins

After months of reflow soldering, breadboard friction, and flux cleaning, the white silkscreen on your Pico will fade or rub off entirely. Guessing pin 1 orientation will instantly short 5V VBUS into a 3.3V GPIO, killing the RP2040. Here is the safe recovery procedure.

  1. Orient via USB: Hold the board with the micro-USB connector pointing UP, away from you. Pin 1 is the top-left corner. Pin 40 is the top-right corner.
  2. Verify Pin 1 Pad Shape: Look closely at the copper pads. Pin 1 is the only pad on the left rail that is square. All other left-rail pads are round.
  3. Multimeter Continuity Check: Set your meter to continuity. Probe Pin 3 (top left, third down). It should beep to the USB connector's metal shield (Ground). If it doesn't, your board orientation is flipped.
  4. Verify 3.3V OUT: Power the board via USB. Set your meter to DC Volts. Probe Pin 36 (bottom right, fifth up from the bottom). It must read exactly 3.28V to 3.35V. If you read 5V, you are probing VBUS (Pin 40) and your orientation is reversed.
Safety Check: Never apply external power to VSYS until you have verified the GND pin with a continuity test. A reversed LiPo connection will instantly destroy the onboard RT6154 voltage regulator.

Pin Selection Decision Tree: Pick Your Exact GPIO

Stop debating which pins to use in your code. Use this decision path to lock in your hardware assignments. Follow the logic down to your concrete default.

Peripheral Need Decision Condition Concrete GPIO Pick
I2C Sensors (BME280, OLED) Need default hardware I2C0 with standard breakout board wiring? GP4 (SDA) & GP5 (SCL)
SPI Displays (ILI9341, ST7789) Need maximum DMA throughput for screen rendering? GP16 (MISO), GP17 (CS), GP18 (SCK), GP19 (MOSI)
UART Debug (GPS, ESP-01) Need hardware UART0 that doesn't conflict with default I2C? GP0 (TX) & GP1 (RX)
Analog Sensors (Potentiometers, NTC) Need 12-bit ADC without digital PWM interference? GP26 (ADC0) & GP27 (ADC1) (Use AGND for return)
PWM Motors (Servos, DC via H-Bridge) Need 8 independent PWM channels without slice overlap? GP2, GP4, GP6, GP8, GP10, GP12, GP14, GP16 (One per slice A)
Onboard LED Using standard Pico (RP2040)? GP25
Onboard LED Using Pico W (RP2040 + Wi-Fi)? WL_GPIO0 (Accessed via CYW43 library, not standard GPIO)

By standardizing on these exact GPIO assignments, your hardware designs remain compatible across standard Pico, Pico W, and custom RP2040 PCB spins. For complete electrical characteristics and timing diagrams, always cross-reference the official Raspberry Pi Pico Datasheet and the Pico Series Hardware Documentation.