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

ESP32Smart HomeBeginner30 minutes1 component

Updated

How to Build a Scrolling LED Matrix Message Board with ESP32
For illustrative purposes only
On this page

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

Interactive wiring diagram

Components needed

ComponentTypeQtyBuy
MAX7219 8x32 LED Dot Matrix Moduledisplay1€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

1

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.

2

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.

Pin assignments

PinConnectionType
5Vled-matrix-1 VCCPOWER
GNDled-matrix-1 GNDGROUND
GPIO 23led-matrix-1 DINSPI
GPIO 5led-matrix-1 CSSPI
GPIO 18led-matrix-1 CLKSPI

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.io
Libraries: MD_Parola, MD_MAX72XX