Hi guys, in today’s video, we will be playing/working with the popular 8×8 LED Matrix and an Arduino Uno with the goal of displaying simple text or logos on the LED Matrix. The procedure is very easy and it is an ideal project for Arduino or LED matrix beginners.

The 8×8 LED matrix displays are typically used for displaying Short text, counters, symbols etc. They can be daisy chained to form large displays which can be used for the display of scrolling texts, logos among others and we will consider doing this in another video. For this tutorial, we will be using a single 8×8 LED matrix which is based on the MAX7221 LED driver module. The driver module creates an interface which makes it easy to communicate with the LED matrix. The LED matrix being used in this tutorial comes pre-soldered with the MAX7221 Controller module and can be bought for around 3 euros. The unsoldered version is also available and can be bought at a price way lesser than the pre-soldered but you will, of course, be paying with time spent on soldering it.

You can watch the video tutorial by following the link below.

Arduino 8×8 LED Matrix Tutorial

Required Component

To build this project, we will need the following component listed below. you can buy them by clicking on the link in front of each component.

1. Arduino Uno ▶  https://educ8s.tv/part/ArduinoUno

2. 8×8 LED Matrix ▶ https://educ8s.tv/part/8x8Matrix

3. Wires ▶ https://educ8s.tv/part/Wires

[adsense]

Schematics

The circuit diagram/ schematics for this project is shown below.

The connection between the display and the Arduino is simple, thanks to the MAX7221 driver module. The pin connections are described below to make it easy to follow.

LED Matrix - Arduino

CS â–¶ D11

CLK â–¶ D10

DIN â–¶ D12

GND â–¶ GND

VCC ▶ 5V

 

Creating Graphics Easily

The 8×8 LED matrix is made up of 64 LEDs,  graphics, text, and symbols are displayed by turning certain LEDs on while other LEDs are turned off. Instead of writing the byte array to instruct the code on which LED to turn on or off when a particular text or symbol is to be displayed, we can generate the byte array with the help of a simple software called pixeltomatrix which I found online. It generates byte arrays for LED matrix after the design has been done to show which LED will stay on and Which LED will go off to properly represent the Image, symbol, or text.

Pixel to Matrix Software

 

The Graphics is drawn by highlighting each of the green boxes in the image above to represent what we wish to display like I did for “O” in the image below.

Creating a character “0”

Once highlighting has been done, click on the generate button. It will translate the pixels we have marked to a byte array ( like the one in the image below) which can be used in our code.

Generated Byte Array for Character “O”

 

Code

It’s time to finally write the Arduino code for the project. I will be doing a brief explanation of the code as it was done in the video and you can download the complete code from the attached link at the end of the page.

To drive the LED matrix using the code, we will need the LED control library. You can download the library from the link below and unzip into your Arduino Libraries folder.

——————–

LIBRARIES
——————–

? LED Control Library: https://github.com/wayoda/LedControl

Once the Library is installed,  we are ready to launch the Arduino IDE and write the code.
To explain the code as promised, the first thing we do is include the library that will be used as shown below

#include <LedControl.h>

We then declare the pins of the Arduino to which each pin of the LED matrix is connected.

int DIN = 12;
int CS =  11;
int CLK = 10;

Next, We declare the byte arrays which represent characters or graphics which we would like to display. Remember we already covered how to create graphic’s byte arrays easily above. So create some byte arrays and add them to this.

byte c[8]=     {0x7E,0x7E,0x60,0x60,0x60,0x60,0x7E,0x7E};
byte eight[8]= {0x7E,0x7E,0x66,0x7E,0x7E,0x66,0x7E,0x7E};
byte s[8]=     {0x7E,0x7C,0x60,0x7C,0x3E,0x06,0x3E,0x7E};
byte dot[8]=   {0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18};
byte o[8]=     {0x7E,0x7E,0x66,0x66,0x66,0x66,0x7E,0x7E};

Next, we initialize the LED control library by creating an object of the library after which we move to the void setup function to prepare the display by taking it off the power saving mode, setting the brightness of the LEDs to the maximum and clearing the Display.

LedControl lc=LedControl(DIN,CLK,CS,0);
void setup(){
 lc.shutdown(0,false);       //The MAX72XX is in power-saving mode on startup
 lc.setIntensity(0,15);      // Set the brightness to maximum value
 lc.clearDisplay(0);         // and clear the display
}

Next, we move to the loop function. since our goal is to display the graphics, its the only thing that really needs to be done there. The printbyte() function is used to display the character or graphics stored in any of the byte arrays and a delay is kept after it to enable the printed graphics to spend some time on the screen before another one is shown.

void loop(){ 
    
    printByte(smile);
     
    delay(1000);
}

Don’t forget to also enter the printByte function.

 

void printByte(byte character [])
{
    int i = 0;
    for(i=0;i<8;i++)
    {
       lc.setRow(0,i,character[i]);
    }
}

The full code can be downloaded from the link below.

——————–

CODE OF THE PROJECT & SOFTWARE
——————–

 

 

 

That’s it for this tutorial, thanks for watching and reading. You can show support by dropping comments here and subscribing to our channel on youtube.

——————–

SUBSCRIBE ON YOUTUBE

——————–

Never miss a video: Subscribe to educ8s.tv