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.
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:
| Document | ID | Revision | What You’ll Use It For | Link |
|---|---|---|---|---|
| Seeed Studio XIAO ESP32-C5 product page & datasheet | SKU 100010048 | current | Board specs, bundled antenna, sleep currents (datasheet download on the page) | Web |
| Getting Started with Seeed Studio XIAO ESP32-C5 (wiki) | Seeed Wiki | Jul 9, 2026 | Pin map, Arduino setup, deep sleep and battery-voltage examples | Web |
| XIAO ESP32-C5 schematic | Seeed Studio ESP32C5 | V1.1 (Dec 25, 2025) | The full board circuit (see the next section) | |
| XIAO ESP32-C5 KiCad project (SCH & PCB) | Seeed | V1.1 | The editable schematic and layout, with the BOM part numbers | ZIP |
| XIAO ESP32-C5 pinout sheet | Seeed | current | Seeed’s pin-function spreadsheet | XLSX |
| ESP32-C5 Series datasheet | Espressif | v1.5 | Pin functions (IO MUX, LP, ADC), strapping pins, electrical limits, current consumption | |
| ESP32-C5 technical reference manual | Espressif | latest | Registers and how every peripheral and the GPIO matrix work | |
| ESP32-C5 Series SoC errata | Espressif | latest | Known silicon issues per chip revision | Web |
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.
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.

Get a XIAO ESP32-C5: The genuine Seeed Studio board is the one I recommend. Grab it from Amazon or AliExpress.
| Item | XIAO ESP32-C5 |
|---|---|
| SoC | ESP32-C5HR8 (QFN48, 8MB PSRAM in package) |
| CPU | 32-bit RISC-V HP core up to 240MHz + 32-bit RISC-V LP core up to 48MHz |
| Memory | 384KB SRAM, 16KB LP SRAM, 320KB ROM, 8MB PSRAM, 8MB flash (PY25Q64HA) |
| Wireless | Dual-band Wi-Fi 6 (2.4GHz + 5GHz, 802.11ax), Bluetooth LE 5, IEEE 802.15.4 (Thread, Zigbee) |
| Antenna | U.FL connector only (no chip antenna); a 2.4GHz FPC antenna is in the box |
| Logic level | 3.3v on every pin, not 5v tolerant (abs max 3.6v) |
| GPIO pins | 11 on the edge (D0–D10) + 5 on the back pads (MTMS, MTDI, MTCK, MTDO, BOOT) |
| Board supply | USB-C 5v, a 3.7v LiPo on the BAT pads, or 5v on the 5V pin (no USB connected) |
| 3.3v regulator | SGM6029 step-down converter, 1A (shared with the chip and the radio) |
| Battery charger | SGM40567-4.2, 200mA, red charge LED |
| Pin current | Up to 40mA source, 28mA sink per GPIO (strongest drive); 20mA default |
| USB connector | USB-C to the chip’s USB Serial/JTAG; no USB-UART chip |
| User I/O | Yellow user LED (GPIO27, active LOW), BOOT button (GPIO28), RESET button |
| Form factor | XIAO, 21 × 17.8mm, 14 castellated edge pins, components on one side |
| Order code | Seeed SKU 100010048 (model XIAO-ESP32-C5) |
| No | DAC, 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.
| Peripheral | ESP32-C5 | On the XIAO ESP32-C5 |
|---|---|---|
| GPIO | 29 GPIOs | 11 edge pins (D0–D10) + 5 back pads (GPIO2–GPIO5, GPIO28) |
| ADC | 1x 12-bit SAR ADC, 6 channels (GPIO1–GPIO6) | 1 on the edge (A0 = D0) + 4 back pads (A1–A4); GPIO6 = battery sense |
| Analog comparator | 2 inputs (GPIO8, GPIO9) | D8, D9 |
| DAC / touch | none | – |
| UART | 2 + 1 LP UART | UART0 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 |
| I2C | 1 + 1 LP I2C | Arduino Wire on D4/D5; LP I2C on the MTMS/MTDI pads |
| PWM | LEDC (6 channels), MCPWM (6 outputs) | all 11 edge pins |
| I2S, RMT, PCNT, PARLIO | yes | any free pin |
| TWAI (CAN FD) | 2 | any free pin, with an external transceiver |
| SDIO slave | 4-bit | 1-bit only (DATA2/DATA3 are the USB pins) |
| USB | USB 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 Case | Recommended Pins | Why |
|---|---|---|
| Serial to the PC | USB-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 Serial0 | UART0’s own pins; give Serial1 any two other pins |
| I2C sensors and displays | D4 (SDA), D5 (SCL) | The Arduino Wire pins; add pull-ups if the module has none |
| SPI devices | D8 (SCK), D9 (MISO), D10 (MOSI), D3 (CS) | The Arduino SPI pins |
| Analog input | D0 (A0) | The only ADC pin on the edge |
| PWM (LEDs, motors, servos) | D4–D10 | Any pin works; these are not straps |
| Deep-sleep wake button | D0 or D1 | The only edge pins that are LP GPIOs |
| External interrupt | Any GPIO | Every ESP32-C5 GPIO can trigger an interrupt |
| On-board LED | LED_BUILTIN (GPIO27) | Yellow LED, active LOW |
| Safest general GPIO | D4, D5, D8, D9, D10 | No strapping role and no load on the board |
XIAO ESP32-C5 Pins to Use With Caution
| Pin | Reason | What 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 SS | Fine as SPI CS; avoid strong pulls at reset |
| D6 / TX (GPIO11) | 499Ω series resistor, prints the ROM boot log at every reset | Use it for UART; expect boot text on it |
| D0 (GPIO1), D1 (GPIO0) | Swapped vs. their GPIO numbers | Always write D0/D1, never 0/1 |
| MTMS, MTDI, MTCK, MTDO pads | JTAG pins, also A1–A4 and deep-sleep wake sources | Seeed advises keeping them for debugging |
| 5V | Tied to USB VBUS when a cable is plugged in | Don’t feed 5v here while USB is connected |
| All pins | 3.3v only, no 5v tolerance | Level-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.
- Power Pins: 5V, 3V3, GND, BAT+/BAT−
- 11x Digital GPIO Pins (+ 5 back pads)
- 11x Interrupt Pins (2 of them deep-sleep wake)
- 1x ADC Pin on the Edge (+ 4 on the back pads)
- 11x PWM Pins
- 2x UART + 1x LP UART (+ USB CDC)
- 1x I2C + 1x LP I2C
- 1x SPI Port
- JTAG Back Pads: MTMS, MTDI, MTCK, MTDO
- 1x Native USB Port (USB-C)
- Strapping & Boot Pins: D2, D3, BOOT
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.

| Pin | Physical Pin | Range | Notes |
|---|---|---|---|
| 5V | 14 | 5v in or out | USB VBUS (after the TPS22916 load switch); a 5v input when no USB cable is plugged in |
| 3V3 | 12 | 3.3v out | SGM6029 buck output through a TPS22916 switch, for sensors and modules |
| GND | 13 | 0v | Plus a GND pad on the back |
| BAT+ / BAT− | back pads | 3.7v LiPo | Battery 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:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
void setup() { Serial.begin(115200); pinMode(BAT_VOLT_PIN_EN, OUTPUT); // GPIO26: battery-sense switch } void loop() { digitalWrite(BAT_VOLT_PIN_EN, HIGH); // connect the divider delay(5); uint32_t mv = 0; for (int i = 0; i < 16; i++) mv += analogReadMilliVolts(BAT_VOLT_PIN); // GPIO6 digitalWrite(BAT_VOLT_PIN_EN, LOW); // disconnect it again to save power Serial.printf("Battery: %.3f V\n", 2.0 * mv / 16 / 1000.0); delay(2000); } |
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 Pin | GPIO | Arduino Default | XIAO Pin | GPIO | Arduino Default |
|---|---|---|---|---|---|
| D0 / A0 | GPIO1 | A0 | D6 | GPIO11 | TX (Serial0) |
| D1 | GPIO0 | – | D7 | GPIO12 | RX (Serial0) |
| D2 | GPIO25 | – (strap) | D8 | GPIO8 | SCK |
| D3 | GPIO7 | SS (strap) | D9 | GPIO9 | MISO |
| D4 | GPIO23 | SDA | D10 | GPIO10 | MOSI |
| D5 | GPIO24 | SCL |
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.
Also Read
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:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
void setup() { Serial.begin(115200); pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, LOW); // LED on while awake delay(2000); pinMode(D0, INPUT_PULLDOWN); // button from D0 to 3.3v esp_deep_sleep_enable_gpio_wakeup(1ULL << D0, ESP_GPIO_WAKEUP_GPIO_HIGH); Serial.println("Going to sleep"); esp_deep_sleep_start(); // the USB port disappears now } void loop() {} |
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.
Also Read
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.

| Arduino Name | Where | GPIO | ADC Channel | Note |
|---|---|---|---|---|
| A0 | D0 (edge pin 1) | GPIO1 | ADC1_CH0 | The only analog pin on the edge |
| A1 | MTMS pad (back) | GPIO2 | ADC1_CH1 | Also a JTAG pin and a strap |
| A2 | MTDI pad (back) | GPIO3 | ADC1_CH2 | Also a JTAG pin and a strap |
| A3 | MTCK pad (back) | GPIO4 | ADC1_CH3 | Also a JTAG pin |
| A4 | MTDO pad (back) | GPIO5 | ADC1_CH4 | Also a JTAG pin |
BAT_VOLT_PIN | internal | GPIO6 | ADC1_CH5 | Battery 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.
Also Read
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: 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.
Also Read
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 Default UART Pins: D6 (TX) and D7 (RX) for Serial0.
| Port | Arduino Object | TX Pin | RX Pin | Note |
|---|---|---|---|---|
| USB CDC | Serial | USB-C | USB-C | USB Serial/JTAG, “USB CDC On Boot” is on by default |
| UART0 | Serial0 | D6 (GPIO11) | D7 (GPIO12) | 499Ω resistor on TX; ROM boot log at reset |
| UART1 | Serial1 | any free pin | any free pin | Pass the pins in begin() |
| LP UART | ESP-IDF | MTDO pad (GPIO5) | MTCK pad (GPIO4) | Works in low-power modes |
|
1 2 3 4 5 6 7 8 9 |
void setup() { Serial.begin(115200); // USB-C to the PC Serial0.begin(9600); // TX = D6, RX = D7 } void loop() { while (Serial0.available()) Serial.write(Serial0.read()); // module -> PC while (Serial.available()) Serial0.write(Serial.read()); // PC -> module } |
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.
Also Read
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 Default I2C Pins: D4 (SDA) and D5 (SCL).
| I2C Bus | Arduino Object | SDA | SCL | Note |
|---|---|---|---|---|
| I2C0 | Wire | D4 (GPIO23) | D5 (GPIO24) | Default; can be moved to other pins |
| LP I2C | ESP-IDF | MTMS pad (GPIO2) | MTDI pad (GPIO3) | For the LP core in low-power modes |
|
1 2 3 4 5 6 7 8 |
#include <Wire.h> void setup() { Wire.begin(); // SDA = D4, SCL = D5 Wire.setClock(400000); // 400kHz fast mode } void loop() {} |
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.
Also Read
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 Default SPI Pins: D8 (SCK), D9 (MISO), D10 (MOSI), and D3 (SS).
| Signal | Pin | GPIO | Note |
|---|---|---|---|
| SCK | D8 | GPIO8 | Also analog comparator input 0 |
| MISO | D9 | GPIO9 | Also analog comparator input 1 |
| MOSI | D10 | GPIO10 | |
| SS (CS) | D3 | GPIO7 | A 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:
| Pad | GPIO / Net | Functions | Note |
|---|---|---|---|
| MTMS | GPIO2 | JTAG TMS, A1 (ADC1_CH1), LP I2C SDA, LP GPIO2 | Strapping pin |
| MTDI | GPIO3 | JTAG TDI, A2 (ADC1_CH2), LP I2C SCL, LP GPIO3 | Strapping pin |
| MTCK | GPIO4 | JTAG TCK, A3 (ADC1_CH3), LP UART RX, LP GPIO4 | |
| MTDO | GPIO5 | JTAG TDO, A4 (ADC1_CH4), LP UART TX, LP GPIO5 | |
| BOOT | GPIO28 | BOOT button, strapping pin | 10kΩ pull-up |
| EN | CHIP_PU | Reset (RESET button) | Pull LOW to reset; 10kΩ pull-up |
| 3V3 | 3.3v | 3.3v rail | |
| GND | GND | Ground | |
| BAT+ / BAT− | VBAT | LiPo battery | 200mA 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.

| Pin | GPIO | Strapping Role | On the Board |
|---|---|---|---|
| D2 | GPIO25 | SDIO slave sampling edge (with MTDI) | Floating |
| D3 | GPIO7 | JTAG source (only if EFUSE_JTAG_SEL_ENABLE is burnt) | Floating, default SPI SS |
| BOOT button | GPIO28 | HIGH = boot from flash, LOW = download mode | 10kΩ pull-up |
| User LED | GPIO27 | Download-mode select; HIGH also enables the ROM log on UART0 | 1.5kΩ + LED to 3.3v |
| (battery sense) | GPIO26 | Download-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.
| Part | Pin / Connection | What It Does |
|---|---|---|
| User LED “L” (yellow) | GPIO27 | LED_BUILTIN, active LOW: digitalWrite(LED_BUILTIN, LOW) turns it on |
| Charge LED “C” (red) | Charger NCHG output | Blinks while charging, on for ~51s when full, then off; not software-controlled |
| RESET button “R” | CHIP_PU (EN) | Resets the chip |
| BOOT button “B” | GPIO28 | Hold at reset for download mode; readable as a button in your sketch |
| U.FL connector | LFD182G45 diplexer | The only antenna connection, for both 2.4GHz and 5GHz |
| 48MHz crystal | XTAL_P/N | Main 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 Name | Pin | Default |
|---|---|---|
Serial | USB-C | USB CDC to the Serial Monitor |
Serial0 | D6 (TX), D7 (RX) | UART0 |
Wire | D4 (SDA), D5 (SCL) | I2C0 |
SPI | D8 / D9 / D10, SS = D3 | SPI2 |
LED_BUILTIN | GPIO27 | Yellow LED, active LOW |
A0–A4 | D0, then the MTMS/MTDI/MTCK/MTDO pads | GPIO1–GPIO5 |
BAT_VOLT_PIN / BAT_VOLT_PIN_EN | GPIO6 / GPIO26 | Battery 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.
Also Read
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:
| Feature | XIAO ESP32-C5 | XIAO ESP32-C6 | XIAO ESP32-C3 |
|---|---|---|---|
| SoC / clock | ESP32-C5, 240MHz | ESP32-C6, 160MHz | ESP32-C3, 160MHz |
| Wi-Fi | Wi-Fi 6, 2.4GHz + 5GHz | Wi-Fi 6, 2.4GHz | Wi-Fi 4, 2.4GHz |
| Thread / Zigbee | Yes (802.15.4) | Yes (802.15.4) | No |
| Memory | 384KB SRAM, 8MB PSRAM, 8MB flash | 512KB SRAM, 4MB flash | 400KB SRAM, 4MB flash |
| Analog pins on the edge | 1 (D0) + 4 back pads | 3 (D0–D2) | 4 (D0–D3, D3 on ADC2) |
| Antenna | U.FL only | Ceramic + U.FL (RF switch) | U.FL only |
| User LED | GPIO27 | GPIO15 | none |
| Battery voltage sense | Built in (GPIO6) | No | No |
| D0 / D1 GPIOs | GPIO1 / GPIO0 | GPIO0 / GPIO1 | GPIO2 / 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)
| Pin | Label | GPIO | Main Functions | All Alternate Functions | 5v Tolerant | Description |
|---|---|---|---|---|---|---|
| 1 | D0 / A0 | GPIO1 | ADC1_CH0, GPIO | LP_GPIO1, LP_UART_DSRN, XTAL_32K_N | No (3.3v) | The only analog input on the edge, and a deep-sleep wake pin. |
| 2 | D1 | GPIO0 | GPIO | LP_GPIO0, LP_UART_DTRN, XTAL_32K_P | No (3.3v) | A general-purpose pin that can wake the chip from deep sleep; note it is GPIO0, not GPIO1. |
| 3 | D2 | GPIO25 | GPIO, strap | – | No (3.3v) | A strapping pin (SDIO sampling edge); safe for normal use without strong pulls at reset. |
| 4 | D3 | GPIO7 | SPI SS, strap | SDIO_DATA1, FSPID | No (3.3v) | The default SPI chip select, and a strapping pin that only matters if the JTAG-select eFuse is burnt. |
| 5 | D4 | GPIO23 | I2C SDA (Wire) | – | No (3.3v) | The default I2C data pin. |
| 6 | D5 | GPIO24 | I2C SCL (Wire) | – | No (3.3v) | The default I2C clock pin. |
| 7 | D6 | GPIO11 | UART0 TX (Serial0) | U0TXD | No (3.3v) | UART0 transmit, with a 499Ω series resistor; it prints the ROM boot log at reset. |
| 8 | D7 | GPIO12 | UART0 RX (Serial0) | U0RXD | No (3.3v) | UART0 receive. |
| 9 | D8 | GPIO8 | SPI SCK | SDIO_DATA0, PAD_COMP0 | No (3.3v) | The default SPI clock pin, also an analog comparator input. |
| 10 | D9 | GPIO9 | SPI MISO | SDIO_CLK, PAD_COMP1 | No (3.3v) | The default SPI data-in pin, also an analog comparator input. |
| 11 | D10 | GPIO10 | SPI MOSI | SDIO_CMD, FSPICS0 | No (3.3v) | The default SPI data-out pin. |
| 12 | 3V3 | – | 3.3v output | – | – | The 3.3v rail from the SGM6029 buck converter, for sensors and modules. |
| 13 | GND | – | Ground | – | – | Ground. |
| 14 | 5V | – | 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)
| Pin | Label | GPIO | Main Functions | All Alternate Functions | 5v Tolerant | Description |
|---|---|---|---|---|---|---|
| TP7 | MTMS | GPIO2 | JTAG TMS, A1 | ADC1_CH1, LP_GPIO2, LP_UART_RTSN, LP_I2C_SDA, FSPIQ | No (3.3v) | JTAG pin, second ADC input and LP I2C data; also a strapping pin. |
| TP6 | MTDI | GPIO3 | JTAG TDI, A2 | ADC1_CH2, LP_GPIO3, LP_UART_CTSN, LP_I2C_SCL | No (3.3v) | JTAG pin, third ADC input and LP I2C clock; also a strapping pin. |
| TP5 | MTCK | GPIO4 | JTAG TCK, A3 | ADC1_CH3, LP_GPIO4, LP_UART_RXD, FSPIHD | No (3.3v) | JTAG pin, fourth ADC input and LP UART receive. |
| TP4 | MTDO | GPIO5 | JTAG TDO, A4 | ADC1_CH4, LP_GPIO5, LP_UART_TXD, FSPIWP | No (3.3v) | JTAG pin, fifth ADC input and LP UART transmit. |
| TP2 | BOOT | GPIO28 | BOOT button | strap | No (3.3v) | The BOOT button line (10kΩ pull-up); LOW at reset enters download mode. |
| TP8 | EN | CHIP_PU | Reset | – | – | Chip enable; pull it LOW to reset the board. |
| TP1 | 3V3 | – | 3.3v | – | – | The 3.3v rail. |
| TP3 | GND | – | 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.
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.








