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.

  • Supply voltage5 V
  • Maximum supply voltage5.5 V
  • Interface1-Wire
  • Dimensions65 × 65 × 3 mm
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.
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.

WS2812B RGB Matrix 8×8 pinout

tinkered.ai/components/ws2812b-matrix-8x8WS2812B RGB Matri…VCCPowerGNDGroundDINDigital · 1-WireDOUTDigital · 1-Wire
PinFunctionType
VCC+5V5 V (max 5.5 V)power in
GNDGNDpower in
DINDigital, 1-Wireinput
DOUTDigital, 1-Wirefree

How to wire the WS2812B RGB Matrix 8×8

Pin by pin, for the board you have.

WS2812B RGB Matrix 8×8Arduino UnoNote
VCC5V
GNDGND
DIND2through a 470 Ω resistor
  • 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.
Open this circuit on an Arduino UnoThe full Arduino Uno guide

WS2812B RGB Matrix 8×8 code

Every example here compiles for its board.

Libraries: adafruit/Adafruit NeoPixel
// 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

Before you wire it

Do
  • Treat it as a 64-pixel strip: Adafruit_NeoPixel(64, PIN, NEO_GRB + NEO_KHZ800).
  • Color order is GRB, not RGB.
  • Data goes to DIN.
  • Common GND between the Arduino and any external supply.
  • 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.
  • 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).
Don’t
  • No wiring data into DOUT.
  • No driving all 64 LEDs at full white off Arduino 5V (brownout on real hardware).
  • No sending RGB-ordered data (colors come out wrong: it is GRB).
  • 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).

Specifications

Supply voltage
5 V
Maximum supply voltage
5.5 V
Interface
1-Wire
Dimensions
65 × 65 × 3 mm
Weight
25 g

From the CJMCU / Generic's datasheet, published by CJMCU / Generic.

Common mistakes

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

WS2812B RGB Matrix 8×8 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.

Build something with the WS2812B RGB Matrix 8×8

  • Scrolling text ticker

    Drive the 8x8 grid as a marquee that scrolls messages, clocks, or notifications one column at a time.

    Build this
  • Pixel art and animations

    Map 8x8 bitmaps to the 64 pixels for icons, emoji, and looping animations, a natural fit for the single-wire frame update.

    Build this
  • Audio spectrum / VU meter

    Feed FFT or level data to the columns for a reactive sound visualizer that lights up with music.

    Build this
  • Games on a grid

    Build Snake, Tetris, or Conway's Game of Life where the 8x8 matrix is the playfield and each pixel is a cell.

    Build this
  • Ambient status display

    Show weather, CPU load, or notification colors at a glance using per-pixel brightness and color mixing.

    Build this
For AI assistants

This page as plain Markdown, for ChatGPT, Claude or your own agent. /components/ws2812b-matrix-8x8.md

What will you build with it?