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

The 8x8 WS2812B matrix takes 5 V from the Raspberry Pi Pico's VBUS and its data from GP0 through a 74AHCT125 buffer and a 470 Ohm resistor, driven by Adafruit NeoPixel, which on the RP2040 generates the 800 kHz signal with a PIO state machine. Two board-specific limits apply: USB current and the 3.3 V data level.
Wiring the WS2812B RGB Matrix 8×8 to the Raspberry Pi Pico
Pin by pin.
| 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 |
- VCC is on VBUS, which gives about 5 V only while the board is powered from USB.
- 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.
What to know on the Raspberry Pi Pico
- Adafruit NeoPixel times the WS2812B data with one of the RP2040's PIO state machines; the chip has two PIO blocks with eight state machines in all, so other PIO uses can run beside it.Raspberry Pi Pico datasheet, release 21, p. 4; arduino-pico core documentation (Earle Philhower)
- The data input reads high at 0.7 x VDD, about 3.5 V on a 5 V supply, so the Pico's 3.3 V on GP0 is below spec. It often works on short wires, but the page's wiring adds a 74AHCT125 buffer powered from 5 V to make it reliable. A BSS138 logic level converter is too slow for this signal.WS2812B datasheet, p. 3
- All 64 pixels at full white can draw about 3.84 A, far beyond a USB port on VBUS; the sketch keeps setBrightness(25), about 0.38 A. For more, use an external 5 V supply with a common ground.Adafruit NeoPixel Uberguide; Raspberry Pi Pico datasheet, release 21, p. 8
- VBUS is 0 V when the Pico runs without USB, so a battery build needs the matrix on its own 5 V supply.Raspberry Pi Pico datasheet, release 21, p. 8
WS2812B RGB Matrix 8×8 code for the Raspberry Pi Pico
Compiled for rp2040:rp2040:rpipico on 2026-10-30.
// WS2812B RGB Matrix 8×8 on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/ws2812b-matrix-8x8/raspberry-pi-pico
#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);
}
WS2812B RGB Matrix 8×8 on the Raspberry Pi Pico: questions
Can a Raspberry Pi Pico drive a WS2812B matrix?
Yes. Adafruit NeoPixel drives it from any GPIO using the RP2040's PIO (Pico datasheet, p. 4). Its 3.3 V data is below the 3.5 V the WS2812B asks at 5 V (WS2812B datasheet, p. 3), so the page's wiring adds a 74AHCT125 for reliability.
How bright can the matrix go on the Pico's USB power?
Keep it low, as the sketch's setBrightness(25) does: full white on 64 pixels is about 3.84 A (Adafruit Uberguide), far past USB. Use an external 5 V supply for more.
Why are the colours wrong or flickering?
Check GRB order (NEO_GRB), DIN not DOUT, the common ground, and the data level: a 3.3 V signal below 0.7 x VDD causes glitches (WS2812B datasheet, p. 3).
Keep going
This guide as plain Markdown. /components/ws2812b-matrix-8x8/raspberry-pi-pico.md