Loading the figure…
RP2040 or RP2350 on a 21 x 51 mm stick: MicroPython, PIO and, on the W boards, Wi-Fi
Each lesson runs your own code on the board. Finish its checks to tick it off.
Build the board in the right order, then power it up and check it, as on the bench.
0 of 10 stepsA Pico is a single-sided board: every part sits on the top side and is soldered by reflow in the factory. Strip it to the bare PCB to see the copper, the castellated edge and the footprints.
Each fault really happens in the simulation. Trigger one, watch the figure, then read why.
Raspberry Pi's own microcontroller boards. The Pico carries an RP2040 (two Arm Cortex-M0+ cores up to 133 MHz, 264 KB SRAM) with 2 MB of QSPI flash; the Pico 2 carries an RP2350 (two Cortex-M33 or two Hazard3 RISC-V cores at 150 MHz, 520 KB SRAM) with 4 MB. The W versions add an Infineon CYW43439 Wi-Fi and Bluetooth radio under a metal can, with a printed antenna at the far end. All four share one 21 x 51 mm outline with 40 castellated pins on a 2.54 mm grid, a micro-USB socket wired straight into the chip (there is no USB-serial bridge), a BOOTSEL button and a single green LED. A buck-boost regulator makes 3.3 V from anything between 1.8 and 5.5 V on VSYS. Every GPIO runs at 3.3 V; only the RP2350's digital pins tolerate 5 V, and only while the board is powered. There is no reset button and no power LED: a board with a blank flash lights nothing and shows up as a USB drive.
| Header | Pin | Name | Functions | Level | Max current | Notes |
|---|---|---|---|---|---|---|
| edge | 1 | GP0 | UART0 TX, I2C0 SDA, SPI0 RX, PWM0A, PIO | 3.3 V | 12 mA | UART0 TX by default: MicroPython's UART(0) and the C SDK's stdio use GP0 and GP1. |
| edge | 2 | GP1 | UART0 RX, I2C0 SCL, SPI0 CSn, PWM0B, PIO | 3.3 V | 12 mA | UART0 RX by default. |
| edge | 3 | GND | – | – | – | |
| edge | 4 | GP2 | I2C1 SDA, SPI0 SCK, PWM1A, PIO | 3.3 V | 12 mA | |
| edge | 5 | GP3 | I2C1 SCL, SPI0 TX, PWM1B, PIO | 3.3 V | 12 mA | |
| edge | 6 | GP4 | UART1 TX, I2C0 SDA, SPI0 RX, PWM2A, PIO | 3.3 V | 12 mA | I2C0 SDA on the SDK's default pins; the I2C lesson uses it. |
| edge | 7 | GP5 | UART1 RX, I2C0 SCL, SPI0 CSn, PWM2B, PIO | 3.3 V | 12 mA | I2C0 SCL on the SDK's default pins. |
| edge | 8 | GND | – | – | – | |
| edge | 9 | GP6 | I2C1 SDA, SPI0 SCK, PWM3A, PIO | 3.3 V | 12 mA | |
| edge | 10 | GP7 | I2C1 SCL, SPI0 TX, PWM3B, PIO | 3.3 V | 12 mA | |
| edge | 11 | GP8 | UART1 TX, I2C0 SDA, SPI1 RX, PWM4A, PIO | 3.3 V | 12 mA | |
| edge | 12 | GP9 | UART1 RX, I2C0 SCL, SPI1 CSn, PWM4B, PIO | 3.3 V | 12 mA | |
| edge | 13 | GND | – | – | – | |
| edge | 14 | GP10 | I2C1 SDA, SPI1 SCK, PWM5A, PIO | 3.3 V | 12 mA | |
| edge | 15 | GP11 | I2C1 SCL, SPI1 TX, PWM5B, PIO | 3.3 V | 12 mA | |
| edge | 16 | GP12 | UART0 TX, I2C0 SDA, SPI1 RX, PWM6A, PIO | 3.3 V | 12 mA | |
| edge | 17 | GP13 | UART0 RX, I2C0 SCL, SPI1 CSn, PWM6B, PIO | 3.3 V | 12 mA | |
| edge | 18 | GND | – | – | – | |
| edge | 19 | GP14 | I2C1 SDA, SPI1 SCK, PWM7A, PIO | 3.3 V | 12 mA | The button in the lessons: wired to GND with the internal pull-up, pressed reads 0. |
| edge | 20 | GP15 | I2C1 SCL, SPI1 TX, PWM7B, PIO | 3.3 V | 12 mA | The external LED in the lessons, through 330 Ω to GND. Any GPIO can make PWM; this one is PWM slice 7, channel B. |
| edge | 21 | GP16 | UART0 TX, I2C0 SDA, SPI0 RX, PWM0A, PIO | 3.3 V | 12 mA | |
| edge | 22 | GP17 | UART0 RX, I2C0 SCL, SPI0 CSn, PWM0B, PIO | 3.3 V | 12 mA | |
| edge | 23 | GND | – | – | – | |
| edge | 24 | GP18 | I2C1 SDA, SPI0 SCK, PWM1A, PIO | 3.3 V | 12 mA | |
| edge | 25 | GP19 | I2C1 SCL, SPI0 TX, PWM1B, PIO | 3.3 V | 12 mA | |
| edge | 26 | GP20 | UART1 TX, I2C0 SDA, SPI0 RX, PWM2A, PIO | 3.3 V | 12 mA | |
| edge | 27 | GP21 | UART1 RX, I2C0 SCL, SPI0 CSn, PWM2B, PIO | 3.3 V | 12 mA | |
| edge | 28 | GND | – | – | – | |
| edge | 29 | GP22 | I2C1 SDA, SPI0 SCK, PWM3A, PIO | 3.3 V | 12 mA | |
| edge | 30 | RUN | RUN (reset, active low) | 3.3 V | – | Chip enable with an internal pull-up of about 50 kΩ. Short it to GND to reset the chip: the board has no reset button, so wire a push button from RUN to GND. |
| edge | 31 | GP26_A0 | ADC0, I2C1 SDA, SPI1 SCK, PWM5A, PIO | 3.3 V | 12 mA | ADC0. Analog input pins have a diode to 3.3 V and must stay below about 3.6 V on every board, including the RP2350 ones. |
| edge | 32 | GP27_A1 | ADC1, I2C1 SCL, SPI1 TX, PWM5B, PIO | 3.3 V | 12 mA | ADC1. 12-bit, read as 0-65535 with read_u16() in MicroPython. |
| edge | 33 | AGND | Analog ground | – | – | Analog ground for the ADC pins: return a potentiometer or sensor here for cleaner readings. |
| edge | 34 | GP28_A2 | ADC2, UART0 TX, I2C0 SDA, SPI1 RX, PWM6A, PIO | 3.3 V | 12 mA | ADC2. |
| edge | 35 | ADC_VREF | ADC reference | 3.3 V | – | ADC reference: the 3.3 V rail through a 200 Ω, 2.2 µF filter. It is noisy; an external 3.0 V reference can be fitted here. |
| edge | 36 | 3V3 | 3.3 V out | 3.3 V | 300 mA | 3.3 V out from the buck-boost for sensors and modules, under 300 mA. Never feed 5 V into it. |
| edge | 37 | 3V3_EN | SMPS enable | 4.7 V | – | Enable of the 3.3 V regulator, pulled up to VSYS through 100 kΩ. Tie it to GND and the whole board switches off. |
| edge | 38 | GND | – | – | – | |
| edge | 39 | VSYS | 1.8-5.5 V in / out | 4.7 V | – | 1.8 to 5.5 V in (a battery) or about 4.7 V out when the board runs from USB. Not reverse-protected. |
| edge | 40 | VBUS | USB 5 V | 5 V | – | USB 5 V out when the cable is in, 0 V otherwise. A 5 V supply wired here powers the board through D1. |
| DEBUG | 1 | SWCLK | SWD clock | 3.3 V | – | Serial Wire Debug pads (SWCLK, GND, SWDIO): a Raspberry Pi Debug Probe or a second Pico running debugprobe connects here for breakpoints. They are dedicated debug pins, not GPIOs. |
| DEBUG | 2 | GND | – | – | – | |
| DEBUG | 3 | SWDIO | SWD data | 3.3 V | – |
Sensors and actuators this board drives, with the real connections.
A 5 mm LED from GP15 through a 330 Ω resistor to GND: (3.3 - 2.0) / 330 ≈ 4 mA for a red LED, within the pin's default 4 mA drive.
| Part pin | Board pin |
|---|---|
| A | GP15Wire colour orange |
| K | GNDWire colour black |
Never leave out the resistor: the pin would try to drive far more than 12 mA.
A 6 x 6 mm button from GP14 to GND with Pin.PULL_UP: it reads 0 while pressed. Straddle the breadboard's centre gap.
| Part pin | Board pin |
|---|---|
| 1 | GP14Wire colour yellow |
| 3 | GNDWire colour black |
On early Pico 2 boards (RP2350 A2) do not rely on the internal pull-down: erratum E9 lets the pin float high.
A 10 kΩ potentiometer: one end to 3V3 (pin 36), the other to AGND (pin 33), the wiper to GP26 / ADC0.
| Part pin | Board pin |
|---|---|
| 1 | 3V3Wire colour red |
| 2 | GP26Wire colour yellow |
| 3 | AGNDWire colour black |
Never put 5 V on the ends: the ADC pins take 3.3 V at most on every Pico.
A light-dependent resistor from 3V3 to GP27 with a 10 kΩ resistor from GP27 to GND: brighter light, higher reading.
| Part pin | Board pin |
|---|---|
| 1 | 3V3Wire colour red |
| 2 | GP27Wire colour yellow |
The TMP36 runs from 2.7 V up, so 3V3 is fine: Vout on GP28 reads 0.75 V at 25 °C, 10 mV per degree.
| Part pin | Board pin |
|---|---|
| +Vs | 3V3Wire colour red |
| Vout | GP28Wire colour yellow |
| GND | AGNDWire colour black |
A passive piezo on GP18 and GND, driven with PWM: pwm.freq(440) plays an A.
| Part pin | Board pin |
|---|---|
| + | GP18Wire colour orange |
| - | GNDWire colour black |
SG90 signal on GP16 with PWM at 50 Hz (a 0.5 to 2.4 ms pulse), power from VBUS (5 V from USB) and a shared GND.
| Part pin | Board pin |
|---|---|
| signal | GP16Wire colour orange |
| V+ | VBUSWire colour red |
| GND | GNDWire colour brown |
Never power a servo from 3V3: its stall current pulls the 3.3 V rail down and the Pico resets. Use VBUS on USB or a separate 5 V supply with a common ground.
A GY-521 MPU-6050 breakout on I2C0: SDA to GP4, SCL to GP5, VCC to 3V3. Its address is 0x68 (0x69 with AD0 high).
| Part pin | Board pin |
|---|---|
| VCC | 3V3Wire colour red |
| GND | GNDWire colour black |
| SCL | GP5Wire colour yellow |
| SDA | GP4Wire colour blue |
A 0.96 inch SSD1306 OLED on I2C0 (GP4 and GP5) at address 0x3C, powered from 3V3. MicroPython needs the ssd1306 driver from micropython-lib (mip.install("ssd1306")).
| Part pin | Board pin |
|---|---|
| GND | GNDWire colour black |
| VCC | 3V3Wire colour red |
| SCL | GP5Wire colour yellow |
| SDA | GP4Wire colour blue |
Read the header's silkscreen: some modules are GND VCC SCL SDA, others VCC GND SCL SDA.
The HC-SR04 needs 5 V: VCC to VBUS, TRIG to GP16 (3.3 V is enough to trigger it), ECHO to GP17 through a divider (1 kΩ in series, 2 kΩ to GND) so the 5 V echo arrives as 3.3 V.
| Part pin | Board pin |
|---|---|
| VCC | VBUSWire colour red |
| TRIG | GP16Wire colour orange |
| ECHO | GP17Wire colour yellow |
| GND | GNDWire colour black |
ECHO is a 5 V output. Straight into an RP2040 pin it drives current through the pin's protection diode into the 3.3 V rail and damages the chip. The RP2350's GPIO tolerate it while powered, but keep the divider.