8×8 Dot Matrix Display-MAX7219

Any single color large LED matrix display which is made up of a few large 8×8 LED matrix modules daisy-chained together. These 8×8 LED matrix modules is around 144mm x 144mm in size.
Using a 7219 you can drive 64 LEDs while you only need 3 wires to interface it to a microcontroller. In addition you can daisy chain multiple 7219 chips for bigger displays. There are 16 output lines from the 7219 driving 64 individual LEDs. This sounds impossible but the driving method makes use of the way our eyes work. Persistence of vision is exploited to make the LEDs appear to be on all the time when in fact they are not. In fact the LEDs are arranged as an 8×8 set of rows and columns. Each column is pulsed for a short time while the row bits for that column are driven.
Our eyes remember a flash of light for approximately 20ms, so when you continuously flash a light (or an LED) at a rate at or faster than 20ms, then it appears that the light never goes off. This is how the 7219 works. All the leds are individually turned on for a short time, at rate greater than 20ms.

The dot matrix that we’re going to use in this guide is an 8×8 matrix which means that it has 8 columns and 8 rows, so it contains a total of 64 LEDs.
The MAX7219 chip makes it easier to control the dot matrix, by just using 4 digital pins of the Arduino board. I think the best option is to buy the dot matrix with the MAX7219 chip as a module, it will simplify the wiring.
You can control more than one matrix at a time. For that you just need to connect them to each other, as they have pins in both sides to extend the dot matrix.
The MAX7219 has a four wire SPI interface – clock, data, chip select and ground.
A. Vcc.
C. Din
D. Cs.
1.  Parameter MAX7219
2. Power Supply = 4.0V ~ 5.5V
3. Supply Current = 330mA
4. Segment drive source current = 40mA
5. Scan rate = 500-1300Hz (800Hz Typ.)
6. CLK max = 10MHz
7. Voltage  +5V.
8. Vih (input high) min 3.5V
Copy and paste the arduino code or download below given link.
//Circuito.io is an automatic generator of schematics and code
//Copyright (C) 2016 Roboplan Technologies Ltd.
// Include Libraries
#include “Arduino.h”
#include “BTHC05.h”
#include “MaxMatrix.h”
// Pin Definitions
#define BTHC05_PIN_RXD 10
#define BTHC05_PIN_TXD 11
#define LEDMATRIX_1_PIN_DIN 12
#define LEDMATRIX_1_PIN_CS 3
// Global variables and defines
byte ledMatrix_1inUse = 5; //Specify how many Max7219 led matrices are chained
int ledMatrix_1textScrollingSpeed = 50; //Specify the scrolling speed
char ledMatrix_1Str[] = “Hello World! “; //Specify the string to be displayed
// object initialization
// define vars for testing menu
const int timeout = 10000; //define timeout of 10 sec
char menuOption = 0;
long time0;
// Setup the essentials for your circuit to work. It runs first every time your circuit is powered with electricity.
void setup()
// Setup Serial which is useful for debugging
// Use the Serial Monitor to view printed messages
while (!Serial) ; // wait for serial port to connect. Needed for native USB
//This example uses HC-05 Bluetooth to communicate with an Android device.
//Download bluetooth terminal from google play store, https://play.google.com/store/apps/details?id=Qwerty.BluetoothTerminal&hl=en
//Pair and connect to ‘HC-05’, the default password for connection is ‘1234’.
//You should see this message from your arduino on your android device
bthc05.println(“Bluetooth On….”);
ledMatrix_1.init(ledMatrix_1inUse); //Initialize Led Matrices
ledMatrix_1.setIntensity(5); //LED Intensity 0-15
menuOption = menu();
// Main logic of your circuit. It defines the interaction between the components you selected. After setup, it runs over and over again, in an eternal loop.
void loop()
if(menuOption == ‘1’) {
// HC – 05 Bluetooth Serial Module – Test Code
String bthc05Str = “”;
//Receive String from bluetooth device
if (bthc05.available())
//Read a complete line from bluetooth terminal
bthc05Str = bthc05.readStringUntil(‘\n’);
// Print raw data to serial monitor
Serial.print(“BT Raw Data: “);
//Send sensor data to Bluetooth device
bthc05.println(“PUT YOUR SENSOR DATA HERE”);
else if(menuOption == ‘2’) {
// 8×8 LED display Matrix – MAX7219 #1 – Test Code
//Note that this function is blocking the loop until the end of the scrolling
ledMatrix_1.printStringWithShift(ledMatrix_1Str, ledMatrix_1textScrollingSpeed); // Send scrolling Text
if (millis() – time0 > timeout)
menuOption = menu();
// Menu function for selecting the components to be tested
// Follow serial monitor for instrcutions
char menu()
Serial.println(F(“\nWhich component would you like to test?”));
Serial.println(F(“(1) HC – 05 Bluetooth Serial Module”));
Serial.println(F(“(2) 8×8 LED display Matrix – MAX7219 #1”));
Serial.println(F(“(menu) send anything else or press on board reset button\n”));
while (!Serial.available());
// Read data from serial monitor if received
while (Serial.available())
char c = Serial.read();
if (isAlphaNumeric(c))
if(c == ‘1’)
Serial.println(F(“Now Testing HC – 05 Bluetooth Serial Module”));
else if(c == ‘2’)
Serial.println(F(“Now Testing 8×8 LED display Matrix – MAX7219 #1”));
Serial.println(F(“illegal input!”));
return 0;
time0 = millis();
return c;
Download Arduino ‘Full code Here. 8×8 dot matrix with code After downloaded extract and compile the upload with your Arduino board and test it.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.