XIAO ESP32-C5 Pinout, Datasheet, Schematic [Ultimate Guide]

In this guide, you’ll find the XIAO ESP32C5 pinout diagram, the XIAO ESP32-C5 datasheet and schematic diagram, and every pin group explained with its default pins. Without further ado, let’s get right into it!

The Seeed Studio XIAO ESP32C5 is the first XIAO board with dual-band Wi-Fi 6 (2.4GHz and 5GHz). It packs the ESP32-C5 RISC-V chip at 240MHz, 8MB of PSRAM, 8MB of flash, Bluetooth LE 5 and 802.15.4 (Thread and Zigbee) into a 21 × 17.8mm board with 11 GPIO pins, a LiPo charger and a U.FL antenna connector, all at 3.3v.


XIAO ESP32-C5 Pinout Diagram

Here is a detailed XIAO ESP32-C5 Pinout Diagram with colored labels and legends to help you easily identify each pin’s function. It shows both 7-pin edges with the XIAO pin names (D0–D10), the ESP32-C5 GPIO numbers, the ADC, UART, SPI, I2C, LP (low-power) and SDIO functions, plus the back pads and the board’s power and on-board hardware.

XIAO ESP32C5 pinout diagram with GPIO, ADC, PWM, UART, SPI, I2C, LP GPIO, SDIO and back pad pin functions (Seeed Studio XIAO ESP32-C5)
Seeed Studio XIAO ESP32-C5: left edge D0–D6, right edge D7–D10 and power, back pads

Each row shows the physical pin number (1–14), the XIAO pin name, the ESP32-C5 GPIO, and its functions, color-coded by peripheral. The square symbol means every pin is 3.3v only, the PWM symbol means all 11 I/O pins can output PWM, and the numbered badges point to the notes on the right of the diagram.

With the USB-C connector at the top and the shield facing you, the left edge runs from D0 (pin 1) down to D6 (pin 7), and the pin numbers continue counter-clockwise up the right edge from D7 (pin 8) to 5V (pin 14). The back pads (JTAG, BOOT, EN, 3V3, GND and the battery pads) are drawn in the panel below the board.

Buy a XIAO ESP32-C5: If you don’t have one yet, you can get the genuine Seeed Studio board from Amazon or AliExpress. It comes with a small antenna in the box, so it’s ready for Wi-Fi out of the bag.

Download XIAO ESP32-C5 Pinout Diagram (Full Resolution)

The XIAO ESP32-C5 pinout diagram (edge pins, back pads, power and on-board hardware) in full resolution (5120×2540 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 ESP32-C5 Datasheet

This development board is built around the ESP32-C5HR8 SoC (the ESP32-C5 with 8MB of PSRAM in the package). So the XIAO ESP32-C5 datasheet set has two parts: Seeed’s documents for the board and Espressif’s for the chip. Here are the official documents you’ll need, linked to their original sources:

DocumentIDRevisionWhat You’ll Use It ForLink
Seeed Studio XIAO ESP32-C5 product page & datasheetSKU 100010048currentBoard specs, bundled antenna, sleep currents (datasheet download on the page)Web
Getting Started with Seeed Studio XIAO ESP32-C5 (wiki)Seeed WikiJul 9, 2026Pin map, Arduino setup, deep sleep and battery-voltage examplesWeb
XIAO ESP32-C5 schematicSeeed Studio ESP32C5V1.1 (Dec 25, 2025)The full board circuit (see the next section)PDF
XIAO ESP32-C5 KiCad project (SCH & PCB)SeeedV1.1The editable schematic and layout, with the BOM part numbersZIP
XIAO ESP32-C5 pinout sheetSeeedcurrentSeeed’s pin-function spreadsheetXLSX
ESP32-C5 Series datasheetEspressifv1.5Pin functions (IO MUX, LP, ADC), strapping pins, electrical limits, current consumptionPDF
ESP32-C5 technical reference manualEspressiflatestRegisters and how every peripheral and the GPIO matrix workPDF
ESP32-C5 Series SoC errataEspressiflatestKnown silicon issues per chip revisionWeb

Which document do I need? The Seeed wiki and the schematic for what’s connected to each pin and how the board is powered, the ESP32-C5 datasheet for pin functions and electrical limits, and the technical reference manual when you write register-level code. The Arduino pin names come from the core’s XIAO_ESP32C5 variant.


XIAO ESP32-C5 Schematic

The XIAO ESP32-C5 schematic is Seeed’s “Seeed Studio ESP32C5” drawing, revision V1.1 (December 25, 2025). V1.1 added two load switches (U4 and U10) to the first V1.0 design. It has a power sheet and a main sheet, so here are the block diagram, both sheets, and close-ups of each block; click a page to view it full screen.

XIAO ESP32-C5 schematic page 1: block diagram (Seeed Studio ESP32C5 V1.1)
Page 1 of 9 · Block Diagram
XIAO ESP32-C5 schematic page 2: power sheet (Seeed Studio ESP32C5 V1.1)
Page 2 of 9 · Power Sheet
XIAO ESP32-C5 schematic page 3: USB-C, TPS22916 load switch and TPS2116 power mux (Seeed Studio ESP32C5 V1.1)
Page 3 of 9 · USB-C, Load Switch & Power Mux
XIAO ESP32-C5 schematic page 4: SGM40567 charger, battery sense switch and SGM6029 buck converter (Seeed Studio ESP32C5 V1.1)
Page 4 of 9 · Charger, Battery Sense & Buck
XIAO ESP32-C5 schematic page 5: XIAO edge pins and back test pads (Seeed Studio ESP32C5 V1.1)
Page 5 of 9 · Edge Pins & Back Pads
XIAO ESP32-C5 schematic page 6: main sheet (Seeed Studio ESP32C5 V1.1)
Page 6 of 9 · Main Sheet
XIAO ESP32-C5 schematic page 7: ESP32-C5 and 48MHz crystal (Seeed Studio ESP32C5 V1.1)
Page 7 of 9 · ESP32-C5 & 48MHz Crystal
XIAO ESP32-C5 schematic page 8: LFD182G45 diplexer and U.FL antenna connector (Seeed Studio ESP32C5 V1.1)
Page 8 of 9 · Diplexer & U.FL Antenna
XIAO ESP32-C5 schematic page 9: LEDs, buttons and SPI flash (Seeed Studio ESP32C5 V1.1)
Page 9 of 9 · LEDs, Buttons & SPI Flash
Page 1 of 4

Official source: the XIAO ESP32-C5 schematic V1.1 (PDF) on the Seeed wiki, plus the KiCad project. Here’s what to look at:

  • USB-C and the 5V pin: VBUS from the USB-C connector goes through a TPS22916 load switch (U4) that is switched on by USB 5v itself. Its output is the VBUS net, which is also the 5V edge pin. With no USB cable, U4 is off, so 5v fed into the 5V pin can’t flow back into the USB port. USB D+/D− go straight to the chip (GPIO14/GPIO13) through 22Ω resistors, with ESD diodes on every line. There’s no fuse.
  • TPS2116 power mux (U8): picks VBUS (VIN1, priority) or the battery (VIN2). Seeed’s note says it switches to the battery when VBUS drops below 4.33v (set by R7/R8). Its output is VSYS.
  • SGM6029 buck converter (U1): turns VSYS into the 3.3v rail (“Imax = 1A” on the schematic). A second TPS22916 (U10, always enabled) passes it to the 3V3 edge pin as 3V3_OUT.
  • SGM40567-4.2 charger (U2): charges a single-cell LiPo on the BAT pads at 200mA (R2 = 120kΩ, “ICharge = 24000/120K”). Its NCHG output drives the red charge LED.
  • Battery sense: a third TPS22916 (U3), enabled by GPIO26 (100kΩ pull-down), connects the battery to a 100k/100k divider on GPIO6 (ADC1_CH5). So the battery voltage is 2× the ADC reading, and the divider draws nothing while GPIO26 is LOW.
  • ESP32-C5 (U6): a 48MHz crystal (X1) and no 32.768kHz crystal, so GPIO0/GPIO1 are free as D1/D0. The 8MB PY25Q64HA flash (U5) sits on the chip’s SPI flash pins, and R15 (499Ω) is in series with U0TXD (D6/TX).
  • RF: the chip’s separate ANT_2G and ANT_5G outputs go through matching networks into an LFD182G45 diplexer (U7), which combines them on the U.FL connector (ANT1). There’s no chip antenna and no RF switch to configure.
  • LEDs and buttons: the yellow user LED (D3) on GPIO27 through 1.5kΩ to 3.3v (active LOW), the red charge LED (D4), the R button on CHIP_PU (EN) and the B button on GPIO28, each with a 10kΩ pull-up.

Note: Seeed’s documents disagree on the user LED color: the product datasheet says green, while the schematic, the wiki and the KiCad BOM (an Everlight yellow LED) say yellow. Seeed’s spec table also counts 5 analog pins, but only one of them (A0 = D0) is on the edge; the other four are the JTAG pads on the back (see the ADC section).


XIAO ESP32-C5 Specs

The XIAO ESP32-C5 is a thumb-sized ESP32-C5 board from Seeed Studio. Here are its specifications, including the board-level parts that chip-only spec lists usually skip.

Seeed Studio XIAO ESP32-C5 development board (ESP32-C5, dual-band Wi-Fi 6, U.FL antenna connector)

Get a XIAO ESP32-C5: The genuine Seeed Studio board is the one I recommend. Grab it from Amazon or AliExpress.

ItemXIAO ESP32-C5
SoCESP32-C5HR8 (QFN48, 8MB PSRAM in package)
CPU32-bit RISC-V HP core up to 240MHz + 32-bit RISC-V LP core up to 48MHz
Memory384KB SRAM, 16KB LP SRAM, 320KB ROM, 8MB PSRAM, 8MB flash (PY25Q64HA)
WirelessDual-band Wi-Fi 6 (2.4GHz + 5GHz, 802.11ax), Bluetooth LE 5, IEEE 802.15.4 (Thread, Zigbee)
AntennaU.FL connector only (no chip antenna); a 2.4GHz FPC antenna is in the box
Logic level3.3v on every pin, not 5v tolerant (abs max 3.6v)
GPIO pins11 on the edge (D0–D10) + 5 on the back pads (MTMS, MTDI, MTCK, MTDO, BOOT)
Board supplyUSB-C 5v, a 3.7v LiPo on the BAT pads, or 5v on the 5V pin (no USB connected)
3.3v regulatorSGM6029 step-down converter, 1A (shared with the chip and the radio)
Battery chargerSGM40567-4.2, 200mA, red charge LED
Pin currentUp to 40mA source, 28mA sink per GPIO (strongest drive); 20mA default
USB connectorUSB-C to the chip’s USB Serial/JTAG; no USB-UART chip
User I/OYellow user LED (GPIO27, active LOW), BOOT button (GPIO28), RESET button
Form factorXIAO, 21 × 17.8mm, 14 castellated edge pins, components on one side
Order codeSeeed SKU 100010048 (model XIAO-ESP32-C5)
NoDAC, touch pins, 5v-tolerant pins, chip antenna

XIAO ESP32-C5 Specifications Summary

  • The XIAO ESP32-C5 runs an ESP32-C5 RISC-V core at up to 240MHz with 8MB PSRAM and 8MB flash.
  • It’s the first XIAO with 5GHz Wi-Fi: dual-band Wi-Fi 6, plus Bluetooth LE 5 and 802.15.4 for Thread and Zigbee.
  • It has 11 GPIOs on the edge (D0–D10), and every pin is 3.3v only.
  • Only one ADC pin is on the edge: A0 = D0 (GPIO1). A1–A4 are the JTAG pads on the back (GPIO2–GPIO5).
  • D0 is GPIO1 and D1 is GPIO0, so always write the D-names in code.
  • All 11 edge pins can output PWM (LEDC with 6 channels).
  • Serial is USB CDC; Serial0 is UART0 on D6 (TX) / D7 (RX).
  • The Arduino Wire pins are D4 (SDA) and D5 (SCL); SPI is D8 (SCK), D9 (MISO), D10 (MOSI) with D3 as SS.
  • The user LED is on GPIO27 ( LED_BUILTIN, active LOW) and the BOOT button on GPIO28.
  • It charges a LiPo at 200mA and reads the battery voltage on GPIO6 after GPIO26 is set HIGH.
  • Seeed rates deep sleep at 15µA on battery and 375µA on USB power.
  • Deep-sleep wake-up works only from D0, D1 and the four JTAG pads.

XIAO ESP32-C5 Peripherals: ESP32-C5 vs On the Board

The ESP32-C5 routes most peripherals through its GPIO matrix, so UART, I2C, SPI, PWM, I2S and CAN can go to almost any free pin. This table shows what the chip has and what you can actually reach on the XIAO.

PeripheralESP32-C5On the XIAO ESP32-C5
GPIO29 GPIOs11 edge pins (D0–D10) + 5 back pads (GPIO2–GPIO5, GPIO28)
ADC1x 12-bit SAR ADC, 6 channels (GPIO1–GPIO6)1 on the edge (A0 = D0) + 4 back pads (A1–A4); GPIO6 = battery sense
Analog comparator2 inputs (GPIO8, GPIO9)D8, D9
DAC / touchnone–
UART2 + 1 LP UARTUART0 on D6/D7; UART1 on any pin; LP UART on the MTCK/MTDO pads
SPI (general purpose)1 (SPI2)Arduino SPI on D8/D9/D10, SS = D3
I2C1 + 1 LP I2CArduino Wire on D4/D5; LP I2C on the MTMS/MTDI pads
PWMLEDC (6 channels), MCPWM (6 outputs)all 11 edge pins
I2S, RMT, PCNT, PARLIOyesany free pin
TWAI (CAN FD)2any free pin, with an external transceiver
SDIO slave4-bit1-bit only (DATA2/DATA3 are the USB pins)
USBUSB Serial/JTAG (Full-Speed)USB-C connector only (GPIO13/GPIO14)

XIAO ESP32-C5 Quick Pin Selection Guide

Not sure which pin to use? Here are the XIAO ESP32-C5 pins I’d pick first for each job, and why.

Use CaseRecommended PinsWhy
Serial to the PCUSB-C (Serial)USB CDC on the chip’s USB Serial/JTAG; no adapter needed
Serial to a module (GPS, GSM…)D7 (RX), D6 (TX) as Serial0UART0’s own pins; give Serial1 any two other pins
I2C sensors and displaysD4 (SDA), D5 (SCL)The Arduino Wire pins; add pull-ups if the module has none
SPI devicesD8 (SCK), D9 (MISO), D10 (MOSI), D3 (CS)The Arduino SPI pins
Analog inputD0 (A0)The only ADC pin on the edge
PWM (LEDs, motors, servos)D4–D10Any pin works; these are not straps
Deep-sleep wake buttonD0 or D1The only edge pins that are LP GPIOs
External interruptAny GPIOEvery ESP32-C5 GPIO can trigger an interrupt
On-board LEDLED_BUILTIN (GPIO27)Yellow LED, active LOW
Safest general GPIOD4, D5, D8, D9, D10No strapping role and no load on the board

XIAO ESP32-C5 Pins to Use With Caution

PinReasonWhat to Do
D2 (GPIO25)Strapping pin (SDIO sampling edge, with MTDI)Fine for normal use; avoid strong pull-ups/downs at reset
D3 (GPIO7)Strapping pin (JTAG source, only if an eFuse is burnt) and the default SPI SSFine as SPI CS; avoid strong pulls at reset
D6 / TX (GPIO11)499Ω series resistor, prints the ROM boot log at every resetUse it for UART; expect boot text on it
D0 (GPIO1), D1 (GPIO0)Swapped vs. their GPIO numbersAlways write D0/D1, never 0/1
MTMS, MTDI, MTCK, MTDO padsJTAG pins, also A1–A4 and deep-sleep wake sourcesSeeed advises keeping them for debugging
5VTied to USB VBUS when a cable is plugged inDon’t feed 5v here while USB is connected
All pins3.3v only, no 5v toleranceLevel-shift every 5v signal

XIAO ESP32-C5 Pins Functions

The 14 edge pins and the back pads of the XIAO ESP32-C5 are divided into the following groups based on the hardware functionality they’re used for. Thanks to the GPIO matrix, most pins belong to several groups at once.

We’ll discuss each pin group in the following sections one by one in more detail.


XIAO ESP32-C5 Power Pins

The XIAO ESP32-C5 runs from USB-C (5v), from a 3.7v LiPo on the BAT pads, or from 5v on the 5V pin. A TPS2116 power mux picks USB first and the battery second, and an SGM6029 buck converter makes the 3.3v rail. The power pins are highlighted in red in the pinout diagram.

XIAO ESP32-C5 power pins (5V, GND, 3V3) on the right edge

PinPhysical PinRangeNotes
5V145v in or outUSB VBUS (after the TPS22916 load switch); a 5v input when no USB cable is plugged in
3V3123.3v outSGM6029 buck output through a TPS22916 switch, for sensors and modules
GND130vPlus a GND pad on the back
BAT+ / BAT−back pads3.7v LiPoBattery input and charger output (200mA)

What the 5V pin does: with USB plugged in, the 5V pin is USB VBUS, so you can take 5v from it for a small module. Without USB, you can power the board by feeding 5v into it: the TPS22916 (U4) is off, so that voltage can’t back-feed a dead USB port. The supply goes through the power mux into the buck converter, so it powers the board, and since the charger hangs on VBUS, it also charges the battery.

Note: Never feed the 5V pin and plug in USB at the same time: with a cable connected, the 5V pin and the USB port are tied together, and the two supplies fight. And the 3V3 pin is an output only; the board has no protection for a 3.3v supply pushed into it.

The ESP32-C5 needs a lot of current when it transmits: Espressif’s datasheet gives peaks up to 320mA on 2.4GHz and 408mA on 5GHz. A weak USB port, a long thin cable or a small battery can brown out the board when Wi-Fi starts, so give it a supply with that headroom.

XIAO ESP32-C5 Battery Charging and Battery Voltage

Solder a single-cell 3.7v LiPo to the BAT+ and BAT− pads under the board (check the polarity twice). The SGM40567 charges it at 200mA whenever USB is plugged in. The red C LED blinks while charging; when the battery is full, it stays on for about 51 seconds and then turns off (Seeed’s schematic note).

Unlike the XIAO ESP32C3 and C6, the XIAO ESP32-C5 can read its own battery voltage. Set GPIO26 ( BAT_VOLT_PIN_EN) HIGH to connect the 100k/100k divider, read GPIO6 ( BAT_VOLT_PIN) in millivolts, and multiply by 2:

Switching GPIO26 off between readings keeps the divider from draining the battery, which matters in deep-sleep projects. Expect the reading to be a few percent off a multimeter (divider tolerance and ADC error), so calibrate it once if you need an accurate fuel gauge.

XIAO ESP32-C5 Sleep Current

Seeed rates the XIAO ESP32-C5 at 15µA in deep sleep on battery, but 375µA in deep sleep when powered from USB, because the USB path, the load switch and the mux stay powered. So measure sleep current from the BAT pads, not over USB. The ESP32-C5 chip alone draws about 12µA in deep sleep (RTC timer and LP memory on), per Espressif’s datasheet.

Learn more in our ESP32 Sleep Modes & Power Consumption Guide.


XIAO ESP32-C5 GPIO Pins

The XIAO ESP32-C5 has 11 GPIO pins on its edge, D0–D10, plus 5 more on the back pads. They all work at 3.3v, and none of them is 5v tolerant. The XIAO names don’t follow the GPIO numbers, so here is the map:

XIAO ESP32-C5 GPIO pins (D0-D10) with their ESP32-C5 GPIO numbers

XIAO PinGPIOArduino DefaultXIAO PinGPIOArduino Default
D0 / A0GPIO1A0D6GPIO11TX (Serial0)
D1GPIO0–D7GPIO12RX (Serial0)
D2GPIO25– (strap)D8GPIO8SCK
D3GPIO7SS (strap)D9GPIO9MISO
D4GPIO23SDAD10GPIO10MOSI
D5GPIO24SCL

Each GPIO can be an input (floating, pull-up or pull-down, about 45kΩ internal), a push-pull or open-drain output, or almost any peripheral through the GPIO matrix. Here are the limits from Espressif’s datasheet:

  • Logic level 3.3v; never apply more than 3.6v to any pin.
  • Up to 40mA source and 28mA sink per pin at the strongest drive setting; the default drive strength is 20mA.
  • D6/TX has a 499Ω series resistor, so it can’t drive a load directly.
  • The GPIOs you don’t see on the edge: GPIO2–GPIO5 (back pads), GPIO6 and GPIO26 (battery sense), GPIO13/GPIO14 (USB), GPIO15–GPIO22 (flash and PSRAM), GPIO27 (LED) and GPIO28 (BOOT).

Note: In the Arduino core, a plain number is a GPIO number: digitalWrite(1, HIGH) drives D0 (GPIO1), and digitalWrite(0, HIGH) drives D1. Write D0, D1… and the core maps them for you. The D-pins also map to different GPIOs on every XIAO, so code copied from a XIAO ESP32C3 or C6 with bare numbers lands on the wrong pins.

Learn more in our ESP32 GPIO Tutorial.


XIAO ESP32-C5 Interrupt Pins

Every GPIO pin on the XIAO ESP32-C5 can be an external interrupt pin: all 11 edge pins support RISING, FALLING and CHANGE triggers with attachInterrupt(digitalPinToInterrupt(D2), isr, FALLING).

Deep-sleep wake-up is a different story: only the chip’s LP GPIOs can wake it, and on the XIAO ESP32-C5 those are D0 (GPIO1), D1 (GPIO0) and the four JTAG pads. D2–D10 can’t wake the board from deep sleep. This example wakes it with a HIGH level on D0, based on Seeed’s wiki:

Note: The USB port disappears while the board sleeps. To upload a new sketch, wake it first, or press RESET while holding BOOT to enter download mode.

Learn more in our ESP32 External Interrupts Tutorial.


XIAO ESP32-C5 ADC Pins

The XIAO ESP32-C5 has only one ADC pin on its edge: A0, which is D0 (GPIO1). The ESP32-C5’s 12-bit ADC has 6 channels, and the other four that you can reach (A1–A4) are the JTAG pads on the back (GPIO2–GPIO5). The sixth, GPIO6, is wired to the battery divider. The ADC pin is highlighted in green in the pinout diagram.

XIAO ESP32-C5 ADC pins (A0 on D0 GPIO1; A1-A4 on the back JTAG pads)

Arduino NameWhereGPIOADC ChannelNote
A0D0 (edge pin 1)GPIO1ADC1_CH0The only analog pin on the edge
A1MTMS pad (back)GPIO2ADC1_CH1Also a JTAG pin and a strap
A2MTDI pad (back)GPIO3ADC1_CH2Also a JTAG pin and a strap
A3MTCK pad (back)GPIO4ADC1_CH3Also a JTAG pin
A4MTDO pad (back)GPIO5ADC1_CH4Also a JTAG pin
BAT_VOLT_PINinternalGPIO6ADC1_CH5Battery voltage ÷ 2 (enable with GPIO26)

Note: If you’re porting a project from a XIAO ESP32C3, C6 or S3, check your analog pins: on those boards A1 and A2 are D1 and D2, but on the XIAO ESP32-C5, A1– A4 point to the back pads. A sensor on D1 read with analogRead(A1) returns nothing useful. Use D0 for your one analog sensor, solder to the back pads for more, or add an I2C ADC (ADS1115) for several.

analogRead(A0) returns 0 to 4095 (12-bit), and analogReadMilliVolts(A0) gives the calibrated voltage. At the default 11dB attenuation the range covers about 0v–3.3v. There’s no ADC2 on this chip, so the ADC works normally with Wi-Fi on.

There are so many sensors that we can read with an ADC pin, which include: potentiometers, LDRs, NTC thermistors, soil moisture sensors, analog joysticks (one axis per pin), current sensors, and much more.

Learn more in our ESP32 ADC Tutorial.

ESP32 ADC Analog Read Arduino Example Tutorial - Calibration And Filtering

Also Read

ESP32 ADC Tutorial


XIAO ESP32-C5 PWM Pins

All 11 edge pins on the XIAO ESP32-C5 can output PWM. The ESP32-C5’s LEDC peripheral has 6 channels, and the MCPWM unit adds motor-control outputs, all routed through the GPIO matrix. In the Arduino core, analogWrite(D5, 128) just works.

XIAO ESP32-C5 PWM pins: every edge pin (D0-D10) can output PWM

XIAO ESP32-C5 PWM Pins: D0–D10 (up to 6 LEDC channels at the same time).

For more control, use the LEDC API: ledcAttach(D5, 5000, 10) sets 5kHz with 10-bit resolution, and ledcWrite(D5, 512) sets 50% duty. With 6 LEDC channels, you can run up to 6 independent PWM outputs at once.

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.

Learn more in our ESP32 PWM Tutorial.

ESP32 PWM Example Arduino Tutorial - ledcWrite AnalogWrite

Also Read

ESP32 PWM Tutorial


XIAO ESP32-C5 UART Pins

The XIAO ESP32-C5 has 2 UARTs plus an LP UART, and the USB CDC port. Serial is the USB-C port (Serial Monitor), Serial0 is UART0 on D6 (TX) and D7 (RX), and Serial1 can go to any pins you choose. The UART pins are highlighted in blue in the pinout diagram.

XIAO ESP32-C5 UART pins (D6 TX GPIO11, D7 RX GPIO12)

XIAO ESP32-C5 Default UART Pins: D6 (TX) and D7 (RX) for Serial0.

PortArduino ObjectTX PinRX PinNote
USB CDCSerialUSB-CUSB-CUSB Serial/JTAG, “USB CDC On Boot” is on by default
UART0Serial0D6 (GPIO11)D7 (GPIO12)499Ω resistor on TX; ROM boot log at reset
UART1Serial1any free pinany free pinPass the pins in begin()
LP UARTESP-IDFMTDO pad (GPIO5)MTCK pad (GPIO4)Works in low-power modes

Note: D6 (TX) prints the ROM boot messages every time the board resets. If a module on D6/D7 misbehaves at power-up, that’s why. A 5v module’s TX also needs a level shifter before it reaches D7.

There are so many modules that we can interface with the UART pins, which include: GPS modules, GSM/LTE modules, fingerprint sensors, RS485 transceivers, other microcontrollers, and much more.

Learn more in our ESP32 Serial Print Tutorial.


XIAO ESP32-C5 I2C Pins

The XIAO ESP32-C5 has 1 I2C bus plus an LP I2C. The default Arduino Wire pins are D4 (SDA) and D5 (SCL), the same place as on every XIAO. The I2C pins are highlighted in yellow in the pinout diagram.

XIAO ESP32-C5 I2C pins (D4 SDA GPIO23, D5 SCL GPIO24)

XIAO ESP32-C5 Default I2C Pins: D4 (SDA) and D5 (SCL).

I2C BusArduino ObjectSDASCLNote
I2C0WireD4 (GPIO23)D5 (GPIO24)Default; can be moved to other pins
LP I2CESP-IDFMTMS pad (GPIO2)MTDI pad (GPIO3)For the LP core in low-power modes

Note: There are no I2C pull-up resistors on the XIAO ESP32-C5, so add 4.7kΩ pull-ups to 3.3v unless your module has them. Most breakout boards already 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, the Seeed XIAO expansion board, and much more.

Learn more in our ESP32 I2C Tutorial.

ESP32 I2C Tutorial in Arduino IDE - Set I2C Pins - I2C Scanner - Multiple Device Addresses

Also Read

ESP32 I2C Tutorial


XIAO ESP32-C5 SPI Pins

The XIAO ESP32-C5 has 1 general-purpose SPI port (SPI2). The default Arduino SPI pins are D8 (SCK), D9 (MISO) and D10 (MOSI), with D3 as the default SS. The SPI pins are highlighted in pink in the pinout diagram.

XIAO ESP32-C5 SPI pins (D8 SCK GPIO8, D9 MISO GPIO9, D10 MOSI GPIO10, D3 SS GPIO7)

XIAO ESP32-C5 Default SPI Pins: D8 (SCK), D9 (MISO), D10 (MOSI), and D3 (SS).

SignalPinGPIONote
SCKD8GPIO8Also analog comparator input 0
MISOD9GPIO9Also analog comparator input 1
MOSID10GPIO10
SS (CS)D3GPIO7A strapping pin; any GPIO can be an extra CS

The flash and the PSRAM use the chip’s own memory SPI bus (GPIO15–GPIO22), so SPI2 is all yours. D8, D9, D10 and D3 are also the chip’s SDIO slave pins, which only matter if you use the SDIO slave.

There are so many modules that we can interface with the SPI bus, which include: TFT displays (ST7789, ILI9341), SD card modules, LoRa radios (SX1262), MAX7219 LED drivers, and much more.


XIAO ESP32-C5 Back Pads (JTAG, BOOT, EN, Battery)

The XIAO ESP32-C5 has 8 test pads on the back plus the BAT+/BAT− pads. Four of them are the chip’s JTAG pins, which double as A1–A4, LP I2C, LP UART and deep-sleep wake inputs. Seen from the back with USB at the top, the pads run in two columns:

PadGPIO / NetFunctionsNote
MTMSGPIO2JTAG TMS, A1 (ADC1_CH1), LP I2C SDA, LP GPIO2Strapping pin
MTDIGPIO3JTAG TDI, A2 (ADC1_CH2), LP I2C SCL, LP GPIO3Strapping pin
MTCKGPIO4JTAG TCK, A3 (ADC1_CH3), LP UART RX, LP GPIO4
MTDOGPIO5JTAG TDO, A4 (ADC1_CH4), LP UART TX, LP GPIO5
BOOTGPIO28BOOT button, strapping pin10kΩ pull-up
ENCHIP_PUReset (RESET button)Pull LOW to reset; 10kΩ pull-up
3V33.3v3.3v rail
GNDGNDGround
BAT+ / BAT−VBATLiPo battery200mA charger

Debugging doesn’t need these pads: the built-in USB JTAG works over the USB-C cable (Arduino: Tools > JTAG Adapter > Integrated USB JTAG). Using the pads for an external JTAG probe needs an eFuse change, which can’t be undone.


XIAO ESP32-C5 USB Pins

The XIAO ESP32-C5’s USB-C connector is wired straight to the ESP32-C5’s USB Serial/JTAG controller on GPIO13 (D−) and GPIO14 (D+). There’s no USB-UART chip, so the same port does uploads, the Serial console and debugging. It is not a full USB OTG port, so the board can’t act as a USB keyboard or mouse.

Two things follow from that. In the Arduino core, USB CDC On Boot is enabled by default, which is what makes Serial print to the USB port. In ESP-IDF, select the USB Serial/JTAG console ( CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG); with a UART0-only console you’ll see nothing on the USB port, a problem users hit when porting projects from boards with a USB-UART chip (esp32_nat_router #272).


XIAO ESP32-C5 Strapping and Boot Pins

The XIAO ESP32-C5 has 2 strapping pins on its edge: D2 (GPIO25) and D3 (GPIO7). The boot-mode straps themselves (GPIO26, GPIO27 and GPIO28) are all inside the board, so the edge pins can’t accidentally put it into download mode.

XIAO ESP32-C5 strapping pins (D2 GPIO25, D3 GPIO7)

PinGPIOStrapping RoleOn the Board
D2GPIO25SDIO slave sampling edge (with MTDI)Floating
D3GPIO7JTAG source (only if EFUSE_JTAG_SEL_ENABLE is burnt)Floating, default SPI SS
BOOT buttonGPIO28HIGH = boot from flash, LOW = download mode10kΩ pull-up
User LEDGPIO27Download-mode select; HIGH also enables the ROM log on UART01.5kΩ + LED to 3.3v
(battery sense)GPIO26Download-mode select (with GPIO27/28)100kΩ pull-down

To enter download mode: hold B (BOOT), tap R (RESET) or plug in USB, then release B. You need this when the USB port has vanished (a crashed sketch, deep sleep, or a wrong console setting).

Note: The ESP32-C5 bootloader lives at offset 0x2000, not 0x0 as on the classic ESP32. If you flash a MicroPython or other firmware image at 0x0 by hand, the board boot-loops with an “invalid header” message. Users hit this with Thonny’s installer (thonny #3963); flash the image at 0x2000, or with esptool’s merged binary at 0x0.


XIAO ESP32-C5 On-Board Features

Besides the pins, the XIAO ESP32-C5 has 2 LEDs, 2 buttons, a U.FL antenna connector and a LiPo charger. Here’s what each one does.

PartPin / ConnectionWhat It Does
User LED “L” (yellow)GPIO27LED_BUILTIN, active LOW: digitalWrite(LED_BUILTIN, LOW) turns it on
Charge LED “C” (red)Charger NCHG outputBlinks while charging, on for ~51s when full, then off; not software-controlled
RESET button “R”CHIP_PU (EN)Resets the chip
BOOT button “B”GPIO28Hold at reset for download mode; readable as a button in your sketch
U.FL connectorLFD182G45 diplexerThe only antenna connection, for both 2.4GHz and 5GHz
48MHz crystalXTAL_P/NMain clock; no 32.768kHz crystal fitted

XIAO ESP32-C5 Antenna: 2.4GHz vs 5GHz

The XIAO ESP32-C5 has no chip antenna: the radio only reaches the outside world through the U.FL connector. According to Seeed’s datasheet, the antenna in the box is a 2.4GHz FPC antenna (2.9dBi), the same one that ships with the XIAO ESP32C3. It works for Wi-Fi at 2.4GHz, Bluetooth, Thread and Zigbee, but 5GHz range suffers with it. For 5GHz Wi-Fi, fit a dual-band (2.4/5GHz) U.FL antenna.

Note: Never run the radio without an antenna connected, and press the U.FL plug straight down until it clicks: it’s easy to knock off in a tight enclosure. A loose antenna is the first thing to check when Wi-Fi drops or the board resets on connect.


Getting Started With XIAO ESP32-C5

You can program the XIAO ESP32-C5 with the Arduino IDE, ESP-IDF, PlatformIO, MicroPython, Zephyr or ESPHome, all over the USB-C cable. No external programmer is needed.

  • Arduino IDE: install Espressif’s “esp32” package, version 3.3.5 or newer (older versions don’t have this board), then select XIAO_ESP32C5.
  • PSRAM: the 8MB PSRAM is off by default in the Arduino Tools menu. Set Tools > PSRAM > Enabled for large buffers, camera-free image work, and the Thread and Zigbee examples.
  • ESP-IDF: target esp32c5, with GPIO numbers everywhere and the USB Serial/JTAG console.
  • MicroPython: use an ESP32-C5 build and flash it at 0x2000 (or a merged image at 0x0); use GPIO numbers, so Pin(27) is the LED.
  • ESPHome and Zephyr: both support the board (Zephyr as xiao_esp32c5). Pick the XIAO board definition rather than the ESP32-C5 DevKit one, so the pins and the console are right.
Arduino NamePinDefault
SerialUSB-CUSB CDC to the Serial Monitor
Serial0D6 (TX), D7 (RX)UART0
WireD4 (SDA), D5 (SCL)I2C0
SPID8 / D9 / D10, SS = D3SPI2
LED_BUILTINGPIO27Yellow LED, active LOW
A0–A4D0, then the MTMS/MTDI/MTCK/MTDO padsGPIO1–GPIO5
BAT_VOLT_PIN / BAT_VOLT_PIN_ENGPIO6 / GPIO26Battery voltage sense

Since the XIAO ESP32-C5 runs the ESP32 Arduino core, almost every ESP32 tutorial applies to it; just remember the pin names. To use 5GHz, nothing changes in code: WiFi.begin() connects to whichever band your router offers.

Learn more in our ESP32 WiFi Tutorial.


XIAO ESP32-C5 Common Problems & Fixes

Why does analogRead(A1) return nothing on D1? A1–A4 are the JTAG pads on the back (GPIO2–GPIO5), not D1–D4. Only D0 (A0) is analog on the edge.

Why does my pin 0 / pin 1 code drive the wrong pin? D0 is GPIO1 and D1 is GPIO0. Write D0 and D1 instead of numbers.

Why isn’t the board in my Arduino Boards list? It needs Espressif’s esp32 core 3.3.5 or newer. Update the package in the Boards Manager.

Why does the USB port disappear? The board is in deep sleep, or a sketch crashed early. Wake or reset it, or hold BOOT and tap RESET to enter download mode, then upload again.

Why does MicroPython boot-loop with “invalid header”? The image was written at 0x0. The ESP32-C5 bootloader goes at 0x2000 (thonny #3963).

Why can’t I reset or reflash over USB after an ESP-IDF or ESPHome build? Setting the console to USB Serial/JTAG can break the auto-reset in some IDF versions (esp-idf #18089, Seeed forum). Enter download mode by hand (hold BOOT, tap RESET) and use the official XIAO board definition.

Why does my ESPHome build boot-loop once Wi-Fi starts? There’s an open report of this on the XIAO ESP32-C5 (esphome #19035). Check the antenna, use a supply with enough peak current (up to 408mA on 5GHz), and update ESPHome before blaming the pins.

Why do Thread or Zigbee examples fail to start? Enable Tools > PSRAM; it’s off by default in Arduino.

Why is my 5GHz signal weak? The antenna in the box is a 2.4GHz FPC. Fit a dual-band U.FL antenna for 5GHz.


XIAO ESP32-C5 vs XIAO ESP32-C6 vs XIAO ESP32-C3

The three RISC-V XIAO boards share the same footprint, but they’re quite different inside. Here’s how the XIAO ESP32-C5 compares:

FeatureXIAO ESP32-C5XIAO ESP32-C6XIAO ESP32-C3
SoC / clockESP32-C5, 240MHzESP32-C6, 160MHzESP32-C3, 160MHz
Wi-FiWi-Fi 6, 2.4GHz + 5GHzWi-Fi 6, 2.4GHzWi-Fi 4, 2.4GHz
Thread / ZigbeeYes (802.15.4)Yes (802.15.4)No
Memory384KB SRAM, 8MB PSRAM, 8MB flash512KB SRAM, 4MB flash400KB SRAM, 4MB flash
Analog pins on the edge1 (D0) + 4 back pads3 (D0–D2)4 (D0–D3, D3 on ADC2)
AntennaU.FL onlyCeramic + U.FL (RF switch)U.FL only
User LEDGPIO27GPIO15none
Battery voltage senseBuilt in (GPIO6)NoNo
D0 / D1 GPIOsGPIO1 / GPIO0GPIO0 / GPIO1GPIO2 / GPIO3

Pick the XIAO ESP32-C5 when you need 5GHz Wi-Fi, more speed, or PSRAM, or when you want battery monitoring without extra parts. The C6 is the better choice for a Matter or Zigbee device that needs several analog inputs and a built-in antenna, and the C3 is the cheapest way to get plain 2.4GHz Wi-Fi and BLE in the XIAO size. Whichever you move between, re-check the pins: every D-pin maps to a different GPIO on each board.


XIAO ESP32-C5 Pin Details

Here is every XIAO ESP32-C5 pin in physical order, with its GPIO, main functions, all its IO MUX, LP and analog functions, and a short description. With USB at the top, pin 1 (D0) is the top-left pin and the numbers run counter-clockwise, so pin 14 (5V) is the top-right pin.

XIAO ESP32-C5 Edge Pins

Click to expand the full pin table (14 pins)
PinLabelGPIOMain FunctionsAll Alternate Functions5v TolerantDescription
1D0 / A0GPIO1ADC1_CH0, GPIOLP_GPIO1, LP_UART_DSRN, XTAL_32K_NNo (3.3v)The only analog input on the edge, and a deep-sleep wake pin.
2D1GPIO0GPIOLP_GPIO0, LP_UART_DTRN, XTAL_32K_PNo (3.3v)A general-purpose pin that can wake the chip from deep sleep; note it is GPIO0, not GPIO1.
3D2GPIO25GPIO, strap–No (3.3v)A strapping pin (SDIO sampling edge); safe for normal use without strong pulls at reset.
4D3GPIO7SPI SS, strapSDIO_DATA1, FSPIDNo (3.3v)The default SPI chip select, and a strapping pin that only matters if the JTAG-select eFuse is burnt.
5D4GPIO23I2C SDA (Wire)–No (3.3v)The default I2C data pin.
6D5GPIO24I2C SCL (Wire)–No (3.3v)The default I2C clock pin.
7D6GPIO11UART0 TX (Serial0)U0TXDNo (3.3v)UART0 transmit, with a 499Ω series resistor; it prints the ROM boot log at reset.
8D7GPIO12UART0 RX (Serial0)U0RXDNo (3.3v)UART0 receive.
9D8GPIO8SPI SCKSDIO_DATA0, PAD_COMP0No (3.3v)The default SPI clock pin, also an analog comparator input.
10D9GPIO9SPI MISOSDIO_CLK, PAD_COMP1No (3.3v)The default SPI data-in pin, also an analog comparator input.
11D10GPIO10SPI MOSISDIO_CMD, FSPICS0No (3.3v)The default SPI data-out pin.
123V3–3.3v output––The 3.3v rail from the SGM6029 buck converter, for sensors and modules.
13GND–Ground––Ground.
145V–USB VBUS––5v from USB, or a 5v input when no USB cable is connected.

XIAO ESP32-C5 Back Pads

Click to expand the full pin table (9 pins)
PinLabelGPIOMain FunctionsAll Alternate Functions5v TolerantDescription
TP7MTMSGPIO2JTAG TMS, A1ADC1_CH1, LP_GPIO2, LP_UART_RTSN, LP_I2C_SDA, FSPIQNo (3.3v)JTAG pin, second ADC input and LP I2C data; also a strapping pin.
TP6MTDIGPIO3JTAG TDI, A2ADC1_CH2, LP_GPIO3, LP_UART_CTSN, LP_I2C_SCLNo (3.3v)JTAG pin, third ADC input and LP I2C clock; also a strapping pin.
TP5MTCKGPIO4JTAG TCK, A3ADC1_CH3, LP_GPIO4, LP_UART_RXD, FSPIHDNo (3.3v)JTAG pin, fourth ADC input and LP UART receive.
TP4MTDOGPIO5JTAG TDO, A4ADC1_CH4, LP_GPIO5, LP_UART_TXD, FSPIWPNo (3.3v)JTAG pin, fifth ADC input and LP UART transmit.
TP2BOOTGPIO28BOOT buttonstrapNo (3.3v)The BOOT button line (10kΩ pull-up); LOW at reset enters download mode.
TP8ENCHIP_PUReset––Chip enable; pull it LOW to reset the board.
TP13V3–3.3v––The 3.3v rail.
TP3GND–Ground––Ground.
BAT+ / BAT−BAT–Battery––A 3.7v single-cell LiPo, charged at 200mA.

Wrap Up

To conclude this guide article, the XIAO ESP32-C5 is a very solid little board for connected, battery-powered projects. It gives you a 240MHz ESP32-C5 with dual-band Wi-Fi 6, Bluetooth LE, Thread and Zigbee, 8MB of PSRAM and flash, a LiPo charger and built-in battery sensing in the XIAO footprint. Just remember the board-level gotchas: only D0 is analog on the edge, D0/D1 are swapped against their GPIO numbers, the antenna is U.FL only, and the bootloader sits at 0x2000.

We hope it’s been a helpful guide to help you decide which pins to use for your project. For more boards, check out the Pinouts, Datasheets & Schematic Diagrams Library. Follow this ESP32 Series of Tutorials to learn more about programming ESP32 boards with the Arduino core.

If you’re just getting started with ESP32, you need to check out the ESP32 Getting Started Ultimate Guide below.

Getting Started With ESP32 Programming Tutorials

The complete beginner’s guide to ESP32 programming with the Arduino IDE: installing the core, your first project, and the ESP32 tutorials series step by step.

Share This Page With Your Network!
Join Our +25,000 Newsletter Subscribers!

Stay Updated With All New Content Releases. You Also Get Occasional FREE Coupon Codes For Courses & Other Stuff!

Photo of author
Author
Embedded systems engineer with several years of experience in embedded software and hardware design. I work as an embedded SW engineer in the Automotive & e-Mobility industry. However, I still do Hardware design and SW development for DSP, Control Systems, Robotics, AI/ML, and other fields I'm passionate about.
I love reading, writing, creating projects, and teaching. A reader by day and a writer by night, it's my lifestyle. I believe that the combination of brilliant minds, bold ideas, and a complete disregard for what is possible, can and will change the world! I will be there when it happens, will you?

Leave a Comment