The Raspberry Pi Pico has taken the maker world by storm, offering a dual-core Arm Cortex-M0+ RP2040 microcontroller at an incredibly accessible price point. However, transitioning from simpler boards like the Arduino Uno to the Pico requires a solid understanding of its physical and logical layout. If you are staring at the 40-pin edge-castellated module and wondering where to connect your sensors, this guide to Raspberry Pi Pico pins will demystify the GPIO mapping, power delivery constraints, and peripheral multiplexing.
The Anatomy of the Raspberry Pi Pico Pinout
The standard Raspberry Pi Pico features a 40-pin layout, utilizing edge-castellated holes that allow you to solder it directly to a PCB or plug it into a breadboard. Out of these 40 pins, 26 are multifunction GPIO (General Purpose Input/Output) pins, while the rest are dedicated to power, ground, and system control.
Physical vs. Logical Pin Numbering
One of the most common hurdles for beginners is confusing physical pin numbers with logical GPIO numbers. The Raspberry Pi Pico Datasheet outlines that physical pins are numbered 1 through 40, starting from the top left (closest to the USB port) when the board is oriented with the USB port facing up.
- Pin 1 corresponds to GP0 (GPIO 0).
- Pin 2 corresponds to GP1 (GPIO 1).
- Pin 3 is a GND (Ground) pin, not a GPIO.
- Pin 4 corresponds to GP2.
Always verify whether a tutorial or schematic is referencing the physical pin location or the logical 'GP' number. In MicroPython and C/C++ SDKs, you will exclusively use the logical GP numbers (e.g., machine.Pin(15) for physical Pin 20).
Power Delivery: VBUS, VSYS, and the 3V3_EN Trap
Misunderstanding the power pins is the fastest way to permanently damage your RP2040 chip. The Pico features a sophisticated power path managed by an onboard RT6154 buck-boost regulator.
- VBUS (Pin 40): This is the raw 5V from the micro-USB connector. It is only present when the Pico is powered via USB.
- VSYS (Pin 39): The main system input voltage. You can feed anywhere from 1.8V to 5.5V into this pin to power the board via a battery or external regulator. If powered via USB, VBUS feeds into VSYS through an ideal diode circuit.
- 3V3 (Pin 36): This is an output from the onboard regulator. It provides a stable 3.3V reference. While it can source current to external components, do not use it to power high-draw motors or large LED strips.
- 3V3_EN (Pin 37): Internally pulled high. If you pull this pin to ground, it disables the onboard 3.3V regulator, effectively shutting down the RP2040.
CRITICAL WARNING: The RP2040 is strictly a 3.3V logic device. Never inject 5V into any GP pin. Doing so will bypass the internal ESD diodes and instantly fry the silicon. If you need to interface with 5V sensors, use a logic level shifter.
Multiplexing Magic: Assigning I2C, SPI, and UART
Unlike older microcontrollers that lock specific peripherals to specific pins, the RP2040 features a highly flexible multiplexing matrix. Most GPIO pins can be mapped to one of two instances of each communication protocol (e.g., I2C0 or I2C1). However, to keep your code clean and utilize default SDK configurations, it is best to stick to standard default mappings where possible.
| Protocol | Instance | Default SDA/MOSI/TX | Default SCL/MISO/RX |
|---|---|---|---|
| I2C | I2C0 | GP4 (Pin 6) | GP5 (Pin 7) |
| I2C | I2C1 | GP26 (Pin 31) | GP27 (Pin 32) |
| SPI | SPI0 | GP19 (Pin 25) MISO | GP18 (Pin 24) SCK |
| SPI | SPI1 | GP12 (Pin 16) MISO | GP10 (Pin 14) SCK |
| UART | UART0 | GP0 (Pin 1) TX | GP1 (Pin 2) RX |
| UART | UART1 | GP4 (Pin 6) TX | GP5 (Pin 7) RX |
For a complete matrix of alternate pin functions, refer to the RP2040 Hardware Design Guide, which details every possible muxing combination for the PIO (Programmable I/O) and standard peripherals.
Analog to Digital Conversion (ADC) Limitations
The Raspberry Pi Pico includes a 12-bit Successive Approximation Register (SAR) ADC. However, the implementation has specific quirks that beginners must account for in their circuit design.
- Channels: There are 4 external ADC channels (ADC0 to ADC3) mapped to GP26, GP27, GP28, and GP29 (Physical pins 31, 32, 34, and 35).
- Internal Temperature Sensor: ADC4 is internally routed to the RP2040's temperature sensor.
- Reference Voltage: The ADC relies on the 3.3V rail as its reference. Any noise on the 3.3V line will directly corrupt your analog readings.
- Resolution Reality: While marketed as 12-bit (4096 steps), the bottom 4 bits are often noisy. For high-precision applications, it is common practice to oversample and bit-shift, or use an external dedicated ADC like the ADS1115 over I2C.
The Pico W Gotcha: Repurposed Pins for Wireless
If you are using the Raspberry Pi Pico W (the variant with Wi-Fi and Bluetooth), you must be aware that several standard GPIO pins are hijacked to communicate with the onboard Infineon CYW43439 wireless chip. This is a frequent source of frustration when porting code from a standard Pico to a Pico W.
- GP25 (Pin 30): On the original Pico, this is the onboard user LED. On the Pico W, GP25 is repurposed as the SPI Chip Select for the wireless chip. The user LED is instead controlled via a GPIO on the Infineon chip itself.
- GP23 (Pin 29): This pin is used to control the power enable line to the wireless chip. Pulling it low will shut off Wi-Fi/Bluetooth.
- GP29 / ADC3 (Pin 34): This pin is utilized for the wireless SPI MISO line and to monitor the VSYS voltage via an internal resistor divider. Using ADC3 for external analog sensors on a Pico W will result in erratic readings.
For visual learners mapping these differences, the Adafruit Pico Pinouts Guide provides excellent color-coded diagrams comparing the original and W variants.
Common Beginner Mistakes and Hardware Protection
To ensure your Raspberry Pi Pico survives the prototyping phase, keep these electrical limits in mind:
1. Exceeding Bank Current Limits
The RP2040 GPIO pins are divided into four power banks: QSPI, USB, GPIO0-14, and GPIO15-29. While a single pin can technically source up to 12mA (4mA is recommended for signal integrity), the absolute maximum total current for any single bank is 50mA. If you connect ten LEDs to GP0 through GP9 and draw 5mA from each, you will hit the 50mA bank limit, causing voltage sags, erratic behavior, or permanent silicon damage.
2. Backpowering the USB Port
Never feed 5V into the VBUS pin (Pin 40) while simultaneously connecting the micro-USB cable to a PC. The Pico lacks a hardware mechanism to prevent backpowering the USB host, which can destroy your computer's USB port or motherboard. Always use VSYS (Pin 39) for external 5V power sources.
3. Floating Inputs
Leaving a GPIO pin configured as an input without a pull-up or pull-down resistor while it is connected to a long, unshielded wire acts as an antenna. It will pick up electromagnetic interference (EMI), causing phantom interrupts and erratic logic states. Always enable internal pull resistors in your MicroPython or C++ initialization code.
Next Steps for Your RP2040 Project
Understanding the Raspberry Pi Pico pins is the foundational step toward building robust embedded systems. Start by blinking the LED using logical GP numbers, move on to reading an analog potentiometer via ADC0, and finally, interface with an I2C OLED display using the default I2C0 mapping. By respecting the 3.3V logic threshold and managing your bank current limits, your RP2040 boards will provide years of reliable DIY service.






