How-to · Beginner · 3 min read
MAX7219 LED Dot Matrix
Wiring, Chaining and Scrolling Text
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
The MAX7219 drives an 8x8 LED matrix (or eight 7-segment digits) using only three data pins, DIN, CS and CLK, and modules chain together by wiring each module's output to the next one's input. Power them from 5 V, use the MD_Parola library to scroll text, and set the hardware type to FC16_HW for the common blue four-in-one modules. Budget up to about 1 A at full brightness for a four-module display.
Key specs at a glance
- Drives
- 64 LEDs: one 8x8 matrix or 8 seven-segment digits
- Interface
- 3-wire serial: DIN, CS (LOAD), CLK
- Supply
- 4 to 5.5 V
- Brightness
- 16 levels in software, plus RSET resistor
- Chaining
- DOUT to next DIN; four-in-one modules are pre-chained
- Libraries
- MD_Parola + MD_MAX72XX, LedControl
Wiring to Arduino and ESP32
| Module pin | Arduino Uno | ESP32 | Notes |
|---|---|---|---|
| VCC | 5V | 5V (VIN) | Use a separate 5 V supply for long chains |
| GND | GND | GND | Common ground |
| DIN | D11 (MOSI) | GPIO 23 (MOSI) | Hardware SPI is fastest |
| CS | D10 | GPIO 5 | Any digital pin |
| CLK | D13 (SCK) | GPIO 18 (SCK) |
- VCC
- Arduino Uno:
- 5V
- ESP32:
- 5V (VIN)
- Notes:
- Use a separate 5 V supply for long chains
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- Notes:
- Common ground
- DIN
- Arduino Uno:
- D11 (MOSI)
- ESP32:
- GPIO 23 (MOSI)
- Notes:
- Hardware SPI is fastest
- CS
- Arduino Uno:
- D10
- ESP32:
- GPIO 5
- Notes:
- Any digital pin
- CLK
- Arduino Uno:
- D13 (SCK)
- ESP32:
- GPIO 18 (SCK)
Scrolling text with MD_Parola
Install MD_Parola and MD_MAX72XX from the Library Manager.
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW // blue 4-in-1 modules
#define MAX_DEVICES 4
#define CS_PIN 10
MD_Parola display(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
void setup() {
display.begin();
display.setIntensity(3); // 0 to 15: keep it low to save power
display.displayText("Hello from Geekobot", PA_CENTER, 60, 0,
PA_SCROLL_LEFT, PA_SCROLL_LEFT);
}
void loop() {
if (display.displayAnimate()) display.displayReset();
}Text upside down or mirrored? Set the hardware type
Module makers wire the matrix to the MAX7219 in different orientations, so MD_MAX72XX needs to know which one you have. Try these in order: FC16_HW (most blue four-in-one modules sold today), GENERIC_HW (single red modules with the chip under the matrix), PAROLA_HW and ICSTATION_HW. If letters are mirrored, rotated or scrambled, the hardware type is wrong. With LedControl, you handle orientation yourself in code.
Power and brightness
Each lit LED draws current, and four modules have 256 LEDs. At full brightness with everything on, a four-module display can draw close to 1 A; scrolling text typically lights only 20 to 30% of LEDs. Keep intensity at 2 to 5 indoors, power chains of more than four modules from a separate 5 V supply, and add a 100 µF capacitor at the input. Feed power at both ends of long chains.
ESP32 and Pico: the MAX7219 officially needs a logic HIGH of 3.5 V when powered at 5 V. A 3.3 V board often works anyway, but for a reliable display add a level shifter such as a 74HCT125, or power the modules at about 4.5 V. See logic level shifting.
MAX7219 for 7-segment displays
The same chip drives eight 7-segment digits and has a built-in BCD decoder. Use the LedControl library: lc.setDigit(0, position, value, decimalPoint). The common eight-digit red module is a good choice when you need more digits than a TM1637 provides.
Try it: LED strip power calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Leaving the hardware type at the default and getting mirrored text.
- Running a long chain at full brightness from the Arduino's USB 5 V.
- Wiring DOUT of the last module back to the Arduino instead of DIN of the first.
- Driving the module at 3.3 V logic without testing and getting random pixels.
- Forgetting to set MAX_DEVICES to the number of modules.
Frequently asked questions
How many MAX7219 modules can I chain?
There is no hard limit in the chip; libraries handle dozens. In practice, power and refresh speed limit long chains. Feed power every four to eight modules.
Why is my MAX7219 text backwards?
The library's hardware type does not match your module. Try FC16_HW first, then GENERIC_HW, PAROLA_HW or ICSTATION_HW.
Can I use MAX7219 with ESP32?
Yes, with the same libraries. Power the module from 5 V. For reliable data at 3.3 V logic, use a level shifter or lower the module's supply slightly.
How much current does a MAX7219 matrix draw?
It depends on brightness and how many LEDs are lit. One module at full brightness with all LEDs on can draw over 200 mA; scrolling text at low intensity needs far less.
Which library is best for MAX7219?
MD_Parola with MD_MAX72XX for scrolling text and effects; LedControl for simple pixels and 7-segment digits.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 7 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.




