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 |
|---|---|---|---|
| 1 | GP0 | UART0 TX / SPI0 RX | I2C0 SDA (requires pull-up) |
| 2 | GP1 | UART0 RX / SPI0 CSn | I2C0 SCL |
| 3 | GND | Ground Reference | Common return path |
| 4 | GP2 | I2C1 SDA / SPI0 SCK | Default I2C1 bus |
| 5 | GP3 | I2C1 SCL / SPI0 TX | Default I2C1 bus |
| 6 | GP4 | I2C0 SDA / SPI0 RX | Default I2C0 bus |
| 7 | GP5 | I2C0 SCL / SPI0 CSn | Default I2C0 bus |
| 8 | GND | Ground Reference | |
| 9 | GP6 | I2C1 SDA / SPI0 SCK | General Digital I/O |
| 10 | GP7 | I2C1 SCL / SPI0 TX | General Digital I/O |
| 11 | GP8 | I2C0 SDA / SPI1 RX | General Digital I/O |
| 12 | GP9 | I2C0 SCL / SPI1 CSn | General Digital I/O |
| 13 | GND | Ground Reference | |
| 14 | GP10 | I2C1 SDA / SPI1 SCK | General Digital I/O |
| 15 | GP11 | I2C1 SCL / SPI1 TX | General Digital I/O |
| 16 | GP12 | I2C0 SDA / SPI1 RX | General Digital I/O |
| 17 | GP13 | I2C0 SCL / SPI1 CSn | General Digital I/O |
| 18 | GND | Ground Reference | |
| 19 | GP14 | I2C1 SDA / SPI1 SCK | General Digital I/O |
| 20 | GP15 | I2C1 SCL / SPI1 TX | General Digital I/O |
| 21 | GP16 | SPI0 RX / I2C0 SDA | Default SPI0 MISO |
| 22 | GP17 | SPI0 CSn / I2C0 SCL | Default SPI0 CS |
| 23 | GND | Ground Reference | |
| 24 | GP18 | SPI0 SCK / I2C1 SDA | Default SPI0 SCK |
| 25 | GP19 | SPI0 TX / I2C1 SCL | Default SPI0 MOSI |
| 26 | GP20 | SPI0 RX / I2C0 SDA | General Digital I/O |
| 27 | GP21 | SPI0 CSn / I2C0 SCL | General Digital I/O |
| 28 | GND | Ground Reference | |
| 29 | GP22 | SPI0 SCK / I2C1 SDA | General Digital I/O |
| 30 | RUN | Reset / Enable | Pull low to reset RP2040 |
| 31 | GP26 (ADC0) | Analog Input 0 / I2C1 SDA | 12-bit ADC, 3.3V max |
| 32 | GP27 (ADC1) | Analog Input 1 / I2C1 SCL | 12-bit ADC, 3.3V max |
| 33 | AGND | Analog Ground | Use for ADC sensor returns |
| 34 | GP28 (ADC2) | Analog Input 2 / SPI1 RX | 12-bit ADC, 3.3V max |
| 35 | ADC_VREF | ADC Reference Voltage | Internally tied to 3.3V |
| 36 | 3V3 OUT | 3.3V Regulated Output | Max ~300mA draw safe |
| 37 | 3V3 EN | Enable 3.3V SMPS | Pull low to disable rail |
| 38 | GND | Ground Reference | |
| 39 | VSYS | System Input (2V-5.5V) | External battery/power input |
| 40 | VBUS | USB 5V Input | Tied 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
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.
- 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.
- 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.
- 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.
- 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.
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.






