What You Will Build
A MAX7219 8×8 display that repeatedly scrolls Hello ESP32! right to left. The complete example uses one FC16-mapped driver, low starting brightness and explicit GPIO23/18/5 signals. Longer chains, buttons, web updates and MQTT remain extension ideas, not features implemented by this sketch.
Before You Start
Classic ESP32-WROOM-32/32E DevKit with the named GPIOs exposed and unused. Select its exact board profile, or ESP32 Dev Module for an otherwise undocumented generic WROOM board. Arduino IDE 2.x and Arduino-ESP32 3.x; API review baseline 3.3.2, not a claim that it is the latest release. Other ESP32 families need their own pin/USB settings. Serial Monitor: 115200 baud. Examples are reviewed against documentation, not compiled or hardware tested in this content review.
Use MAX7219 or a module with equivalent documented ratings and verified MD_MAX72XX mapping. FC16_HW is an example, not a promise that every panel is FC16. MAX_DEVICES counts driver chips, not boards: a four-chip FC16 board needs 4. The example uses explicit software clock/data pins rather than board-default SPI pins.
Parts
- Classic ESP32-WROOM DevKitUSB data cable; GPIO23 DATA, GPIO18 CLK, GPIO5 CS
- MAX7219 matrix moduleOne driver for this example; verify mapping and chip count
- SN74AHCT125 or documented equivalentThree 3.3-to-5 V logic channels; powered at 5 V
- Regulated 5 V matrix supplySize from actual module current, chain length and brightness; do not assume USB/VIN capacity
- Decoupling capacitors and short wires100 nF at buffer; MAX7219 recommends 100 nF + 10 µF near each driver; check module provisions
Wiring
ESP32 supplies logic only. A 5 V SN74AHCT125 raises DIN/CLK/CS to the MAX7219 input levels; a regulated supply powers the matrix. Connect to the DIN input side, not DOUT. Diagram shows logical connections.
-
1
Unplug USB and 5 V supply. Identify input-side DIN/CLK/CS (sometimes LOAD), VCC and GND.
-
2
For a standard 14-pin SN74AHCT125 package, connect VCC pin14 to regulated 5 V and GND pin7 to shared ground. Add 100 nF close to these pins; verify actual package pinout.
-
3
GPIO23 → 1A pin2; 1Y pin3 → DIN. GPIO18 → 2A pin5; 2Y pin6 → CLK. GPIO5 → 3A pin9; 3Y pin8 → CS/LOAD.
-
4
Ground active-LOW OE pins1,4,10 to enable used channels. For unused channel4 tie OE pin13 HIGH and input4A pin12 LOW; leave output4Y pin11 open.
-
5
Connect matrix VCC to regulated 5 V and matrix/buffer/ESP32 grounds together. Keep +5 V off ESP32 3.3 V and GPIO; do not join independent USB/external positive rails.
-
6
Verify decoupling and supply capacity before powering. Start at intensity1 with one driver; larger chains require sized power wiring.
-
7
Set HARDWARE_TYPE and MAX_DEVICES to your actual module. GPIO5 is a classic ESP32 strapping pin: buffer input must not force an incompatible reset level. If board circuitry conflicts, move CS to available GPIO27 and update code.
Wiring Reference
| Signal | ESP32 Pin | Direction | Notes |
|---|---|---|---|
| Matrix DIN | GPIO23 → buffer1A/1Y | Output | 3.3 V source → 5 V signal; input connector |
| Matrix CLK | GPIO18 → buffer2A/2Y | Output | Explicit software clock pin |
| Matrix CS/LOAD | GPIO5 → buffer3A/3Y | Output | Classic ESP32 strapping pin; avoid reset conflict |
| Buffer OE1/OE2/OE3 | GND | Enable | Active-LOW enables channels |
| Matrix and buffer VCC | External regulated 5 V | Power | Never ESP32 3.3 V; separate positive supply rails |
| All signal grounds | GND | Ground | Common reference; sized supply wiring carries matrix current |
Libraries and Setup
- MD_Parola by MajicDesignsInstall via Library Manager for scrolling animation.
- MD_MAX72XX by MajicDesignsInstall dependency via Library Manager; include is MD_MAX72xx.h (case matters). Select actual mapping.
- esp32 by Espressif Systems 3.xSelect WROOM board/port. No Wi-Fi/MQTT dependencies for this complete example.
Configure the Example
Set HARDWARE_TYPE to the actual MD_MAX72XX layout. FC16_HW is only for FC16-wired matrices; other layouts route rows/columns differently. MAX_DEVICES counts MAX7219 chips; a four-chip board needs 4.
BRIGHTNESS is 0 (minimum intensity, not OFF) to 15. Start at 1; intensity is not a current limit or supply rating. Budget supply current from actual module specifications or ISET/LED drive settings; no universal per-module current is assumed. MAX7219 specifies 4.0–5.5 V supply; this build uses regulated 5 V, not 3.3 V.
MAX7219 HIGH-input minimum is 3.5 V under specified conditions, so direct ESP32 3.3 V control is not guaranteed. At 5 V, SN74AHCT125 accepts HIGH from 2.0 V and buffers the three outputs. A generic bidirectional I2C level shifter is not automatically suitable for clocked signals. A module with verified onboard translation may use its documented interface instead.
Code
Install the libraries above and match the configuration and wiring before uploading.
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW // Verify actual module layout.
constexpr uint8_t MAX_DEVICES = 1; // Driver chips, not boards.
constexpr uint8_t DATA_PIN = 23, CLK_PIN = 18, CS_PIN = 5;
constexpr uint16_t SCROLL_SPEED_MS = 60;
constexpr uint8_t BRIGHTNESS = 1; // 0 minimum intensity; 15 maximum.
// Explicit pins select software serial. Buffer all signals to 5 V.
MD_Parola display(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
char message[] = "Hello ESP32! "; // Persistent animation buffer.
void setup() {
Serial.begin(115200);
display.begin();
display.setIntensity(BRIGHTNESS);
display.displayClear();
display.displayScroll(message, PA_LEFT, PA_SCROLL_LEFT, SCROLL_SPEED_MS);
Serial.println("LED matrix ready: repeating Hello ESP32!");
}
void loop() {
if (display.displayAnimate()) display.displayReset();
}
How the Code Works
The five-argument constructor selects software serial with explicit data, clock and select pins, matching the wiring without default SPI assumptions. MD_Parola animates a persistent message buffer; loop calls displayAnimate frequently and displayReset starts the next pass. No network or blocking delay is needed.
Expected Output
Serial prints LED matrix ready: repeating Hello ESP32! once. The matrix should scroll Hello ESP32! right to left repeatedly at 60 ms per step and intensity1. Only part of a character/message fits on one 8×8 panel. This describes expected behavior, not observed hardware output.
Troubleshooting
- Blank display Check external 5 V, common ground, buffer VCC/OE and input-side DIN. Match controller/mapping/chip count. Serial ready text does not prove module detection.
- Random pixels or intermittent output Check buffer signals, 5 V under load, short wires and decoupling. Direct 3.3 V HIGH does not meet the guaranteed MAX7219 threshold.
- Mirrored, rotated or wrong module order Compare mapping/orientation with MD_MAX72XX documentation. FC16_HW is not universal; correct mapping before PA_FLIP_LR/PA_FLIP_UD zone effects.
- Only part of chain works Count chips for MAX_DEVICES; check DOUT-to-DIN, CLK/CS continuity and voltage at the far end.
- ESP32 does not boot with matrix Check shorts and GPIO5 strapping. Buffer inputs must not impose a conflicting reset level; move CS to unused GPIO27 and update CS_PIN if required.
- Flicker, dim LEDs or resets at higher intensity Return to intensity1/one driver. Check rated supply, wire resistance and capacitors. Never increase brightness to fix insufficient power or power matrix from ESP32 3.3 V.
Checks to Perform on Your Build
- Verify Serial-only upload before adding hardware.
- Check buffer package pinout, enables and grounds with power off.
- Verify regulated 5 V module supply and ESP32-side 3.3 V signals.
- Match layout and driver count before uploading.
- Check repeating scroll/orientation at low intensity first.
- Power down before chaining and recalculate power/wiring capacity.
Practical Design Notes
One 8×8 panel shows only part of the message at once. Chains add width: DOUT of each driver goes to next DIN; CLK/CS are shared. Match driver count, order and mapping. Never connect 5 V DOUT back to an ESP32 input.
Wrong mapping can mirror/rotate characters. Choose actual HARDWARE_TYPE first, then correct mounting or use documented Parola zone flips. Keep wires short, check shared ground and decoupling. Supply current depends on intensity, lit pixels, ISET and driver count; an unknown USB/VIN rail is not a guaranteed chain supply.
Upgrade Ideas
- Chain 4 MAX7219 modules for a 32x8 display with longer message capacity
- Add a button to cycle through several preset messages
- Add an RTC module and display the current time and date
- Add Wi-Fi and set the message via a web interface
FAQs
Can ESP32 outputs connect directly to MAX7219?
This example buffers to 5 V: MAX7219 specified HIGH minimum is 3.5 V, above ESP32’s 3.3 V output. A different interface requires documented module compatibility.
How many devices should I select?
MAX_DEVICES counts driver chips, not boards. A four-chip FC16 board needs 4.
Why is text mirrored or upside down?
Verify actual row/column mapping and mounting order. FC16_HW is an example, not a universal layout.
Review, Testing, and References
Author: Abdul Mubeen and the ESP32 Engine editorial team. Last updated: 2026-10-08. Reviewed: wiring logic, Arduino code structure, beginner safety, and learning sequence.
Educational level: Beginner. Estimated completion time: 60-90 min. This project is for learning and prototyping; production or unattended hardware needs additional engineering review.

