How to Build a Scrolling LED Matrix Message Board with ESP32
Display custom scrolling text on a MAX7219 dot matrix using five wires and two libraries
Updated

What you'll build
In this guide you will build a scrolling LED message board powered by an ESP32 and a MAX7219 8x32 dot matrix module. The display cycles through a set of messages, scrolling each one smoothly from right to left across four cascaded 8x8 LED panels. You control the scroll speed, brightness, and message list directly in the code, and adding new messages is as simple as extending an array.
The MAX7219 is one of the most popular LED driver chips in the maker world. A single chip handles multiplexing, brightness control, and communication for an 8x8 grid of LEDs, and the 4-in-1 modules you can find for a few dollars daisy-chain four of these chips on a single SPI bus. The MD_Parola library takes care of text rendering, scrolling animations, and panel coordination so you can focus on what to display rather than how to drive individual pixels. Along the way you will learn how SPI communication works on the ESP32, how cascaded displays are addressed, and how the MD_MAX72XX library maps logical coordinates to physical LED positions.
By the end of the build you will have a compact desk display that is ready for customization. You could add a button to cycle messages on demand, connect to Wi-Fi to pull live data like weather or notifications, or use the MD_Parola sprite and zone features to build split-screen layouts. If you enjoy working with visual output on the ESP32, the Gesture-Controlled Mood Lamp is a natural next step that swaps the dot matrix for addressable RGB LEDs and adds gesture-based interaction.
Wiring diagram
Wiring diagram
Components needed
| Component | Type | Qty | Buy |
|---|---|---|---|
| MAX7219 8x32 LED Dot Matrix Module | display | 1 | €8.00 |
Prices and availability are indicative and may have been updated by the supplier. Schematik may earn a commission from purchases made through affiliate links.
Assembly
Wire the LED matrix to the ESP32
Connect the MAX7219 module VCC to 5V, GND to GND, DIN to GPIO23, CS to GPIO5, and CLK to GPIO18.
- GPIO23 is the default VSPI MOSI pin, GPIO18 is VSPI CLK, and GPIO5 is VSPI SS, so this keeps your SPI bus on its default hardware pins.
- If the module has a 4-in-1 design, only the input header needs wiring. The four 8x8 panels are already daisy-chained.
- Power the matrix from the USB 5V rail, not the 3.3V pin. The MAX7219 needs 5V to drive the LEDs at full brightness.
Flash and test
Upload the sketch and open Serial Monitor at 115200 baud. You should see scrolling text across all four panels. Adjust display.setIntensity(4) from 0 to 15 to control brightness.
- If text scrolls backwards or panels appear in the wrong order, try changing HARDWARE_TYPE to MD_MAX72XX::GENERIC_HW.
- Lower intensity values save power and reduce eye strain at your desk.
Pin assignments
| Pin | Connection | Type |
|---|---|---|
| 5V | led-matrix-1 VCC | POWER |
| GND | led-matrix-1 GND | GROUND |
| GPIO 23 | led-matrix-1 DIN | SPI |
| GPIO 5 | led-matrix-1 CS | SPI |
| GPIO 18 | led-matrix-1 CLK | SPI |
Code
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define DATA_PIN 23
#define CS_PIN 5
#define CLK_PIN 18
MD_Parola display = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
const char *messages[] = {
"Hello from Schematik!",
"Build something cool",
"LED Matrix Demo",
"Maker life is best life"
};
const int NUM_MESSAGES = sizeof(messages) / sizeof(messages[0]);
int currentMsg = 0;
void setup() {
Serial.begin(115200);
delay(100);
display.begin();
display.setIntensity(4);
display.displayClear();
display.displayScroll(messages[currentMsg], PA_LEFT, PA_SCROLL_LEFT, 40);
Serial.println("LED Matrix Message Board ready");
}
void loop() {
if (display.displayAnimate()) {
currentMsg = (currentMsg + 1) % NUM_MESSAGES;
display.displayScroll(messages[currentMsg], PA_LEFT, PA_SCROLL_LEFT, 40);
Serial.printf("Now showing: %s\n", messages[currentMsg]);
}
}
// Run this and build other cool things at schematik.ioReady to build this?
Open this project in Schematik to get the full wiring diagram, pin assignments, and deployable code for the LED Matrix Message Board.
Open in Schematik →