Skip to main content

Getting Started with Seeed Studio XIAO RP2040

pir

Overview

The Seeed Studio XIAO RP2040 series includes the XIAO RP2040 and the XIAO RP2040 Plus. Both boards are powered by the same Raspberry Pi RP2040 microcontroller, which features a dual-core Arm Cortex-M0+ processor running at up to 133 MHz and 264 KB of SRAM. Each board also includes 2 MB of onboard Flash memory. As a result, they deliver the same core processing performance and share the same RP2040 software ecosystem.

The main differences between the two boards are the number of exposed GPIOs, the available peripheral connections, and the onboard power-management features.

The standard XIAO RP2040 uses the common 14-pin XIAO footprint, consisting of 11 GPIO pins and three power pins. Its 11 digital I/O pins are PWM-capable, with four also supporting analog input. The board provides I2C, UART, SPI, and SWD interfaces in a compact 21 × 17.8 mm form factor.

The XIAO RP2040 Plus retains the same common 14-pin XIAO layout and adds 15 GPIO solder pads on the back and sides of the board. This increases the total number of exposed digital I/O pins from 11 to 26. It also adds a second I2C interface, dedicated USB D+/D− pads, and battery-related connections including BAT+, BAT−, and BAT_EN.

For battery-powered applications, the XIAO RP2040 Plus integrates an onboard PMIC, a battery charging indicator, and BAT-to-3V3 backflow protection. These additional features make the Plus version better suited for custom carrier boards, SMD assembly, battery-powered devices, and projects that require more I/O resources.

Seeed Studio XIAO RP2040 is compatible to the Seeed Studio XIAO expansion board.

Features

  • Powerful RP2040 MCU: Dual-core Arm Cortex-M0+ processor running at up to 133 MHz
  • Rich memory resources: 264 KB of SRAM and 2 MB of onboard Flash memory
  • Broad software compatibility: Supports Arduino, PlatformIO, MicroPython, CircuitPython, TinyGo, Rust, Zephyr, and more
  • Common XIAO footprint: Both versions retain the standard 14-pin XIAO layout, including 11 GPIO pins and three power pins
  • Compact form factor: Thumb-sized 21 × 17.8 mm design for wearable devices and space-constrained applications
  • Standard XIAO RP2040 interfaces: 11 digital I/O pins, four analog input pins, 11 PWM-capable pins, I2C, UART, SPI, and SWD
  • Expanded XIAO RP2040 Plus I/O: Adds 15 GPIO pads for a total of 26 digital I/O pins, along with a second I2C interface and dedicated USB D+/D− pads
  • Integrated battery management: The XIAO RP2040 Plus includes an onboard PMIC, battery charging indication, dedicated battery connections, and BAT-to-3V3 backflow protection
  • Flexible assembly options: Breadboard-friendly common pins combined with castellated edges and SMD-compatible pads for custom carrier boards

Specification

Product NameSeeed Studio XIAO RP2040Seeed Studio XIAO RP2040 Plus
Chipset

Raspberry Pi RP2040

ProcessorDual Cortex-M0+ up to 133 MHz
RAM264 KB SRAM
Flash2 MB Onboard Flash
Interface

GPIO Pin x14
Digital Pin × 11
Analog Pin × 4
PWM Pin × 11
I2C × 1
UART × 1
SPI × 1

GPIO Pin x29
Additional GPIO Pad × 15
Digital Pin x26
Analog Pin × 4
PWM × 26
I2C × 2
UART × 1
SPI × 1

Onboard

User LED × 1
Power LED × 1
Green LED × 1
Blue LED × 1
Red LED × 1
RGB LED × 1
Reset Button × 1
Boot Button × 1

User LED × 1
Power LED × 1
Charge LED (Battery Charging Indicator) × 1
RGB LED × 1
Reset Button × 1
Boot Button × 1

Battery Management (PMIC)NoneOnboard PMIC
Power

Input Voltage (Type-C): 5V
Input Voltage (BAT): 5V

BAT-to-3V3 Backflow ProtectionNoYes
Software Compatibility

Arduino, PlatformIO, MicroPython, CircuitPython, TinyGo, Rust, Zephyr, and more to come

Working Temperature-40°C to 85°C
Dimensions21 x 17.8mm
Variants

Seeed Studio XIAO RP2040 3PCS Pack

Seeed Studio XIAO RP2040 Pre-Soldered

Seeed Studio XIAO RP2040 Plus

Hardware Overview

XIAO RP2040 Front

XIAO RP2040 Back

caution

For general I/O pins: Working voltage of MCU is 3.3V. Voltage input connected to general I/O pins may cause chip damage if it's higher than 3.3V.

For power supply pins: The built-in DC-DC converter circuit able to change 5V voltage into 3.3V allows to power the device with a 5V supply via VIN-PIN and 5V-PIN.

XIAO RP2040 currently only supports battery power supply and cannot connect to Type-C while a battery is connected, as it may pose a safety risk.

Please pay attention to use, do not lift the shield cover.

Pin Map

XIAO PinFunctionXIAO RP2040XIAO RP2040 PlusDescription
5VVBUSVBUSVBUSUSB 5 V power input/output
GNDGNDGNDGNDGround
3V33V3_OUT3V3_OUT3V3_OUT3.3 V power output
D0A0GPIO26GPIO26GPIO, ADC0
D1A1GPIO27GPIO27GPIO, ADC1
D2A2GPIO28GPIO28GPIO, ADC2
D3A3GPIO29GPIO29GPIO, ADC3
D4SDA0GPIO6GPIO6GPIO, I2C0 data
D5SCL0GPIO7GPIO7GPIO, I2C0 clock
D6TXGPIO0GPIO0GPIO, UART transmit
D7RXGPIO1GPIO1GPIO, UART receive
D8SCKGPIO2GPIO2GPIO, SPI clock
D9MISOGPIO4GPIO4GPIO, SPI data input
D10MOSIGPIO3GPIO3GPIO, SPI data output
D11Not available as an external pin
D12GPIOGPIO18Plus-only expansion GPIO
D13SCL1GPIO21Plus-only I2C1 clock
D14SDA1GPIO20Plus-only I2C1 data
D15GPIOGPIO19Plus-only expansion GPIO
D16GPIOGPIO22Plus-only expansion GPIO
D17GPIOGPIO23Plus-only expansion GPIO
D18Not available as an external pin
D19GPIOGPIO5Plus-only expansion GPIO
D20GPIOGPIO13Plus-only expansion GPIO
D21GPIOGPIO14Plus-only expansion GPIO
D22GPIOGPIO15Plus-only expansion GPIO
D23GPIOGPIO16Plus-only expansion GPIO
D24GPIOGPIO17Plus-only expansion GPIO
D25GPIOGPIO10Plus-only expansion GPIO
D26GPIOGPIO9Plus-only expansion GPIO
D27GPIOGPIO8Plus-only expansion GPIO
ResetRUNRUNRUNReset input
BootRP2040_BOOTRP2040_BOOTRP2040_BOOTEnter bootloader mode
USER_LED_RRed channelGPIO17Direct RGB LED red-channel control on XIAO RP2040
USER_LED_GGreen channelGPIO16Direct RGB LED green-channel control on XIAO RP2040
USER_LED_GBlue channelGPIO25Direct RGB LED blue-channel control on XIAO RP2040
RGB_LEDWS2812B dataGPIO12/NEOPIXSingle-wire WS2812B color data control
RGB_ENWS2812B enableGPIO11Enables WS2812B power; not a color data pin
User LEDUser-controlled LEDGPIO25Separate user LED on XIAO RP2040 Plus
BAT_ENBattery EnableGPIO24Battery power control on Plus
CHARGE_LEDCharging IndicatorHardware-controlled charging status LED; not a user GPIO
SWDIOSWD DebugSWDIORP2040_SWDIOSerial Wire Debug data
SWCLKSWD DebugSWCLKRP2040_SWCLKSerial Wire Debug clock
USB_D+USB-USB_DPUSB 1.1 Full-Speed data positive
USB_D-USB-USB_DMUSB 1.1 Full-Speed data negative

Enter Bootloader Mode

Sometimes the Seeed Studio XIAO RP2040 port may disappear when user programming process fails. We can solve this problem by the following operation:

  • Long press the B button.
  • Connect the Seeed Studio XIAO PR2040 to your computer.
  • The computer will appear a disk driver.

At this point, the chip enters Bootloader mode and the burn port appears again. Because the RP2040 chip has two partitions, one is the Bootloader and the other is the user program. The product will burn a bootloader code in the system memory when it leaves the factory. We can switch modes by performing the above steps.

Reset

If you want to reset the Seeed Studio XIAO RP2040, perform the following steps:

  • Connect the Seeed Studio XIAO RP2040 to your computer.
  • Press the R pins once.

Please note: The behavior of the built-in programmable Single-colour LEDs (They are red, blue and green) are reversed to the one on an Arduino. On the Seeed Studio XIAO RP2040, the pin has to be pulled low to enable.

pir

Battery Usage

note

Only the XIAO RP2040 Plus features a BAT battery connector on its back side, please take note.

The XIAO RP2040 Plus is capable of using a 3.7V lithium battery as the power supply input. You can refer to the following diagram for the wiring method.


caution

Please be careful not to short-circuit the positive and negative terminals and burn the battery and equipment when soldering. If the battery has power, never solder it onto the board, as this may burn out the circuit board. Short-circuiting while the circuit is powered on poses a significant risk; it is recommended to use an adapter.

Battery Voltage Reading Example

According to the schematic, the XIAO RP2040 Plus uses the SGM40567-4.2XG/TR lithium-ion battery charger IC to provide constant-current and constant-voltage charging for a single-cell lithium-ion battery. The charging status is indicated by the blinking Charge_LED.

The battery voltage measurement circuit uses a TPS22916CNYFPR load switch to enable or disable the measurement path. When the battery voltage needs to be measured, the MCU enables the measurement path through BAT_EN (GPIO24), thereby reducing battery consumption while the device is in standby mode.

In addition, an SGM4875XXDM6G/TR analog switch is used to switch the ADC input channel. Controlled by GPIO24/BAT_EN, it selects whether the battery measurement signal or another analog input signal is connected to the A3 (GPIO29) ADC pin, allowing the ADC pin to be multiplexed.

tip

When the A3 pin is used as an ADC input to measure the battery voltage, it cannot be used as a general-purpose I/O pin at the same time. Make sure to take this into account when assigning pins.


The battery voltage is measured using a resistor-divider circuit. The voltage read by the ADC is half of the actual battery voltage, so the software must multiply the ADC measurement by 2 to obtain the actual battery voltage.

Battery read example
constexpr float ADC_VREF = 3.3f;
constexpr float ADC_MAX = 4095.0f;
constexpr float DIVIDER_RATIO = 2.0f; // 10k / 10k voltage divider

float readBatteryVoltage() {
// Enable voltage divider circuit and analog switch simultaneously
digitalWrite(BAT_EN, HIGH);

// Wait for U2 output, RC filter and ADC input to stabilize
delay(10);

// Discard one possibly stale ADC reading
analogRead(A3);

// Multiple sampling and averaging to reduce noise
uint32_t sum = 0;
constexpr int samples = 16;

for (int i = 0; i < samples; i++) {
sum += analogRead(A3);
delay(2);
}

// Turn off immediately after measurement to avoid continuous power consumption by divider resistors
digitalWrite(BAT_EN, LOW);

float adcRaw = sum / (float)samples;
float a3Voltage = adcRaw * ADC_VREF / ADC_MAX;

return a3Voltage * DIVIDER_RATIO;
}

void setup() {
Serial.begin(115200);

pinMode(BAT_EN, OUTPUT);
digitalWrite(BAT_EN, LOW); // Disable detection circuit by default

analogReadResolution(12); // RP2040 Plus ADC: 0~4095
}

void loop() {
float batteryVoltage = readBatteryVoltage();

Serial.print("Battery: ");
Serial.print(batteryVoltage, 3);
Serial.println(" V");

delay(1000);
}

note

For low-power applications, disable BAT_EN after the battery voltage measurement is complete to reduce the quiescent power consumption caused by the voltage-divider resistors.

  • The Charge_LED blinks while the battery is charging.

  • Battery voltage measurement result: The measured voltage of a lithium-ion battery may differ from the nominal value printed on the battery. Always refer to the actual measured value.

Schematic Online Viewer

Resources

XIAO RP2040

Hardware Design

Mechanical Design

XIAO RP2040 Plus

Hardware Design

Course Resources

Tech Support & Product Discussion

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.

Loading Comments...