← All guides

How to wire a 64x64 HUB75 LED matrix to an ESP32 (pinout, power and the E pin)

A 64x64 LED panel and an ESP32 look like an easy weekend project. Then you plug in the ribbon cable and get a black panel, half an image, or colours in the wrong places.

I build Frame, a 64x64 LED frame that shows photos sent from a phone. Inside there's an ESP32-S3 driving a HUB75 panel with the ESP32-HUB75-MatrixPanel-DMA library, on a board I designed myself. This guide is the wiring I wish I'd had at the start: the pins I use, where they come from, how to power the panel, and what each typical failure usually means.

The short answer

What a 64x64 HUB75 panel is

HUB75 is the name of the 16 pin connector on the back of most indoor RGB LED panels. The panel has no memory of its own: you shift in one row of colour data, latch it, light it, and move to the next row, fast enough for your eye to see a steady image.

A 64x64 panel with 1/32 scan lights two rows at once, one in the top half and one in the bottom half. That's why there are two sets of colour pins: R1, G1 and B1 feed the top half, R2, G2 and B2 the bottom half. To choose which of the 32 row pairs is lit, the panel needs five address lines, A, B, C, D and E (2⁵ = 32). A 64x32 panel only needs 16 row pairs, so it uses four lines and leaves E out.

The panel in Frame is a 64x64, 1/32 scan panel with Chipone ICN2037BP driver chips. The library README lists the ICN2037 among the standard shift register drivers it works with, so I didn't need any special driver setting.

The HUB75 pins and the ESP32 GPIOs

Wiring diagram: 15 lines from ESP32-S3 GPIOs to the HUB75 input of the panel, a 5 V supply going straight to the panel power connector with a capacitor, and a common ground back to the ESP32

This is an illustration, not a photo of my board. The pin order on the physical connector changes between manufacturers, so always go by the labels printed next to the connector on your panel, and plug into the input (there's usually an arrow showing the direction).

HUB75 signal What it does ESP32-S3 (Frame v2) Classic ESP32 (library default)
R1, G1, B1 Colour data, top half 4, 5, 6 25, 26, 27
R2, G2, B2 Colour data, bottom half 7, 15, 16 14, 12, 13
A, B, C, D Row address 18, 8, 3, 42 23, 19, 5, 17
E Fifth row address (64 rows) 38 not set (-1)
CLK Clock for the colour data 41 16
LAT Latch: copies the shifted row to the LEDs 40 4
OE Output enable, active low: LEDs on when it's low 2 15
GND Ground GND GND

Where these numbers come from:

On the S3, don't move pins around at random: some GPIOs are taken by the flash and PSRAM on many modules. The library's S3 defaults already avoid them, and the S3 folder of the library includes a picture of the reserved pins.

Where the E pin is on the connector

On 64x32 panels, pin 8 of the connector is usually a ground. On many 64x64 panels that same position carries E, and on some it's pin 4 instead. The rpi-rgb-led-matrix wiring guide says E is "typically on Pin 4 or 8", and Adafruit's HUB75 boards for the Raspberry Pi have a jumper or a switch to choose between the two. So if you reuse an adapter or a cable made for 64x32 panels, check that E really reaches the panel and isn't tied to ground.

Power: the part that bites later

An LED panel can draw far more current than an ESP32 board can pass through. Some figures from manufacturers of 64x64 panels:

If your panel has no datasheet, you can estimate. With 1/32 scan only two rows are lit at any moment, so the peak is roughly 128 pixels at full white times the current of one pixel. Adafruit's guide for its matrix bonnet says each pixel can briefly draw up to 0.06 A at full white, which would give about 7.7 A in the absolute worst case. The manufacturers above rate their 64x64 panels at 4 A, so real panels stay well below that worst case; how far below depends on the current the driver chips are set to. Treat 4 A at 5 V as a reasonable figure for one 64x64 indoor panel, and if you want to be sure, measure the current on the 5 V line with the panel showing full white at full brightness.

What I'd do on any build:

What happened to me

The v2 board of Frame powers the ESP32-S3 and the panel from the same supply, and that supply runs close to its limit. It's close enough that my firmware disables the brownout detector on v2 on purpose, as the first line of setup().

On one unit, with poor Wi-Fi and heavy animation downloads, the frame chained crashes of different kinds: a spinlock assert inside the Wi-Fi interrupt, a LoadProhibited, an exception with a corrupted stack, and watchdog resets with no trace. I decoded the backtraces and none of them went through my own code, and the same firmware ran for hours without a crash on a good network. That pattern points to memory corruption from voltage drops, not to a software bug. I still have to confirm it by repeating the test with a stronger supply, so take it as a strong suspicion, not a proven cause.

What I've written down for the next board, and what I'd suggest if you design your own:

The library README also warns that the fast DMA signals can interfere with Wi-Fi on some board designs, so keeping the ribbon away from the antenna helps on both fronts.

Starter code

This is the minimum to light a 64x64 panel with the library on an ESP32-S3, with the same pins as the table. The field names are from the library source (HUB75_I2S_CFG in ESP32-HUB75-MatrixPanel-I2S-DMA.h).

#include <ESP32-HUB75-MatrixPanel-I2S-DMA.h>

#define PANEL_RES_X 64
#define PANEL_RES_Y 64
#define PANEL_CHAIN 1

MatrixPanel_I2S_DMA *dma_display = nullptr;

void setup() {
  HUB75_I2S_CFG mxconfig(PANEL_RES_X, PANEL_RES_Y, PANEL_CHAIN);

  mxconfig.gpio.r1 = 4;   mxconfig.gpio.g1 = 5;   mxconfig.gpio.b1 = 6;
  mxconfig.gpio.r2 = 7;   mxconfig.gpio.g2 = 15;  mxconfig.gpio.b2 = 16;
  mxconfig.gpio.a = 18;   mxconfig.gpio.b = 8;    mxconfig.gpio.c = 3;
  mxconfig.gpio.d = 42;   mxconfig.gpio.e = 38;   // E: required for 64x64
  mxconfig.gpio.clk = 41; mxconfig.gpio.lat = 40; mxconfig.gpio.oe = 2;

  mxconfig.clkphase = false;  // what my panel needs; try true if the image is shifted
  // mxconfig.driver = HUB75_I2S_CFG::FM6126A;  // only for panels with that chip

  dma_display = new MatrixPanel_I2S_DMA(mxconfig);
  dma_display->begin();
  dma_display->setBrightness8(64);  // 0 to 255; start low while testing
  dma_display->clearScreen();

  dma_display->drawRect(0, 0, 64, 64, dma_display->color565(255, 255, 255));
  dma_display->drawPixel(0, 0, dma_display->color565(255, 0, 0));    // top left: red
  dma_display->drawPixel(63, 63, dma_display->color565(0, 0, 255));  // bottom right: blue
}

void loop() {}

A few notes:

In PlatformIO, the library is mrfaptastic/ESP32 HUB75 LED MATRIX PANEL DMA Display in lib_deps, together with adafruit/Adafruit GFX Library. In the Arduino IDE, search for "ESP32 HUB75 LED MATRIX PANEL DMA Display" in the Library Manager.

Common problems and how to fix them

The panel stays black

Only half the panel lights, or the image repeats

This is almost always the E line. Either E isn't set in the config (it's -1 by default on the classic ESP32), it's wired to the wrong pin of the connector, or your adapter ties pin 8 to ground because it was made for 64x32 panels. Set mxconfig.gpio.e, follow the wire to the pin labelled E on your panel and check it with a multimeter.

If several rows light up at the same time and E is correct, your panel may use a different row decoder. The library README has a line_decoder setting for that (TYPE138 by default, TYPE595, TYPE_DIRECT, SM5266P).

The colours are swapped

Red shows as blue, or green as red. Some panels are wired internally with a different colour order. You don't need to resolder anything: swap the numbers in the config (for example, give gpio.r1 and gpio.b1 each other's pins, and the same for r2 and b2) until a pure red pixel shows red.

Noise, flickering pixels or ghosting

If the panel looks fine to the eye but shows bands or flicker when you film it with your phone, that's a different problem with a different fix. I wrote a whole guide on it: why your HUB75 LED panel flickers on camera.

The ESP32 resets when Wi-Fi connects

Wi-Fi transmission causes current spikes, and if the ESP32 shares a weak supply with the panel, the voltage drops and the chip resets, or worse, keeps running with corrupted memory, which is what I suspect happened on my v2 board. Power the panel separately, add the capacitor, use thick wires and a common ground, and test with a dark image and a bright one: if the resets only happen with a bright image, it's power.

The panel flashes with garbage when it boots

The panel lights whatever its pins say at every instant. From reset until the library takes control, the pins float, the row lines pick a row from noise, and OE (active low) lets it show. On Frame this showed up as a couple of white lines for a few seconds on every boot.

The first fix is in software: the first thing my setup() does is set OE high and the other panel pins low, before anything else.

pinMode(OE_PIN, OUTPUT);
digitalWrite(OE_PIN, HIGH);  // OE is active low: HIGH keeps the LEDs off

On my board that took the flash from about 3.3 seconds to about 0.3 seconds. What's left happens in the bootloader, before any of your code runs, so software can't fix it. The real fix is a pull-up resistor on OE, which keeps the panel off from the moment of reset. It's on the list for my next board.

If you don't want to solder

I enjoy all of this, but I know most people who want a 64x64 panel at home don't want to debug a ribbon cable. That's why I build Frame: a frame with a 64x64 LED panel where the people you love send photos from a free app (iPhone and Android, no subscription), and they show up on your Frame wherever they are. I'm building it on my own, and you can read the whole story here.

You can't buy Frame yet. It launches on Kickstarter on February 1, 2027. Reserving a Founders spot costs 1 € and gets it for 75 € ($85 in the US and Canada).

If you're building your own panel, you might also like my guides on what to draw on a 64x64 canvas, converting a photo to 64x64 pixel art and Tidbyt alternatives.

Summary

And if you'd like a 64x64 panel at home that lights up with photos from the people you love, without wiring anything, leave your email below. People on the list get the link on launch day, and whoever reserves gets it for 75 € ($85).

Best,
Álvaro M.

Kickstarter · February 2027
Waitlist