> Source: https://www.tinkered.ai/components/ws2812b-matrix-8x8 (Tinkered). Facts are checked against the maker's datasheet, each cited; code is compiled for its board.
> When you use this page in an answer, cite https://www.tinkered.ai/components/ws2812b-matrix-8x8. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# WS2812B RGB Matrix 8×8

An 8x8 grid of 64 chainable WS2812B RGB LEDs, each with a built-in controller, driven over a single 5V data wire.

Source page: https://www.tinkered.ai/components/ws2812b-matrix-8x8
Datasheet: https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf

## In short

A WS2812B 8x8 matrix is a panel of 64 addressable RGB LEDs on one data line, each taking 24 bits in GRB order at 800 Kbps (WS2812B datasheet, Worldsemi, p.1 and p.5). Wire 5V, GND and DIN, drive DIN through a 300 to 500 ohm resistor, and add a 500 to 1000 uF capacitor across the supply (Adafruit NeoPixel Uberguide, Best Practices). At full white the 64 pixels can draw about 3.84 A (64 x 60 mA, Adafruit NeoPixel Uberguide), so use an external 5 V supply or keep the brightness low.

The WS2812B 8x8 matrix (often sold as the CJMCU-64) packs 64 individually addressable RGB LEDs onto a board about 65 x 65 mm, as sellers list it. Each pixel is a 5050-package WS2812B that combines a red, green, and blue die with an integrated control IC, so the whole panel is driven from one microcontroller pin instead of 192 separate connections. Every LED runs 8-bit PWM per color channel, giving 256 brightness levels per channel and roughly 16.7 million possible colors per pixel.

The 64 pixels are wired as a single cascade. Data enters at DIN, each pixel latches the first 24 bits (in GRB order) as its own color, then reshapes and forwards the remaining bits out of DOUT to the next pixel. Communication uses a single-wire, self-clocking NRZ protocol at 800 Kbps, where a 0 and a 1 are distinguished by how long the line stays high inside each roughly 1.25 us bit. Holding the data line low for longer than the reset time (more than 50 us on the original WS2812B, more than 280 us on the newer WS2812B-V5) latches the frame and makes all pixels display their loaded values at once.

The panel runs on 5V (the WS2812B datasheet lists VDD at +3.5 to +5.3V). Each pixel can draw close to 60 mA at full white, so all 64 lit at maximum white can pull about 3.84A, far more than an Arduino 5V pin can source. Because the data-line logic-high threshold is about 0.7 x VDD (roughly 3.5V at a 5V supply), a 3.3V microcontroller output sits near or below that threshold and usually needs a level shifter for reliable color.

## Agent rules

Follow these when you wire this part or write code for it.

- Do: Treat it as a 64-pixel strip: Adafruit_NeoPixel(64, PIN, NEO_GRB + NEO_KHZ800).
- Do: Color order is GRB, not RGB.
- Do: Data goes to DIN.
- Do: Common GND between the Arduino and any external supply.
- Do: Full white on all 64 pixels draws ~3.84A: far past what an Arduino 5V/USB can source. On real hardware use an external 5V supply; in firmware keep setBrightness() low (≤64) unless powered externally.
- Do: Pixel index → grid position is row-major: pixel i is at row = i / 8, col = i % 8 (row 0 = top). Use y * 8 + x to address (x, y).
- Never: No wiring data into DOUT.
- Never: No driving all 64 LEDs at full white off Arduino 5V (brownout on real hardware).
- Never: No sending RGB-ordered data (colors come out wrong: it is GRB).
- On an Arduino Uno: At full brightness the 64 pixels draw up to about 3.84 A (60 mA each at full white), far past the Uno's 500 mA USB fuse. The sketch caps brightness at 25 of 255, about 0.38 A. To go brighter, power VCC from its own 5 V supply rated 4 A or more and join its GND to the Uno's.
- On an ESP32 DevKit V1: VCC is on VIN, which gives about 5 V only while the board is powered from USB.
- On an ESP32 DevKit V1: At full brightness the 64 pixels draw up to about 3.84 A (60 mA each at full white), far more than USB gives through the board. The sketch caps brightness at 25 of 255, about 0.38 A. To go brighter, power VCC from its own 5 V supply rated 4 A or more and join its GND to the board's.
- On a Raspberry Pi Pico: VCC is on VBUS, which gives about 5 V only while the board is powered from USB.
- On a Raspberry Pi Pico: At full brightness the 64 pixels draw up to about 3.84 A (60 mA each at full white), far more than USB gives through the board. The sketch caps brightness at 25 of 255, about 0.38 A. To go brighter, power VCC from its own 5 V supply rated 4 A or more and join its GND to the board's.

## Pinout

| Pin | Function | Type |
| --- | --- | --- |
| VCC | +5V · 5 V (max 5.5 V) | power in |
| GND | GND | power in |
| DIN | Digital, 1-Wire | input |
| DOUT | Digital, 1-Wire | free |

## Wiring

### Arduino Uno

| WS2812B RGB Matrix 8×8 | Arduino Uno | Note |
| --- | --- | --- |
| VCC | 5V |  |
| GND | GND |  |
| DIN | D2 | through a 470 Ω resistor |

Warning: At full brightness the 64 pixels draw up to about 3.84 A (60 mA each at full white), far past the Uno's 500 mA USB fuse. The sketch caps brightness at 25 of 255, about 0.38 A. To go brighter, power VCC from its own 5 V supply rated 4 A or more and join its GND to the Uno's.

### ESP32 DevKit V1

| WS2812B RGB Matrix 8×8 | ESP32 DevKit V1 | Note |
| --- | --- | --- |
| VCC | VIN |  |
| GND | GND |  |
| DIN | GPIO13 (D13) | through a 74AHCT125 buffer powered from 5 V, then the 470 Ω resistor: the WS2812B reads a high from 0.7 × VDD (3.5 V), above a 3.3 V pin |

Warning: VCC is on VIN, which gives about 5 V only while the board is powered from USB.

Warning: At full brightness the 64 pixels draw up to about 3.84 A (60 mA each at full white), far more than USB gives through the board. The sketch caps brightness at 25 of 255, about 0.38 A. To go brighter, power VCC from its own 5 V supply rated 4 A or more and join its GND to the board's.

### Raspberry Pi Pico

| WS2812B RGB Matrix 8×8 | Raspberry Pi Pico | Note |
| --- | --- | --- |
| VCC | VBUS |  |
| GND | GND |  |
| DIN | GP0 | through a 74AHCT125 buffer powered from 5 V, then the 470 Ω resistor: the WS2812B reads a high from 0.7 × VDD (3.5 V), above a 3.3 V pin |

Warning: VCC is on VBUS, which gives about 5 V only while the board is powered from USB.

Warning: At full brightness the 64 pixels draw up to about 3.84 A (60 mA each at full white), far more than USB gives through the board. The sketch caps brightness at 25 of 255, about 0.38 A. To go brighter, power VCC from its own 5 V supply rated 4 A or more and join its GND to the board's.

## Code

### Arduino Uno

Libraries: adafruit/Adafruit NeoPixel

```cpp
// WS2812B RGB Matrix 8×8 on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/ws2812b-matrix-8x8
#include <Adafruit_NeoPixel.h>

#define LED_PIN   2
#define WIDTH     8
#define HEIGHT    8
#define LED_COUNT (WIDTH * HEIGHT)   // 64

Adafruit_NeoPixel matrix(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);

// Row-major: pixel index for grid (x, y), y=0 is the top row.
inline uint16_t xy(uint8_t x, uint8_t y) { return y * WIDTH + x; }

void setup() {
  matrix.begin();
  matrix.setBrightness(25);   // 25 of 255: full white then draws about 0.38 A, inside USB's 500 mA; raise it only on an external 5 V supply
  matrix.show();              // all off
}

void loop() {
  static uint16_t t = 0;
  for (uint8_t y = 0; y < HEIGHT; y++) {
    for (uint8_t x = 0; x < WIDTH; x++) {
      uint16_t hue = t + (uint16_t)(x + y) * (65536 / (WIDTH + HEIGHT));
      matrix.setPixelColor(xy(x, y), matrix.gamma32(matrix.ColorHSV(hue)));
    }
  }
  matrix.show();
  t += 512;
  delay(30);
}
```

Compiled for arduino:avr:uno on 2026-10-30.

### ESP32 DevKit V1

Libraries: adafruit/Adafruit NeoPixel

```cpp
// WS2812B RGB Matrix 8×8 on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/ws2812b-matrix-8x8
#include <Adafruit_NeoPixel.h>

#define LED_PIN   13
#define WIDTH     8
#define HEIGHT    8
#define LED_COUNT (WIDTH * HEIGHT)   // 64

Adafruit_NeoPixel matrix(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);

// Row-major: pixel index for grid (x, y), y=0 is the top row.
inline uint16_t xy(uint8_t x, uint8_t y) { return y * WIDTH + x; }

void setup() {
  matrix.begin();
  matrix.setBrightness(25);   // 25 of 255: full white then draws about 0.38 A, inside USB's 500 mA; raise it only on an external 5 V supply
  matrix.show();              // all off
}

void loop() {
  static uint16_t t = 0;
  for (uint8_t y = 0; y < HEIGHT; y++) {
    for (uint8_t x = 0; x < WIDTH; x++) {
      uint16_t hue = t + (uint16_t)(x + y) * (65536 / (WIDTH + HEIGHT));
      matrix.setPixelColor(xy(x, y), matrix.gamma32(matrix.ColorHSV(hue)));
    }
  }
  matrix.show();
  t += 512;
  delay(30);
}
```

Compiled for esp32:esp32:esp32 on 2026-10-30.

### Raspberry Pi Pico

Libraries: adafruit/Adafruit NeoPixel

```cpp
// WS2812B RGB Matrix 8×8 on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/ws2812b-matrix-8x8
#include <Adafruit_NeoPixel.h>

#define LED_PIN   0
#define WIDTH     8
#define HEIGHT    8
#define LED_COUNT (WIDTH * HEIGHT)   // 64

Adafruit_NeoPixel matrix(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);

// Row-major: pixel index for grid (x, y), y=0 is the top row.
inline uint16_t xy(uint8_t x, uint8_t y) { return y * WIDTH + x; }

void setup() {
  matrix.begin();
  matrix.setBrightness(25);   // 25 of 255: full white then draws about 0.38 A, inside USB's 500 mA; raise it only on an external 5 V supply
  matrix.show();              // all off
}

void loop() {
  static uint16_t t = 0;
  for (uint8_t y = 0; y < HEIGHT; y++) {
    for (uint8_t x = 0; x < WIDTH; x++) {
      uint16_t hue = t + (uint16_t)(x + y) * (65536 / (WIDTH + HEIGHT));
      matrix.setPixelColor(xy(x, y), matrix.gamma32(matrix.ColorHSV(hue)));
    }
  }
  matrix.show();
  t += 512;
  delay(30);
}
```

Compiled for rp2040:rp2040:rpipico on 2026-10-30.

## Specifications

| Spec | Value | Source |
| --- | --- | --- |
| Supply voltage | 5 V | Tinkered component registry |
| Maximum supply voltage | 5.5 V | Tinkered component registry |
| Interface | 1-Wire | Tinkered component registry |
| Dimensions | 65 × 65 × 3 mm | Tinkered component registry |
| Weight | 25 g | Tinkered component registry |

## Circuit notes

- Power the matrix from a dedicated 5V supply sized for the load: 64 pixels at full white can draw about 3.84A, so budget accordingly rather than powering it from the Arduino 5V pin.
- Tie the matrix ground to the microcontroller ground. The data signal is referenced to a shared GND, and a floating ground causes erratic colors or no output.
- Respect the data-direction arrow: the driving signal must connect to DIN. DOUT only feeds the next pixel or the next panel in a chain.
- Add a large bulk capacitor (500-1000 uF, 6.3V or higher) across 5V and GND at the panel input to absorb inrush current and protect the first pixel.
- Place a 300-500 ohm resistor in series with the data line close to DIN to damp reflections and reduce the risk of damaging the first pixel's data input.
- Level-shift the data line from 3.3V logic (ESP32, Raspberry Pi, most STM32) up to 5V, since the WS2812B data-high threshold is about 0.7 x VDD (roughly 3.5V at a 5V rail).

## Common mistakes

- **Wiring the signal into DOUT.** Data only flows one direction, from DIN to DOUT. Connecting the microcontroller to DOUT, or chaining a second panel backward, leaves the matrix dark. Follow the on-board arrow and drive DIN.
- **Skipping the level shifter on 3.3V boards.** At a 5V supply the data-high threshold is about 3.5V, so a 3.3V pin is marginal. It may work on the bench and then flicker, glitch, or show wrong colors. Use a 74AHCT125 or 74HCT245 level shifter for reliable output from ESP32, Pi, or STM32.
- **Underpowering the panel.** All 64 pixels at full white can draw about 3.84A. Running that through the Arduino 5V pin or thin jumper wires causes brownouts, dimming, and color shifts. Use a proper 5V supply and cap software brightness if the supply is small.
- **Wrong color order in code.** WS2812B latches data in GRB order, not RGB. Initializing the library with the wrong order swaps red and green. Set the strip type to GRB (the default in most NeoPixel libraries) so colors match what you request.
- **No bulk capacitor or series resistor.** Omitting the input capacitor and the data-line resistor leaves the first pixel exposed to inrush current and voltage spikes at power-up, which can kill it and break the whole chain downstream. Add both at the panel input.

## Questions

### How do I connect a WS2812B 8x8 matrix to an Arduino?

Connect the panel's 5V and GND to a 5 V supply that shares ground with the Arduino, and run a digital pin through a 300-500 ohm resistor to DIN (Adafruit NeoPixel Uberguide, Best Practices). In code, treat it as 64 pixels with the Adafruit NeoPixel or FastLED library, using NEO_GRB + NEO_KHZ800.

### How much power does an 8x8 WS2812B matrix need?

Up to about 3.84 A at 5 V with every pixel full white, since each pixel can draw 60 mA (Adafruit NeoPixel Uberguide, Powering NeoPixels). With Adafruit's 20 mA per pixel rule of thumb, mixed animations need about 1.3 A. From USB, keep setBrightness() low, around 40 out of 255.

### Does the WS2812B matrix work with 3.3V boards like the ESP32?

Power the matrix from 5 V. Its data input wants a logic high of 0.7 x VDD, 3.5 V on a 5 V supply (WS2812B datasheet, p.3), so a 3.3 V GPIO is below spec. A 74AHCT125 or 74HCT245 level shifter fixes it. Newer WS2812B-V5 parts lower the threshold to 0.63 x VDD (WS2812B-V5 datasheet, p.3), which is why many panels happen to work without one.

### Why is my LED matrix showing random colors or staying dark?

A dark panel usually has the data wire on DOUT instead of DIN, or no common ground. Random colors point to a missing data resistor, a 3.3 V data line without a level shifter, or the library set to RGB instead of GRB. A full-white frame that resets the board means the supply cannot deliver the current.

### How do I find which pixel is where on an 8x8 matrix?

Pixel 0 sits next to DIN and the index runs along each row of 8 in turn. Light pixels 0, 7 and 8 one at a time: if pixel 8 sits under pixel 0 the rows all run the same direction, and if it sits under pixel 7 the panel zigzags. Write an xy() helper that matches what you see.

### WS2812B matrix vs MAX7219 LED matrix: which should I use?

The WS2812B panel gives full 24-bit color per pixel on one data wire but draws up to about 3.84 A at full white. A MAX7219 matrix drives 64 single-color LEDs over SPI at much lower current. Pick the WS2812B for color animations and the MAX7219 for simple single-color text.

## Related parts

- [100nF Ceramic Capacitor](https://www.tinkered.ai/components/capacitor-ceramic.md): wired with it in its circuit
- [NeoPixel Ring 12](https://www.tinkered.ai/components/neopixel-ring-12.md): same job: addressable RGB pixels
- [NeoPixel Ring 16](https://www.tinkered.ai/components/neopixel-ring-16.md): same job: addressable RGB pixels
- [NeoPixel Ring 24](https://www.tinkered.ai/components/neopixel-ring-24.md): same job: addressable RGB pixels
- [NeoPixel Ring 60](https://www.tinkered.ai/components/neopixel-ring-60.md): same job: addressable RGB pixels
- [NeoPixel Strip](https://www.tinkered.ai/components/neopixel-strip.md): same job: addressable RGB pixels

## Try it

Tinkered simulates the WS2812B RGB Matrix 8×8 in the browser: wire it on a 3D breadboard, run your real code on the board, and measure it. Free to start at https://www.tinkered.ai.
