All wiring guides

Free wiring guides

Wire the WS2812 LED stick to the ESP32-C3

WS2812 LED stick, 8 LEDs. Eight coloured LEDs in a row: a bar that fills up.

When buying: Wire to the end marked DIN.

Which pin goes where

On the partOn the ESP32-C3
GNDGND
DINGPIO 4
5V5V

Wire it with the USB cable unplugged. Follow the names printed on your own part: makers sometimes reorder the pins.

In 3D

Example sketch

// WS2812 LED stick, 8 LEDs
// on the ESP32-C3 Super Mini
// https://stem.manusignal.com/en/parts/ws2812-led-stick-esp32-c3
#include <Adafruit_NeoPixel.h>

const int PIN_DIN = 4;

const int LED_COUNT = 8;
Adafruit_NeoPixel pixels(LED_COUNT, PIN_DIN, NEO_GRB + NEO_KHZ800);
uint16_t hue = 0;

void setup() {
  pixels.begin();
  pixels.setBrightness(50);
}

void loop() {
  for (int i = 0; i < LED_COUNT; i++) {
    pixels.setPixelColor(i, pixels.gamma32(pixels.ColorHSV(hue + i * (65536 / LED_COUNT))));
  }
  pixels.show();
  hue += 256;
  delay(20);
}
  • Tools > Board > ESP32C3 Dev Module (USB CDC On Boot: Enabled), then Tools > Port and choose the board's port.
  • Adafruit NeoPixel: install it from Sketch > Include Library > Manage Libraries.

This sketch is compiled for the board before the page is published. It has not been run on real hardware by us.

What you should see

A rainbow moves along the LEDs.

If it does not work

The LEDs stay dark.
The data wire must go to the pad marked DIN (or DI), not DOUT. Power comes from 5V.
The colours flicker or are wrong.
Keep the data wire shorter than 20 cm, and check the LED count in the sketch matches your part.

The same part on the ESP32-S3

Build something with it

These Build Packs use this part on this board, with the same pins.

More parts on the ESP32-C3