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

An 8x8 WS2812B matrix is 64 pixels on one data line from the Arduino Uno's D2, and on the Uno two limits show at once: power and timing. Full white could draw about 3.84 A, far beyond the Uno, and each refresh holds the Uno's interrupts off for nearly 2 ms.
Wiring the WS2812B RGB Matrix 8×8 to the Arduino Uno
Pin by pin.
| WS2812B RGB Matrix 8×8 | Arduino Uno | Note |
|---|---|---|
| VCC | 5V | |
| GND | GND | |
| DIN | D2 | through 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.
What to know on the Arduino Uno
- At the sketch's setBrightness(25), full white on all 64 pixels comes to about 0.38 A (3.84 A × 25 / 255), under the Uno's 500 mA USB polyfuse with the board's own draw on top. Any brighter image needs an external 5 V supply on the matrix with GND shared with the Uno.Adafruit NeoPixel Uberguide; Arduino UNO R3 documentation, USB overcurrent protection
- Each show() sends 64 × 24 bits at 800 kbps, about 1.9 ms, with interrupts disabled. The Uno's millis() counter ticks every 1.024 ms, so every refresh can lose a tick, and at the sketch's 30 ms frame rate millis() runs measurably slow.Worldsemi WS2812B datasheet; Adafruit NeoPixel Uberguide
- The library keeps 3 bytes per pixel, 192 bytes of the Uno's 2 KB SRAM for this matrix, leaving room for text and animation logic but not for a second off-screen frame of floats.Arduino UNO R3 tech specs
- The matrix is addressed row by row: xy(x, y) = y × 8 + x in the sketch. Some panels wire alternate rows backwards; if every other row is mirrored, swap x on odd rows.Adafruit NeoPixel Uberguide, NeoMatrix library
WS2812B RGB Matrix 8×8 code for the Arduino Uno
Compiled for arduino:avr:uno on 2026-10-30.
// WS2812B RGB Matrix 8×8 on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/ws2812b-matrix-8x8/arduino-uno
#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);
}
WS2812B RGB Matrix 8×8 on the Arduino Uno: questions
Can an Arduino Uno power an 8x8 WS2812B matrix from USB?
Only dimmed, as the sketch does. Full white is about 3.84 A (Adafruit Uberguide); setBrightness(25) brings it to about 0.38 A, inside the Uno's 500 mA USB limit. For more light, feed the matrix from an external 5 V supply and share GND.
Why does millis() run slow with a WS2812B matrix on my Uno?
show() disables interrupts for about 1.9 ms per refresh of 64 pixels, longer than one millis() tick. Refresh only when the image changes, or keep time with an RTC.
How much Uno memory does a 64 LED matrix use?
About 192 bytes for the pixel buffer (3 bytes per pixel), under a tenth of the Uno's 2 KB of SRAM.
Keep going
This guide as plain Markdown. /components/ws2812b-matrix-8x8/arduino-uno.md