Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » 8×32 MAX7219 Dot Matrix LED Display with Arduino
Arduino Projects

8×32 MAX7219 Dot Matrix LED Display with Arduino

Mamtaz AlamBy Mamtaz AlamUpdated:October 9, 20223 Comments5 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Overview

In this guide, we will learn how to use the 8×32 MAX7219 Dot Matrix LED Display with Arduino. The 8×32 LED matrix module with MAX7129 LED driver is compatible with Arduino Board & other microcontrollers. An 8×32 LED matrix has 256 LEDs (Light Emitting Diodes) which are arranged in the form of a matrix as 8 rows and 32 columns. Hence it is named an 8×32 Dot Matrix LED.

Using the Parola and MAX72xx library we can generate different rolling LED patterns such as numbers, alphabets, scrolling text, symbols, emojis, etc. Apart from this, we can also display some sensor data like DHT11/DHT22 on this display. Let’s see some examples in this post.


Bill of Materials

You can buy the following components from Amazon in order to use this module.

S.N.ComponentsQuantityPurchase Links
1Arduino UNO Board1Amazon | AliExpress
28x32 MAX7219 Dot Matrix LED Display1Amazon | AliExpress
3DHT22 Sensor1Amazon | AliExpress
4Jumper Wires1Amazon | AliExpress
5Power Supply1Amazon | AliExpress




Dot Matrix LED Display

LED matrices are available in different styles like single color, dual color, multi-color, or RGB LED matrix. They are also available in different dimensions like 5 x 7, 8 x 8, 16 x 16, 8 x 32, 32 x 32 etc.

8x8 LED Matrix

This 8×32 LED Matrix Display is a cluster of 4 single modules, internally connected. These modules can also be separated, because every module carries the same Maxim MAX7219 chip, and comes with the same power and data connection.

8X32 MAX7219 LED Dot Matrix Display


Pin Configuration

The 8×8 LED matrix have 8 positive terminal & 8 negative terminals. The 8 negative terminals are 8 columns & 8 positive terminal are 8 rows.

LED-Matrix-Internal-Structure

The 4 8X8 LED Matrix are connected to each other via the MAX7219 Pins.



MAX7219 LED Driver IC

The LED matrix can be driven in two ways. They are parallel (where each row or column is sent with parallel data) and serial (where the data is sent serially and an IC is used to convert this serial data into parallel data).

MAX7219 is a common cathode display driver with serial input and parallel output. It is used to interface microprocessors and microcontrollers with 64 individual LEDs. The 8 x 8 LED matrix is connected to the MAX 7219. The data input is received from the Arduino board to the MAX7219.


Interfacing 8×32 MAX7219 Dot Matrix LED Display with Arduino

Now let us see how we can interface 8×32 MAX7219 Dot Matrix LED Display with Arduino Board to display some texts and numbers.

8×32 MAX7219 LED Dot Matrix Display with Arduino

This display draws a lot of current, therefore we need to run the module from the external power supply instead of the 5V supply from the Arduino board. You need to use an external power adapter of 5V, 3A rating connected to the 5V & GND Pin of the Arduino Board.

As the MAX7219 module requires a lot of data transfer, it needs to get connected to the hardware SPI pins on a microcontroller. For Arduino boards such as the UNO/Nano those pins are digital 13 (SCK), 12 (MISO), 11 (MOSI), and 10 (SS).

Connect the CLK, CS, DIN Pin of 8×32 LED Dot Matrix Display to Arduino digital pin 13, 10, 11.

In this guide we are using FC-16 MAX7219 Module. If you want to daisy-chain multiple displays to create a larger display, connect the DOUT of the first display to the DIN of the next display. VCC, GND, CLK, and CS will all be shared between displays.




Library Installation

Controlling the MAX7219 module is a complex task and requires a lot of lines of code. Fortunately, the MD_Parola library is available to remove those complexities so that we can issue simple commands to control the display.

To install the library navigate to Sketch > Include Library > Manage Libraries. From the Search, options look for ‘max72xx’ and click on install.

MAX72xx Library

This MD_MAX72XX library is a hardware-specific library that handles lower-level functions. It needs to be paired with MD_Parola Library to create many different text animations like scrolling and sprite text effects. Install this library as well.


Source Code/Program for Text/Number Printing

Copy the following code and paste it on your Arduino IDE.

1
2
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
//#define HARDWARE_TYPE MD_MAX72XX::GENERIC_HW

From these lines, select the hardware type. In our case the hardware type is FC16_HW.

1
myDisplay.displayScroll("How To Electronics", PA_CENTER, PA_SCROLL_LEFT, 200);

In these lines type any text and numbers you want to display on the LED Display.

Now you can upload the code to the Arduino Board.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
 
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
//#define HARDWARE_TYPE MD_MAX72XX::GENERIC_HW
 
#define MAX_DEVICES 4
#define CS_PIN 10
 
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
 
void setup() {
 
  myDisplay.begin();
  myDisplay.setIntensity(4);
  myDisplay.displayClear();
  myDisplay.displayScroll("How To Electronics", PA_CENTER, PA_SCROLL_LEFT, 200);
}
 
void loop() {
  if (myDisplay.displayAnimate()) {
    myDisplay.displayReset();
  }
}


Output Test

I want to display the scrolling text “How To Electronics”. The text will scroll like this.

Apart from this you can display any text or numbers like this.


Displaying DHT22 Humidity Temperature Sensor Value

Now let us interface the DHT22 Temperature & Humidity Sensor with Arduino & display the sensor value on 8×32 Dot Matrix LED Display.

Arduino DHT22 MAX7219 LED Dot Matrix Display

Connect the DHT22 Sensor VCC, GND & Output pin to 5V, GND & D7 of Arduino.



Source Code/Program

This code requires a header file called Font7Seg.h for compilation. Download this file and copy it in the main sketch folder.

Now you can copy this code to the Arduino main sketch and upload it to the Arduino.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*
* Use of MAX72XX, DS1307 and DTH22 components to
* print some information on the display.
*
* for more examples:
* https://github.com/MajicDesigns/MD_Parola/tree/main/examples
* https://github.com/MajicDesigns/MD_MAX72XX/tree/main/examples
*/
 
// Header file includes
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <DHT.h>
#include <SPI.h>
#include <Wire.h>
#include "Font7Seg.h"
 
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4  // Define the number of displays connected
#define CLK_PIN 13     // CLK or SCK
#define DATA_PIN 11    // DATA or MOSI
#define CS_PIN 10      // CS or SS
#define SPEED_TIME 75  // Speed of the transition
#define PAUSE_TIME 0
#define MAX_MESG 20
 
 
// These are for the temperature
#define DHTPIN 6
#define DHTTYPE DHT22
#define TIMEDHT 1000
 
 
 
char szTime[9];  // mm:ss\0
char szMesg[MAX_MESG + 1] = "";
 
float humidity, celsius, fahrenheit;
 
uint8_t degC[] = { 6, 3, 3, 56, 68, 68, 68 };  // Deg C
uint8_t degF[] = { 6, 3, 3, 124, 20, 20, 4 };  // Deg F
 
uint8_t clear = 0x00;
 
uint32_t timerDHT = TIMEDHT;
 
DHT dht(DHTPIN, DHTTYPE);
 
// Hardware SPI connection
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
 
 
 
uint8_t decToBcd(uint8_t value) {
  return ((value / 10 * 16) + (value % 10));
}
 
uint8_t bcdToDec(uint8_t value) {
  return ((value / 16 * 10) + (value % 16));
}
 
void getTemperature() {
  // Wait for a time between measurements
  if ((millis() - timerDHT) > TIMEDHT) {
    // Update the timer
    timerDHT = millis();
 
 
    humidity = dht.readHumidity();
    celsius = dht.readTemperature();
    fahrenheit = dht.readTemperature(true);
    if (isnan(humidity) || isnan(celsius) || isnan(fahrenheit)) {
      Serial.println("Failed to read from DHT sensor!");
      return;
    }
  }
}
 
void setup(void) {
  Wire.begin();
 
  P.begin(2);
  P.setInvert(false);
 
  P.setZone(0, MAX_DEVICES - 4, MAX_DEVICES - 1);
  P.setZone(1, MAX_DEVICES - 4, MAX_DEVICES - 1);
 
  
  P.displayZoneText(0, szMesg, PA_CENTER, SPEED_TIME, 0, PA_PRINT, PA_NO_EFFECT);
 
  P.addChar('$', degC);
  P.addChar('&', degF);
 
  dht.begin();
}
 
void loop(void) {
  static uint32_t lastTime = 0;  // Memory (ms)
  static uint8_t display = 0;    // Current display mode
  static bool flasher = false;   // Seconds passing flasher
 
 
  getTemperature();
 
  P.displayAnimate();
 
  if (P.getZoneStatus(0)) {
    switch (display) {
      case 0:  // Temperature deg Celsius
        P.setPause(0, 1000);
        P.setTextEffect(0, PA_SCROLL_LEFT, PA_SCROLL_UP);
        display++;
        dtostrf(celsius, 3, 1, szMesg);
        strcat(szMesg, "$");
 
        break;
      case 1:  // Temperature deg Fahrenheit
        P.setTextEffect(0, PA_SCROLL_UP, PA_SCROLL_DOWN);
        display++;
        dtostrf(fahrenheit, 3, 1, szMesg);
        strcat(szMesg, "&");
 
        break;
      case 2:  // Humidity
        P.setTextEffect(0, PA_SCROLL_DOWN, PA_SCROLL_LEFT);
        display++;
        dtostrf(humidity, 3, 0, szMesg);
        strcat(szMesg, "%UR");
 
 
        break;
    }
 
    P.displayReset(0);  // Rest zone zero
  }
}


Output Test

The 8×32 Dot Matrix LED Display along with Arduino will display the temperature humidity data.

8x32 MAX7219 Matrix LED Display

8x32 LED Matrix Display Arduino

This is how you can use the 8×32 MAX7219 Dot Matrix LED Display with Arduino Board to display scrolling text and numbers.


Video Tutorial & Guide

MAX7219 Dot Matrix 4-in-1 Display with Arduino - Scrolling Text & Displaying Sensor Data
Watch this video on YouTube.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleBoost Converter: Basics, Working, Design & Application
Next Article Getting started with DWIN HMI TFT LCD Display

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 3 Comments

3 Comments

  1. John Snowden on December 20, 2022 11:37 PM

    Help. Im new to Arduino and would like to use this sketch on an ESP32 as I want to display a temperature value remotely from another ESP32 using ESP NOW. I have tried to convert this sketch without the clock but i am having difficulty with it not running. I am not sure about the Font7seg.h file?

    Reply
  2. Coco Glaser on February 20, 2023 2:25 PM

    How do we know what our hardware type is? I am fairly new to arduino, and my brain is small. Does it say the hardware type on the Matrix/7219 chip?

    Reply
  3. Aamir Usman on February 21, 2023 8:45 AM

    uint8_t degC[] = { 6, 3, 3, 56, 68, 68, 68 }; // Deg C
    uint8_t degF[] = { 6, 3, 3, 124, 20, 20, 4 }; // Deg F
    plz explain

    Reply

CommentsCancel reply

Latest Posts
ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 21, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • ESP32 Fingerprint Attendance System with Live Web Dashboard
    ESP32 Fingerprint Attendance System with Live Web Dashboard
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • How to use INA226 DC Current Sensor with Arduino
    How to use INA226 DC Current Sensor with Arduino
  • LD2410 Sensor with ESP32 - Human Presence Detection
    LD2410 Sensor with ESP32 - Human Presence Detection
  • ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
    ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
  • Designing of MPPT Solar Charge Controller using Arduino
    Designing of MPPT Solar Charge Controller using Arduino
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.