LED Matrix
Interfacing WS2812B Matrix LED Matrix with Arduino Uno
What is the WS2812B Matrix?
The WS2812B matrix packs 64 individually addressable RGB LEDs into an 8x8 grid, each with its own driver chip built into the LED package, controlled entirely over a single data line using a timing-critical protocol (roughly 800kHz, NRZ-encoded). Unlike the MAX7219 matrix, there's no shared clock line — the timing is baked into the pulse widths on DIN — which means the library (FastLED or Adafruit NeoPixel) has to generate precisely-timed signals in software, and that timing sensitivity is the main practical difference to design around versus a driver-chip-based display.
Because every pixel can be any RGB color independently, this is the display to reach for when a project needs full-color pixel art, animated effects, or a VU meter — anything the monochrome MAX7219 matrix can't do. The tradeoff is power: at full brightness white, all 64 LEDs together can draw close to 4A, so anything beyond a few lit pixels at modest brightness needs a proper 5V supply rather than power pulled through the MCU's 5V pin.
Specifications
| Matrix size | 8 x 8 = 64 individually addressable RGB LEDs |
| LED type | WS2812B — driver chip integrated into each LED package |
| Operating voltage | 5 V DC (data logic level should also be 5V, or level-shifted from a 3.3V board) |
| Interface | Single-wire, timing-critical protocol (~800kHz NRZ) — not I2C/SPI |
| Max current draw | ~60 mA per LED at full white brightness — up to ~3.8A for the full 64-LED panel |
| Cascading | DOUT chains into the next panel's DIN for larger combined displays |
WS2812B Matrix Pinout
| Pin | Name | Description |
|---|---|---|
| 1 | 5V | Power, 5V DC — use an adequately-rated external supply for anything beyond a few lit pixels |
| 2 | GND | Ground — must be common with the MCU ground |
| 3 | DIN | Data in — timing-critical single-wire signal, connect to a digital GPIO |
| 4 | DOUT | Data out — connect to the next panel's DIN when chaining multiple matrices |
DIN is timing-sensitive: on 3.3V boards (ESP32, Raspberry Pi) many panels still register a 3.3V HIGH correctly at short wire lengths, but a proper level shifter to 5V logic is the reliable fix if you see flickering or wrong colors on the first few pixels. Always add a large decoupling capacitor (~1000µF) across 5V/GND near the panel's power input, and a small series resistor (~300-500Ω) on DIN close to the panel — both are standard NeoPixel-family recommendations that prevent power-on glitches and data-line ringing from corrupting the first pixel's color.
Setting Up WS2812B Matrix with Arduino Uno
Library
Adafruit NeoPixel by Adafruit
Library Manager → search "Adafruit NeoPixel" → install
Wiring
| Component pin | Arduino Uno pin | Note |
|---|---|---|
| 5V | External 5V supply | Do not power more than a handful of pixels from the Uno's 5V pin — use an external supply rated for the full panel |
| GND | GND | Must share ground with both the Uno and the external supply |
| DIN | D6 | Any digital pin |
Example code
A 330Ω resistor in series on the DIN line and a large (~1000µF) capacitor across 5V/GND on the strip are cheap insurance against power-on glitches.
Related Components
Related Guides & Projects

Arduino Uno R3 Pinout: Every Pin Explained (Digital, Analog, PWM, Power)
Complete Arduino Uno R3 pinout reference: all 14 digital pins, 6 analog inputs, PWM, UART, SPI, I2C, AREF, and power rails explained with wiring tips and common mistakes.

Ultimate Arduino Mega 2560 Pinout Guide: Complete Power & I/O Reference
Master the Arduino Mega 2560 pinout. Detailed reference for all 54 digital pins, 16 analog inputs, PWM, UARTs, SPI, I2C, interrupts, and power. Includes a printable table and practical wiring tips.

Interfacing HC-SR04 Ultrasonic Sensor with Arduino
Measure distance accurately using ultrasonic sound waves and an Arduino Uno — no complex math, no expensive hardware.
HC‑SR04 Ultrasound Distance Measurement with Arduino – Parking Alert (LCD & Buzzer)
Learn HC‑SR04 ultrasound distance measurement with Arduino Uno. Build a parking alert system with 16x2 LCD and buzzer – shows distance and beeps faster as you approach.