Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

WS2812B LED strip with Seeed XIAO ESP32C3

Drive a WS2812B strip from D10 of a Seeed XIAO ESP32C3 through 330 Ω, with the strip on its own 5 V supply and a common ground.

Arduino C++Verified — core esp32 3.3.12, Adafruit NeoPixel 1.15.5, 3 Nov 2026Compile-only

Community draft — report a mistake

A XIAO ESP32C3 is small enough to hide inside a lamp or a Diwali light controller, and a WS2812B strip gives it every colour. Data goes from D10 through 330 Ω; power comes from a separate 5 V adapter with a common ground.

The sketch runs an orange comet along a 30-LED strip at about 25 % brightness.

Wiring

XIAO ESP32C3Only the pins used are shown · 3.3 V logic5 V 2 A adapterWS2812B addressable RGB LED strip (NeoPixel)330 Ω+5VGNDGNDD10DIN5VGNDDOUT (not connected)
Also needed: 330 Ω resistor, 1000 µF / 10 V capacitor, 5 V 2 A adapter.
Every connection
XIAO ESP32C3WS2812B addressable RGB LED strip (NeoPixel)WireNotes
D10DINgreenVia 330 Ω
5 V 2 A adapter · +5V5Vred1000 µF capacitor across 5V/GND at the strip.
5 V 2 A adapter · GNDGNDblack
GNDGNDblackCommon ground with the XIAO.

5 V (about 60 mA per LED at full white) part, 3.3 V board. The strip expects a data HIGH of about 3.5 V at 5 V supply. From ESP32 or Pico the 3.3 V signal often works with short wires, but to be safe drive DIN through a 74AHCT125 (or 74HCT125) powered from 5 V.

Board quirks

  • D10 (GPIO10) has no boot role, so the strip stays dark during reset. Avoid D8/D9 (strapping) and D6 (TX, prints boot messages).
  • The XIAO’s 3V3 pin can’t feed LEDs, and its 5V pin is just USB power — too little for a strip. Use a separate supply and join the grounds.
  • On battery power (BAT pads), a strip is out of the question without its own supply: even 10 LEDs at full white draw more than the cell and regulator should give.

Code

ws2812b-xiaoc3.inoArduino C++Open in PlaygroundOpen in PlaygroundFlash
// WS2812B strip on a Seeed XIAO ESP32C3.
// DIN → D10 (GPIO10) through 330 Ω. Strip 5V/GND → its own 5 V supply; supply GND → XIAO GND.
#include <Adafruit_NeoPixel.h>

constexpr uint16_t COUNT = 30;
Adafruit_NeoPixel strip(COUNT, D10, NEO_GRB + NEO_KHZ800);

void setup() {
  Serial.begin(115200);
  delay(1500);
  strip.begin();
  strip.setBrightness(60);
  strip.show();
  Serial.printf("WS2812B: %u LEDs on D10\n", COUNT);
}

void loop() {
  // A "comet" running along the strip
  static uint16_t head = 0;
  for (uint16_t i = 0; i < COUNT; i++) {
    uint16_t d = (head + COUNT - i) % COUNT;
    uint8_t v = d < 8 ? 255 >> d : 0;
    strip.setPixelColor(i, strip.Color(v, v / 3, 0));
  }
  strip.show();
  head = (head + 1) % COUNT;
  delay(40);
}

Library: Adafruit NeoPixel (Adafruit) — compiled with Adafruit NeoPixel 1.15.5.

Expected serial output

Serial Monitor · 115200Output
WS2812B: 30 LEDs on D10

Common errors

First LED flickers or wrong colours

Marginal 3.3 V data. Keep the 330 Ω resistor close to the strip and the data wire short, or add a 74AHCT125 buffer.

XIAO resets when LEDs light

The strip shares the XIAO’s supply. Give it its own. Brownout fix.

↑↓ to move · Enter to open