In this guide, you’ll find the XIAO RP2040 pinout diagram, its datasheet and schematic diagram, and every pin group explained with its default pins and gotchas. It’s the complete Seeed XIAO RP2040 pinout reference (sold as the Seeed Studio XIAO RP2040, and still called the Seeeduino XIAO RP2040 by many shops) that you need before wiring your first project. Without further ado, let’s get right into it!
The XIAO RP2040 is Seeed Studio’s thumb-sized board built on the Raspberry Pi RP2040, the same chip as the Raspberry Pi Pico: a dual-core Arm Cortex-M0+ at up to 133MHz with 264KB SRAM and 2MB of flash. On a 21 × 17.8mm board, it gives you 11 GPIO pins (all 3.3v), 4 analog inputs, a USB-C port, a 3-colour user LED, and a NeoPixel RGB LED.
XIAO RP2040 Pinout Diagram
Here is a detailed XIAO RP2040 Pinout Diagram with colored labels and legends to help you easily identify the functionalities that each pin can perform. It shows all 14 edge pins with their XIAO names (D0–D10), the RP2040 GPIO numbers, and each pin’s ADC, PWM, UART, SPI and I2C functions, plus the SWD, RUN and VIN pads on the back.
Each row shows the XIAO pin number, the pin name used in the Arduino core (D0, A1…), the RP2040 GPIO number, and its functions, color-coded by peripheral. The square symbol means every pin is 3.3v only, the PWM symbol means every I/O can output PWM, and the numbered badges point to the notes at the bottom right of the diagram.
With the USB-C connector at the top, the left edge runs from D0 (pin 1) down to D6 (pin 7), and the right edge runs from D7 (pin 8, bottom) up to 5V (pin 14, top), counter-clockwise like Seeed’s own pin numbering. The pads are castellated, so you can solder the board flat onto a PCB, and the two rows are 15.24mm (600 mil) apart, so it fits a breadboard with headers. The XIAO RP2040 Plus has the same 14 edge pins; its 15 extra pads and battery pads aren’t on this diagram.
Buy a XIAO RP2040: If you don’t have one yet, you can get the genuine Seeed Studio board from Amazon or AliExpress. It drops into any XIAO expansion board, and it’s the cheapest way to get an RP2040 into a tiny project.
Download XIAO RP2040 Pinout Diagram (Full Resolution)
The XIAO RP2040 pinout diagram (edge pins, back-side pads, power, MCU and notes panels) in full resolution (5120×2600 px WebP), in one ZIP file. Print it, zoom in, or keep it next to your bench. Please consider supporting my work if it helped you.
XIAO RP2040 Datasheet
This development board is built around the Raspberry Pi RP2040 microcontroller (QFN-56). So the XIAO RP2040 datasheet set has two parts: Seeed Studio’s documents for the board, and Raspberry Pi’s for the chip. Here are the official documents you’ll need, linked to their original sources:
| Document | Source | Revision | What You’ll Use It For | Link |
|---|---|---|---|---|
| XIAO RP2040 wiki (getting started + specs) | Seeed Studio | online | Board specs, pin map, LEDs, Arduino and MicroPython setup | Web |
| XIAO RP2040 schematic | Seeed Studio | v1.3 (2022-05-24) | The full board circuit (see the next section) | |
| XIAO RP2040 KiCad files | Seeed Studio | v1.3 (package 2026-03-04) | Schematic and PCB source, footprint for your own carrier board | ZIP |
| XIAO RP2040 pinout sheet | Seeed Studio | online | Seeed’s pin-by-pin function list | XLSX |
| RP2040 datasheet (with errata) | Raspberry Pi | RP-008371-DS, build 2025-02-20 | GPIO functions, electrical limits, ADC, PWM, every peripheral, and the errata (appendix) | |
| Hardware design with RP2040 | Raspberry Pi | latest | Reference circuit for the flash, crystal, USB and power | |
| Arduino-Pico XIAO RP2040 variant | Earle Philhower (GitHub) | master | The Arduino pin names (D0–D10, LED_BUILTIN, PIN_NEOPIXEL, Wire, SPI) | Web |
Which document do I need? The Seeed wiki for setup and the pin list, the schematic for what’s connected to each pin, and the RP2040 datasheet for the pin functions (its GPIO function table), the electrical limits, and register-level details. Seeed’s wiki links its own copy of the RP2040 datasheet; the Raspberry Pi link above always gets you the latest build.
XIAO RP2040 Schematic
The XIAO RP2040 schematic is Seeed Studio’s Seeed Studio XIAO RP2040 v1.3 drawing, dated 2022-05-24 (EAGLE; v1.1 and v1.2 changed only the LEDs). All the circuitry is on one sheet, so here is the full sheet followed by close-ups of each block; click a page to view it full screen.
Official source: the XIAO RP2040 schematic v1.3 (PDF) from the Seeed Studio wiki. Here’s what to look at:
- USB input and the 5V pin: USB-C VBUS has a DF2S6.8FS ESD diode (D1) to ground and goes straight to the 5V edge pin. There’s no fuse and no diode between the connector and that pin.
- Schottky diode and VIN: VBUS then passes through the NRS0320 Schottky diode (D2) to the VIN net, which is the VIN pad on the back. Anything you feed into VIN can’t flow back into USB.
- 3.3v regulator: an RS3236-3.3 LDO (U4) turns VIN into the 3.3v rail for the RP2040, the flash, the LEDs and the 3V3 pin. It’s rated 500mA with an input up to 7.5v. Seeed’s wiki calls it a “DC-DC converter”, but it’s a linear regulator, so the extra voltage turns into heat.
- RP2040 and flash: the RP2040 (U6) runs from a 12MHz crystal (X3) and boots from a GD25Q16 2MB QSPI flash (U3). USB D+/D− go through 27Ω resistors and a pair of ESD diodes (D6, D8) to the USB-C connector; there’s no USB-UART chip. ADC_AVDD is tied straight to the 3.3v rail, with no ADC_VREF pin.
- BOOT button: B pulls QSPI_CS to GND through 1kΩ, which tells the RP2040’s ROM to start the USB bootloader instead of the flash program.
- LEDs and RESET: the 3-colour user LED is common-anode on 3.3v, with its cathodes on GPIO17 (red, 4.7kΩ), GPIO16 (green, 11kΩ) and GPIO25 (blue, 2.2kΩ), so LOW turns it on. The red power LED sits on 3.3v through 1kΩ. RESET pulls RUN to GND (10kΩ pull-up, 100nF), and RUN is also a back pad (TP1).
- NeoPixel: the WS2812 RGB LED (RGB1) gets its data from GPIO12 and its VCC from GPIO11 (net NEO_PWR), so the LED is dark until your code drives GPIO11 HIGH.
Note: Seeed’s back-side pinout image swaps the two bottom pads: it calls the left pad “VBUS” and the right pad “GND”. The silkscreen and Seeed’s own KiCad PCB file say the opposite: the left pad is GND and the right pad is VIN, the regulator input after the Schottky diode (not VBUS). Go by the silkscreen.
If you plan to put an RP2040 on your own PCB, my Raspberry Pi Pico (RP2040) Schematic & PCB Design in KiCAD tutorial walks through the same flash, crystal and USB circuit.
XIAO RP2040 Specs
The XIAO RP2040 is the smallest RP2040 board in the XIAO family. Here are its specifications, including the board-level parts that chip-only spec lists usually skip.

Get a XIAO RP2040: The genuine Seeed Studio board is the one I recommend. Grab it from Amazon or AliExpress.
| Item | XIAO RP2040 |
|---|---|
| MCU | Raspberry Pi RP2040 (QFN-56) |
| CPU | Dual-core Arm Cortex-M0+, up to 133MHz |
| Memory | 264KB SRAM, 2MB QSPI flash (GD25Q16) on the board |
| Logic level | 3.3v on every pin, not 5v tolerant (max 3.3v + 0.5v on a pin) |
| GPIO pins | 11 (D0–D10), on 14 castellated edge pads |
| Analog inputs | 4 (A0–A3), 12-bit, 500ksps |
| Board supply | USB-C 5v, the 5V pin, or the VIN pad on the back |
| 3.3v regulator | RS3236-3.3 LDO: 500mA, input up to 7.5v |
| Pin current | 4mA default drive (2/4/8/12mA settable), 50mA total for all GPIOs |
| Clock | 12MHz crystal |
| USB connector | USB-C to the RP2040’s USB 1.1 (device and host); no USB-UART chip |
| Buttons and LEDs | BOOT, RESET, 3-colour user LED (active LOW), WS2812 NeoPixel, red power LED |
| Debug | SWD on the back pads (SWCLK, SWDIO, RUN, GND) |
| Size | 21 × 17.8mm, XIAO form factor, surface-mountable |
| Seeed SKU | 102010428 |
| No | battery charger, DAC, Wi-Fi/Bluetooth, 5v-tolerant pins, ADC_VREF pin |
XIAO RP2040 Specifications Summary
- The XIAO RP2040 runs a dual-core RP2040 at up to 133MHz with 264KB SRAM and 2MB flash.
- It has 11 GPIOs (D0–D10), and every pin is 3.3v only: none of them is 5v tolerant.
- Each GPIO drives 4mA by default (up to 12mA), and all of them together must stay under 50mA.
- It has 4 ADC pins: A0–A3 on D0–D3 (GPIO26–GPIO29). The ADC reference is the 3.3v rail; there’s no VREF pin.
- All 11 GPIOs can output PWM, on 6 of the RP2040’s 8 PWM slices.
- The I2C pins are D4 (SDA) and D5 (SCL), and they’re I2C1 (not I2C0) in the RP2040: I2C(1, sda=Pin(6), scl=Pin(7)) in MicroPython.
- Serial1 is D6 (TX) / D7 (RX); SPI is D8 (SCK), D9 (MISO), D10 (MOSI).
- The NeoPixel data pin is GPIO12, and GPIO11 must be HIGH to power it.
- The user LED pins are GPIO17 (red, LED_BUILTIN), GPIO16 (green) and GPIO25 (blue), all active LOW.
- The 5V pin is raw USB VBUS. Batteries and other supplies go on the VIN pad on the back, after the diode.
- The 3V3 pin comes from a 500mA RS3236 LDO, shared with the board itself.
- Hold B (BOOT) while plugging in USB to get the RPI-RP2 drive and drop a .uf2 file.
XIAO RP2040 Peripherals: RP2040 vs On the Pins
The RP2040 has a fixed pin map: each GPIO has one UART, one SPI, one I2C and one PWM function (Table 279 of the datasheet), plus the PIO blocks that can drive any pin. This table shows what the chip has and what you can actually reach on the XIAO edge.
| Peripheral | RP2040 | On the XIAO RP2040 |
|---|---|---|
| GPIO | 30 GPIOs | 11 (D0–D10) |
| ADC | 12-bit SAR, 500ksps, 4 inputs + temperature sensor | all 4 inputs (A0–A3) |
| PWM | 8 slices × 2 channels = 16 outputs | 11 pins on 6 slices |
| UART | 2 | UART0 on D6/D7 (or D2/D3); UART1 TX only (D9) |
| SPI | 2 | SPI0 on D8–D10 (+ D7 as CSn); SPI1 on D0–D3 |
| I2C | 2 | I2C1 on D4/D5 (also D0/D1, D8/D10); I2C0 on D6/D7 or D2/D3 |
| PIO | 2 blocks, 8 state machines | any pin (extra UARTs, WS2812, DVI…) |
| USB | USB 1.1 device/host | USB-C connector only |
| SWD | 2-wire debug | back pads SWCLK, SWDIO |
| DAC / Wi-Fi | none | – |
XIAO RP2040 Quick Pin Selection Guide
Not sure which pin to use? Here are the XIAO RP2040 pins I’d pick first for each job, and why.
| Use Case | Recommended Pins | Why |
|---|---|---|
| Serial to the PC | USB-C (Serial) | USB CDC on the RP2040’s own USB |
| Serial to a module (GPS, GSM…) | D7 (RX), D6 (TX) | UART0, the Arduino Serial1 pins |
| I2C sensors and displays | D4 (SDA), D5 (SCL) | The Arduino Wire pins (I2C1), same place on every XIAO |
| SPI devices | D8 (SCK), D9 (MISO), D10 (MOSI), CS on D7 or any pin | SPI0, the Arduino SPI pins |
| Analog inputs | A0, A1, A2, A3 | The only ADC pins (D0–D3) |
| PWM (LEDs, servos) | D9, then D4/D5 or D8/D10 | D9 has a slice to itself; pairs share a frequency |
| WS2812 / NeoPixel strip | D10 or any free pin | PIO drives them on any GPIO |
| On-board LED | GPIO17 / 16 / 25 (LOW = on) | No wiring needed |
| Debugging | SWCLK, SWDIO back pads | SWD with a Raspberry Pi Debug Probe |
| Safest general GPIO | D4, D5, D8, D9, D10 | No ADC, no shared on-board load |
XIAO RP2040 Pins to Use With Caution
| Pin | Reason | What to Do |
|---|---|---|
| All pins | 3.3v only, not 5v tolerant | Level-shift every 5v signal |
| All pins together | 50mA total GPIO current; 4mA default drive per pin | Drive relays, motors and LED strips through a transistor or driver |
| D4 / D5 | I2C1 in hardware; Seeed’s docs say I2C0 | Use I2C1 (bus 1) outside the Arduino core |
| D6 / D7 | Same PWM channels (0A/0B) as the green/red user LED | Only matters when both run PWM at once |
| D1 / D2 | Share PWM channels 5B/6A with NeoPixel power (GPIO11) and data (GPIO12) | Avoid PWM on D1/D2 while you use the NeoPixel in PWM-heavy code |
| A0–A3 | ADC reference = 3.3v rail, no VREF; RP2040-E11 errata | Average readings; use an I2C ADC for precision |
| 5V | Raw USB VBUS, no diode or fuse | Never feed 5v here with USB plugged in; use VIN instead |
| VIN pad | Linear regulator: dropout and heat | Feed 3.8v–5.5v for a solid 3.3v; never with USB attached |
XIAO RP2040 Pin Numbering: XIAO Pins vs GPIO Numbers
The XIAO RP2040 has three numbering systems on the same pins: the XIAO pin number (1–14, physical), the XIAO name (D0–D10), and the RP2040 GPIO number. In the Arduino-Pico core, a bare number is always the GPIO number, so digitalWrite(6, HIGH) drives GPIO6 = D4, not D6. MicroPython, CircuitPython’s board.GP names, and the Pico SDK use GPIO numbers too.
| XIAO Pin | XIAO Name | GPIO (Arduino-Pico Number) | MicroPython | XIAO Pin | XIAO Name | GPIO (Arduino-Pico Number) | MicroPython |
|---|---|---|---|---|---|---|---|
| 1 | D0 / A0 | GPIO26 | Pin(26) | 8 | D7 / RX | GPIO1 | Pin(1) |
| 2 | D1 / A1 | GPIO27 | Pin(27) | 9 | D8 / SCK | GPIO2 | Pin(2) |
| 3 | D2 / A2 | GPIO28 | Pin(28) | 10 | D9 / MISO | GPIO4 | Pin(4) |
| 4 | D3 / A3 | GPIO29 | Pin(29) | 11 | D10 / MOSI | GPIO3 | Pin(3) |
| 5 | D4 / SDA | GPIO6 | Pin(6) | 12 | 3V3 | – | – |
| 6 | D5 / SCL | GPIO7 | Pin(7) | 13 | GND | – | – |
| 7 | D6 / TX | GPIO0 | Pin(0) | 14 | 5V | – | – |
The safe habit is to write the pin names ( D4, A0, LED_BUILTIN) in Arduino sketches: the seeed_xiao_rp2040 variant of the Arduino-Pico core defines them all, so your code reads the same as the silkscreen. Older Seeed tutorials used a different, Mbed-based Arduino package (“Seeed XIAO RP2040” on the Arduino Mbed OS core), where the Serial and pin names don’t match Arduino-Pico. Seeed’s wiki now uses Earle Philhower’s Arduino-Pico core, and so does this guide.
XIAO RP2040 Pins Functions
The 14 edge pins of the XIAO RP2040 (plus the back pads) are divided into the following groups based on the hardware functionality they’re used for. Since every RP2040 GPIO has a UART, SPI, I2C and PWM function, most pins belong to several groups at once.
- Power Pins: 5V, 3V3, GND, and the VIN pad
- 11x Digital GPIO Pins (all can be interrupts)
- 4x ADC Analog Input Pins
- 11x PWM Pins
- UART Pins (+ USB CDC)
- I2C Pins
- SPI Pins
- LED & NeoPixel Pins
- SWD & Boot Pins
We’ll discuss each pin group in the following sections one by one in more detail.
XIAO RP2040 Power Pins
The XIAO RP2040 is powered from the USB-C port (5v), from the 5V pin, or from the VIN pad on the back. The 3V3 pin is the RS3236 regulator’s output, and the 5V pin is the raw USB VBUS line. The power pins are highlighted in red in the pinout diagram.

| Pin | XIAO Pin | Range | Notes |
|---|---|---|---|
| 5V | 14 | 5v in/out | USB VBUS before the Schottky diode: 5v out on USB power; no fuse |
| 3V3 | 12 | 3.3v out | RS3236 LDO output, 500mA shared with the RP2040, flash and LEDs |
| GND | 13 | 0v | Plus the two GND pads on the back |
| VIN | back pad | up to 7.5v (RS3236 input) | Regulator input after the Schottky diode; battery or external supply |
How to power the XIAO RP2040 from a battery? There’s no charger on this board (that’s the XIAO RP2040 Plus). Solder your supply to the VIN and GND pads at the bottom of the back side. Because VIN sits after the Schottky diode, the battery can’t push current back into USB, but Seeed still says not to connect USB while a battery is connected. Three AA cells (4.5v) or a 5v power bank cable work well.
A single 3.7v LiPo works too, but only at light loads. The RS3236 needs some headroom above 3.3v (about 0.6v at its full 500mA), so as the cell drains below about 3.8v, the 3.3v rail sags with it. The board keeps working a little below 3.3v (the flash chip needs 2.7v), so it’s fine for low-current projects, not for loads near 500mA.
Note: The 5V pin is wired straight to the USB-C connector’s VBUS, with no diode and no fuse. Feeding 5v into it while USB is plugged in back-feeds your PC’s USB port. Use the VIN pad for an external supply, or put a Schottky diode in series with your supply on the 5V pin.
XIAO RP2040 GPIO Pins
The XIAO RP2040 has 11 GPIO pins: D0–D10 (GPIO0–GPIO4, GPIO6, GPIO7, and GPIO26–GPIO29). They all work at 3.3v, and none of them is 5v tolerant. Every one of them can be a digital input, a digital output, a PWM output, or an interrupt source.

Each GPIO can be an input (floating, or with its internal pull-up or pull-down) or an output, with a programmable drive strength. Here are the electrical limits (RP2040 datasheet RP-008371-DS):
- Logic level 3.3v; never apply more than 3.3v + 0.5v to any pin.
- Drive strength per pin: 2mA, 4mA, 8mA or 12mA, with 4mA by default. The RP2040 does its best to hold the pin HIGH or LOW at that current; a bigger load just pulls the voltage away.
- All GPIOs together must stay under 50mA of source or sink current. So an LED at 10mA on each of the 11 pins is already too much.
- Every GPIO can trigger an interrupt: attachInterrupt(digitalPinToInterrupt(D2), isr, FALLING) works on any of the 11 pins.
- The GPIOs you don’t see: GPIO11/12 (NeoPixel), GPIO16/17/25 (user LED); GPIO5, GPIO8–10, GPIO13–15 and GPIO18–24 aren’t connected at all.
To get more than 4mA from a pin in the Arduino-Pico core, call the Pico SDK function, which the core includes:
|
1 2 3 4 5 6 7 |
void setup() { pinMode(D10, OUTPUT); gpio_set_drive_strength(D10, GPIO_DRIVE_STRENGTH_12MA); // 2, 4 (default), 8 or 12mA digitalWrite(D10, HIGH); } void loop() {} |
Learn more in our Raspberry Pi Pico GPIO Tutorial.
Also Read
XIAO RP2040 ADC Pins
The XIAO RP2040 has 4 ADC pins: A0 (D0), A1 (D1), A2 (D2) and A3 (D3), which are GPIO26–GPIO29, the RP2040’s four external ADC inputs. The ADC is 12-bit at up to 500ksps, and its reference is the board’s 3.3v rail. The ADC pins are highlighted in green in the pinout diagram.

| Pin | GPIO | ADC Channel | MicroPython |
|---|---|---|---|
| A0 / D0 | GPIO26 | ADC0 | ADC(0) or ADC(Pin(26)) |
| A1 / D1 | GPIO27 | ADC1 | ADC(1) |
| A2 / D2 | GPIO28 | ADC2 | ADC(2) |
| A3 / D3 | GPIO29 | ADC3 | ADC(3) |
In the Arduino-Pico core, analogRead() returns 10-bit values (0–1023) by default; call analogReadResolution(12) for the full 0–4095 range (Arduino-Pico analog docs). Unlike the Raspberry Pi Pico, the XIAO RP2040 has no ADC_VREF pin: the RP2040’s ADC_AVDD is tied straight to the 3.3v rail, so the reference moves with the LDO output and picks up its noise.
Note: The RP2040 ADC has a known non-linearity (erratum RP2040-E11): codes near 512, 1536, 2560 and 3584 are wider than the rest, so the real resolution is about 8.7 effective bits. Average several readings, and use an external I2C ADC (ADS1115) when you need precision. There’s no way to add an external reference on this board (Seeed forum).
There are so many sensors that we can read with the ADC pins, which include: potentiometers, LDRs, NTC thermistors, soil moisture sensors, joysticks, battery dividers, and much more.
XIAO RP2040 PWM Pins
All 11 GPIO pins on the XIAO RP2040 can output PWM. The RP2040 has 8 PWM slices with two channels each (A and B), and every GPIO is hard-wired to one channel. The two channels of a slice share the same frequency but keep their own duty cycle. The PWM pins are highlighted in the pinout diagram.

XIAO RP2040 PWM Pins: D0–D10, on 6 slices.
| Pin | GPIO | PWM Channel | Shares the Slice With |
|---|---|---|---|
| D0 / D1 | GPIO26 / GPIO27 | 5A / 5B | each other; 5B is also GPIO11 (NeoPixel power) |
| D2 / D3 | GPIO28 / GPIO29 | 6A / 6B | each other; 6A is also GPIO12 (NeoPixel data) |
| D4 / D5 | GPIO6 / GPIO7 | 3A / 3B | each other |
| D6 / D7 | GPIO0 / GPIO1 | 0A / 0B | each other; also GPIO16 / GPIO17 (green / red LED) |
| D8 / D10 | GPIO2 / GPIO3 | 1A / 1B | each other |
| D9 | GPIO4 | 2A | nothing on the board |
In the Arduino-Pico core, analogWrite(D9, 128) just works (8-bit by default, 1kHz). Use analogWriteFreq() and analogWriteRange() to change the frequency and resolution. For two outputs at different frequencies, pick pins on different slices, for example D9 and D4.
Note: Pins on the same channel output the same signal. D6 and the green user LED (GPIO16) are both channel 0A, so if you run PWM on D6 and also on the green LED, they can’t have different duty cycles. The same goes for D1 and the NeoPixel power pin (5B), and D2 and the NeoPixel data pin (6A). It only matters when both pins are in PWM mode at the same time.
There are so many things that we can control with PWM, which include: LED dimming, RGB LEDs, DC motor speed (with a driver), servo motors, buzzers, and much more.
XIAO RP2040 UART Pins
The XIAO RP2040 has one fully usable hardware UART on the edge: UART0 on D6 (TX) and D7 (RX), which is Serial1 in the Arduino-Pico core. Serial is the USB-C port (USB CDC). UART1 only has its TX on the edge (D9), so Serial2 isn’t pinned out. The UART pins are highlighted in blue in the pinout diagram.

XIAO RP2040 Default UART Pins: D6 (TX) and D7 (RX) for Serial1.
| Port | Arduino Object | TX Pin | RX Pin | Note |
|---|---|---|---|---|
| USB CDC | Serial | USB-C | USB-C | The Serial Monitor port |
| UART0 | Serial1 | D6 (GPIO0) | D7 (GPIO1) | Default pins |
| UART0 (alternate) | Serial1 | D2 (GPIO28) | D3 (GPIO29) | Set with setTX()/setRX() before begin() |
| UART1 | Serial2 | D9 (GPIO4) | – | No RX on the edge; use PIO SerialPIO for a 2nd port |
To move Serial1, call setTX() and setRX() before begin(), and only with pins that really are UART0 pins (Arduino-Pico Serial docs):
|
1 2 3 4 5 6 7 8 9 10 11 |
void setup() { Serial.begin(115200); // USB-C to the PC Serial1.setTX(D2); // GPIO28 = UART0 TX Serial1.setRX(D3); // GPIO29 = UART0 RX Serial1.begin(9600); } void loop() { while (Serial1.available()) Serial.write(Serial1.read()); // module -> PC while (Serial.available()) Serial1.write(Serial.read()); // PC -> module } |
Note: An invalid pin in setTX()/ setRX() (one that isn’t a UART0 pin) makes the core panic, and the USB port disappears from your PC with it (arduino-pico discussion). If that happens, hold B while plugging in USB and upload a fixed sketch.
There are so many modules that we can interface with the UART pins, which include: GPS modules, GSM/LTE modules, fingerprint sensors, RS485 transceivers, DFPlayer Mini, other microcontrollers, and much more.
Learn more in our Raspberry Pi Pico Serial Over USB Tutorial.
XIAO RP2040 I2C Pins
The XIAO RP2040 I2C pins are D4 (SDA) and D5 (SCL), the same place as on every XIAO board, so Grove and XIAO expansion boards work out of the box. In the RP2040, GPIO6 and GPIO7 belong to I2C1, not I2C0. The I2C pins are highlighted in yellow in the pinout diagram.

XIAO RP2040 Default I2C Pins: D4 (SDA) and D5 (SCL), on I2C1.
| Signal | Pin | GPIO | RP2040 Controller |
|---|---|---|---|
| SDA | D4 | GPIO6 | I2C1 |
| SCL | D5 | GPIO7 | I2C1 |
| SDA / SCL (alternate) | D6 / D7 or D2 / D3 | GPIO0/1, GPIO28/29 | I2C0 |
Seeed’s wiki and its front pinout image label D4/D5 as “SDA0/SCL0”, which sends a lot of people to the wrong controller (Seeed forum, Klipper forum). The Arduino-Pico core already maps Wire to I2C1 on D4/D5, so Wire.begin() just works. Outside Arduino, ask for bus 1:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
// Arduino-Pico: Wire = I2C1 on D4 (SDA) / D5 (SCL) #include <Wire.h> void setup() { Serial.begin(115200); Wire.begin(); delay(2000); for (uint8_t a = 1; a < 127; a++) { // simple I2C scanner Wire.beginTransmission(a); if (Wire.endTransmission() == 0) Serial.printf("Found 0x%02X\n", a); } } void loop() {} // MicroPython: i2c = I2C(1, sda=Pin(6), scl=Pin(7)) // Pico SDK: i2c_init(i2c1, 400000); gpio_set_function(6, GPIO_FUNC_I2C); |
Note: There are no I2C pull-up resistors on the XIAO RP2040, so add 4.7kΩ pull-ups to 3.3v (not 5v) unless your module already has them. Most breakout boards do.
There are so many modules and sensors that we can interface with the I2C bus, which include: OLED displays (SSD1306), RTC modules (DS3231), IMUs (MPU6050), BME280 sensors, port expanders, and much more.
XIAO RP2040 SPI Pins
The XIAO RP2040 default SPI pins are D8 (SCK), D9 (MISO) and D10 (MOSI) on the RP2040’s SPI0. The core’s SS isn’t pinned out, so choose your own CS pin (D7 is SPI0’s hardware CSn). A second port, SPI1, is on D0–D3. The SPI pins are highlighted in pink in the pinout diagram.

XIAO RP2040 Default SPI Pins: D8 (SCK), D9 (MISO), and D10 (MOSI), with CS on a pin you choose.
| Signal | SPI0 (Arduino SPI) | GPIO | SPI1 (alternate) |
|---|---|---|---|
| SCK | D8 | GPIO2 | D0 (GPIO26) |
| MISO (RX) | D9 | GPIO4 | D2 (GPIO28) |
| MOSI (TX) | D10 | GPIO3 | D1 (GPIO27) |
| CS | any pin (D7 = CSn) | GPIO1 | D3 (GPIO29) |
With SPI1 on the ADC pins, you trade analog inputs for a second SPI bus, which is handy when a display and an SD card need separate buses. There are so many modules that we can interface with the SPI bus, which include: TFT displays (ST7789, GC9A01), SD card modules, LoRa radios (SX1276), nRF24L01 radios, MAX7219 LED drivers, and much more.
XIAO RP2040 LED & NeoPixel Pins
The XIAO RP2040 has a 3-colour user LED on GPIO17 (red), GPIO16 (green) and GPIO25 (blue), and a WS2812 NeoPixel with its data on GPIO12 and its power on GPIO11. None of them is on an edge pin. In the Arduino-Pico core, LED_BUILTIN is 17 (red), PIN_NEOPIXEL is 12, and NEOPIXEL_POWER is 11.
| LED | GPIO | Arduino Name | On When |
|---|---|---|---|
| User LED red | GPIO17 | LED_BUILTIN, PIN_LED_R | LOW |
| User LED green | GPIO16 | PIN_LED_G | LOW |
| User LED blue | GPIO25 | PIN_LED_B | LOW |
| NeoPixel data | GPIO12 | PIN_NEOPIXEL | WS2812 protocol |
| NeoPixel power | GPIO11 | NEOPIXEL_POWER | HIGH = powered |
| Power LED (red) | 3.3v rail | – | Always on |
The user LED is common-anode, so it’s active LOW: digitalWrite(LED_BUILTIN, LOW) turns it on, the opposite of a Pico or an Arduino UNO. The three colours also have different resistors, so green looks dimmer than red and blue.
The NeoPixel stays dark until GPIO11 is HIGH, because GPIO11 is its supply. That’s the number one “my NeoPixel doesn’t work” problem on this board, and some reviews even give the wrong power pin (GPIO10). Here’s a working sketch with the Adafruit NeoPixel library:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#include <Adafruit_NeoPixel.h> Adafruit_NeoPixel pixel(1, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800); // data = GPIO12 void setup() { pinMode(NEOPIXEL_POWER, OUTPUT); digitalWrite(NEOPIXEL_POWER, HIGH); // GPIO11 powers the LED pixel.begin(); pixel.setBrightness(40); } void loop() { pixel.setPixelColor(0, pixel.Color(255, 0, 0)); pixel.show(); delay(500); pixel.setPixelColor(0, pixel.Color(0, 0, 255)); pixel.show(); delay(500); } |
Tip: In MicroPython, do the same with Pin(11, Pin.OUT).value(1) and neopixel.NeoPixel(Pin(12), 1). If the NeoPixel still stays dark, check that nothing in your code drives GPIO11 LOW again (Seeed forum).
XIAO RP2040 SWD & Boot Pins
The XIAO RP2040 has its SWD debug pins on the back: SWCLK and SWDIO, with RUN (reset) and GND next to them, near the USB-C connector. The B (BOOT) and R (RESET) buttons on the front start the USB bootloader and reset the chip.
| Pad / Button | Signal | Use |
|---|---|---|
| SWCLK pad (TP3) | RP2040 SWCLK | SWD clock |
| SWDIO pad (TP5) | RP2040 SWDIO | SWD data |
| RUN pad (TP1) | RUN (10kΩ pull-up) | Reset: LOW = chip in reset |
| GND pads | GND | Probe ground |
| B button | QSPI_CS to GND via 1kΩ | Hold at power-up or reset = USB bootloader (RPI-RP2) |
| R button | RUN to GND | Reset |
Seen from the back with USB-C at the top, the SWD pads form a 2×2 group: SWCLK (left) and SWDIO (right) on top, GND (left) and RUN (right) below them. Solder thin wires to them and connect a Raspberry Pi Debug Probe, a second Pico running debugprobe (picoprobe), or a J-Link, then debug with OpenOCD and GDB, or from VS Code with the Raspberry Pi Pico extension.
XIAO RP2040 Bootloader Steps (RPI-RP2)
The RP2040’s USB bootloader lives in its ROM, so it can’t be erased: whatever your sketch did, these steps always bring the XIAO RP2040 back (Seeed forum):
- Hold B (BOOT) and plug in the USB cable, or hold B and tap R.
- Release B. A USB drive named RPI-RP2 appears on your PC.
- Drop a .uf2 file on it (MicroPython, CircuitPython, or a compiled sketch), or simply upload from the Arduino IDE: it finds the drive by itself.
Note: During every Arduino upload, the COM port disappears and the RPI-RP2 drive shows up for a moment: the core reboots the board into the bootloader to flash it. That’s normal. If the IDE then can’t find a port at all, pick the “UF2 Board” port, or use the steps above once.
Getting Started With XIAO RP2040
You can program the XIAO RP2040 with the Arduino IDE, MicroPython, CircuitPython, the Pico SDK (C/C++), PlatformIO, TinyGo, Rust or Zephyr, all over the USB-C cable. No external programmer is needed.
- Arduino IDE: add https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json to the Boards Manager URLs, install “Raspberry Pi Pico/RP2040” by Earle F. Philhower, then select Seeed XIAO RP2040.
- MicroPython / CircuitPython: flash the XIAO RP2040 (or generic RP2040) build through the RPI-RP2 drive and use the GPIO numbers: Pin(17) is the red LED.
- Pico SDK (C/C++): use PICO_BOARD=seeed_xiao_rp2040, which sets up the right flash and the LED pins.
- PlatformIO: the Arduino-Pico core through the community “raspberrypi” platform fork, board seeed_xiao_rp2040.
| Arduino Name | Pin | Default |
|---|---|---|
Serial | USB-C | USB CDC |
Serial1 | D6 (TX), D7 (RX) | UART0 |
Wire | D4 (SDA), D5 (SCL) | I2C1 |
SPI | D8 / D9 / D10 | SPI0; choose your own CS |
A0–A3 | D0–D3 | ADC0–ADC3 (10-bit by default) |
LED_BUILTIN | GPIO17 | Red user LED, active LOW |
PIN_NEOPIXEL / NEOPIXEL_POWER | GPIO12 / GPIO11 | WS2812 data / power |
Since the XIAO RP2040 runs the same chip and core as the Raspberry Pi Pico, almost every Pico tutorial applies to it: just swap in the XIAO pin names, and remember that the Pico’s LED on GPIO25 is the blue (active LOW) LED here.
Also Read
XIAO RP2040 Common Problems & Fixes
Why doesn’t my I2C sensor respond? D4/D5 are I2C1. In MicroPython or the Pico SDK, use bus 1 ( I2C(1, sda=Pin(6), scl=Pin(7))). In Arduino, update the Arduino-Pico core (old versions had a wrong variant) and check the pull-ups.
Why does my NeoPixel stay dark? Drive GPIO11 HIGH first: it powers the LED. The data pin is GPIO12.
Why is the LED on when I write LOW? The 3-colour user LED is common-anode on 3.3v, so it’s active LOW. That’s by design.
Why did the COM port disappear? During an upload it’s normal. If it doesn’t come back, your sketch probably crashed (an invalid Serial1 pin, for example): hold B while plugging in USB and upload again.
Why are my analog readings noisy? The ADC reference is the 3.3v rail (no VREF pin), and the RP2040 has the E11 non-linearity. Average readings, add a 100nF cap on the input, or use an I2C ADC.
Can I power it from a LiPo? Yes, on the VIN pad (not the 5V pin), with no USB attached. There’s no charger, and the LDO’s dropout limits it to light loads as the cell drains.
Is the XIAO RP2040 5v tolerant? No. Every pin is 3.3v only. Use a level shifter or a divider for 5v signals.
Why don’t the pin names from an old tutorial work? It was written for the Mbed-based Seeed package. With Arduino-Pico, use D0–D10 or the GPIO numbers from the table above.
XIAO RP2040 vs XIAO RP2040 Plus vs XIAO RP2350 vs Raspberry Pi Pico
The XIAO RP2040 has three close relatives: Seeed’s XIAO RP2040 Plus (same chip, more pads and a charger), Seeed’s XIAO RP2350 (the newer chip in the same footprint), and the Raspberry Pi Pico (same chip, bigger board). Here’s how they compare:
| Feature | XIAO RP2040 | XIAO RP2040 Plus | XIAO RP2350 | Raspberry Pi Pico |
|---|---|---|---|---|
| MCU | RP2040, 2× M0+ 133MHz | RP2040, 2× M0+ 133MHz | RP2350, 2× M33 150MHz | RP2040, 2× M0+ 133MHz |
| SRAM / flash | 264KB / 2MB | 264KB / 2MB | 520KB / 2MB | 264KB / 2MB |
| GPIO | 11 | 26 (15 extra pads) | 19 (8 back pads) | 26 |
| ADC pins | 4 (A0–A3) | 4 | 3 on the edge | 3 (+ VREF pin) |
| Battery charger | No | Yes | Yes | No |
| 5v-tolerant pins | No | No | Yes (non-ADC, when powered) | No |
| I2C on D4/D5 | I2C1 (Wire) | I2C1 | I2C1 (Wire1) | – |
| Size | 21 × 17.8mm | 21 × 17.8mm | 21 × 17.8mm | 51 × 21mm |
Pick the XIAO RP2040 for the smallest, cheapest RP2040 build, especially on a XIAO expansion board. Pick the Plus when you need more pins or a LiPo charger in the same footprint, the XIAO RP2350 for more RAM, speed and 5v-tolerant pins, and the Pico when you want 26 GPIOs on a breadboard and an ADC_VREF pin. For the Pico’s pins, check out my Raspberry Pi Pico & Pico W Pinout Guide.
XIAO RP2040 Pin Details
Here is every XIAO RP2040 pin in physical order, with its GPIO, main functions, all its RP2040 functions, and a short description. With the USB-C connector at the top, pin 1 (D0) is the top-left pad, pins 1–7 run down the left edge, and pins 8–14 run up the right edge.
Click to expand the full pin table (18 pins)
| Pin | Label | GPIO | Main Functions | All Alternate Functions | 5v Tolerant | Description |
|---|---|---|---|---|---|---|
| 1 | D0 / A0 | GPIO26 | ADC0 | PWM5 A, SPI1 SCK, UART1 CTS, I2C1 SDA | No (3.3v) | Analog input A0, or a digital pin; shares PWM slice 5 with D1. |
| 2 | D1 / A1 | GPIO27 | ADC1 | PWM5 B, SPI1 TX, UART1 RTS, I2C1 SCL | No (3.3v) | Analog input A1; its PWM channel is the same as the NeoPixel power pin (GPIO11). |
| 3 | D2 / A2 | GPIO28 | ADC2 | PWM6 A, SPI1 RX, UART0 TX, I2C0 SDA | No (3.3v) | Analog input A2 and an alternate UART0 TX; PWM channel shared with the NeoPixel data pin. |
| 4 | D3 / A3 | GPIO29 | ADC3 | PWM6 B, SPI1 CSn, UART0 RX, I2C0 SCL | No (3.3v) | Analog input A3 and an alternate UART0 RX. |
| 5 | D4 / SDA | GPIO6 | I2C1 SDA (Wire) | PWM3 A, SPI0 SCK, UART1 CTS | No (3.3v) | The default I2C data pin, on I2C1 (not I2C0). |
| 6 | D5 / SCL | GPIO7 | I2C1 SCL (Wire) | PWM3 B, SPI0 TX, UART1 RTS | No (3.3v) | The default I2C clock pin, on I2C1. |
| 7 | D6 / TX | GPIO0 | UART0 TX (Serial1) | PWM0 A, SPI0 RX, I2C0 SDA | No (3.3v) | Serial1 transmit; same PWM channel as the green user LED. |
| 8 | D7 / RX | GPIO1 | UART0 RX (Serial1) | PWM0 B, SPI0 CSn, I2C0 SCL | No (3.3v) | Serial1 receive, and SPI0’s hardware CS; same PWM channel as the red user LED. |
| 9 | D8 / SCK | GPIO2 | SPI0 SCK | PWM1 A, UART0 CTS, I2C1 SDA | No (3.3v) | The default SPI clock pin. |
| 10 | D9 / MISO | GPIO4 | SPI0 RX (MISO) | PWM2 A, UART1 TX, I2C0 SDA | No (3.3v) | The default SPI data-in pin, with a PWM slice to itself. |
| 11 | D10 / MOSI | GPIO3 | SPI0 TX (MOSI) | PWM1 B, UART0 RTS, I2C1 SCL | No (3.3v) | The default SPI data-out pin; a good free pin for an LED or a NeoPixel strip. |
| 12 | 3V3 | – | 3.3v output | – | – | RS3236 regulator output, 500mA shared with the board. |
| 13 | GND | – | Ground | – | – | Ground. |
| 14 | 5V | – | USB VBUS | – | – | 5v straight from the USB-C connector, before the diode; no fuse. |
| back | SWCLK / SWDIO | – | SWD | – | – | Serial Wire Debug pads for a debug probe. |
| back | RUN | – | Reset | – | – | Pull LOW to reset the RP2040, like the R button. |
| back | VIN | – | Supply input | – | – | Regulator input after the Schottky diode: battery or external supply. |
| back | GND (×2) | – | Ground | – | – | Ground pads next to SWD and next to VIN. |
Every GPIO also has the SIO function (plain digital I/O) and the PIO0/PIO1 functions, so the PIO state machines can drive any of the 11 pins.
Wrap Up
To conclude this guide article, the XIAO RP2040 is a very solid board for small projects that need a fast, cheap, well-supported microcontroller. It gives you a dual-core 133MHz RP2040, 11 GPIOs, 4 analog inputs, and two programmable LEDs on a board the size of your thumbnail. Just remember the board-level gotchas: every pin is 3.3v only, D4/D5 are I2C1, the NeoPixel needs GPIO11 HIGH, the user LED is active LOW, and the 5V pin is raw USB VBUS.
I hope you’ve found this guide helpful for your project. For more boards, check out the Pinouts, Datasheets & Schematic Diagrams Library. Follow this Raspberry Pi Pico Series of Tutorials to learn more about programming RP2040 boards.
If you’re just getting started with the RP2040, you need to check out the Raspberry Pi Pico Getting Started Ultimate Guide below.
The complete beginner’s guide to the Raspberry Pi Pico and the RP2040: setting up MicroPython, your first project, and the Pico tutorials series step by step.




