top of page

Character Displaying using 8X8 LED Matrix MAX7219 with Arduino Uno

What is a Matrix Display?



Dot-matrix LED display contains the group of LEDs as a two-dimensional array. They can display different types of characters or a group of characters. Dot-matrix LED display contains the group of LEDs as a two-dimensional array. They can display different types of characters or a group of characters. Dot-matrix display is manufactured in various dimensions. The arrangement of LEDs in the matrix pattern is made in either of the two ways: Row anode-column cathode or Row cathode-column anode. By using this dot matrix display we can reduce the number of pins required for controlling all the LEDs.


Material Required:

Material Quantity

Arduino Uno 1

MAX 7219 Display Module 1

Jumper cables 5


Pinout Diagram:



Circuit Diagram:




Working:


An LED dot matrix consists of an array of LEDs that are connected such that the anode of each LED is connected in the same column and the cathode of each LED is connected in the same row or vice versa.



Here each dot represents circular lenses in front of LEDs. This is done to minimize the number of pins required to drive them. For example, an 8X8 matrix of LEDs would need 64 I/O pins, one for each LED pixel. By connecting all the anodes of LEDs in a column and all the cathodes together in a row, the required number of input and output pins is reduced to 16. Each LED will be addressed by its row and column number.


Controlling the LED Matrix:


Since all the LEDs in a matrix share their positive and negative terminals in each row and column, it is not possible controlling of each LED at the same time. The matrix controlled through each row very quickly by triggering the correct column pins to light the desired LED for that particular row. If the switching is done with a fixed rate, humans can’t see the displaying message, because the human eye can’t detect the images within the milliseconds. Thus the displaying of a message on an LED matrix must be controlled, with the rows being scanned sequentially at a rate greater than 40 MHz while sending out the column data at the same rate. This kind of control can be done by interfacing the LED matrix display with the microcontroller.


Interfacing the LED Matrix Display with Microcontroller:


Choosing a microcontroller for interfacing with the LED matrix display which is to be controlled is depends on the number of input and output pins needed for controlling all the LEDs in the given matrix display, the amount of current that each pin can source and sink, and the speed at which the microcontroller can send out control signals. With all these specifications, interfacing can be done for LED matrix display with a microcontroller.



Tested Programming Code:


A library needs to be downloaded and then to be installed. Go to Disk drive where your Arduino IDE is installed and then go to > Program Files>Arduino> Libraries> then Ctrl+V (Paste).

https://github.com/riyas-org/max7219/tree/master/MaxMatrix

https://github.com/riyas-org/max7219: Main Link


#include <MaxMatrix.h>


int DIN = 7; // DIN pin of MAX7219 module


int CLK = 6; // CLK pin of MAX7219 module


int CS = 5; // CS pin of MAX7219 module


int maxInUse = 1;


MaxMatrix m(DIN, CS, CLK, maxInUse);


char A[] = {4, 8,


B01111110,


B00010001,


B00010001,


B01111110,


};


char B[] = {4, 8,


B01111111,


B01001001,


B01001001,


B00110110,


};


char smile01[] = {8, 8,


B00111100,


B01000010,


B10010101,


B10100001,


B10100001,


B10010101,


B01000010,


B00111100


};


char smile02[] = {8, 8,


B00111100,


B01000010,


B10010101,

B10010001,


B10010001,


B10010101,


B01000010,


B00111100


};


char smile03[] = {8, 8,


B00111100,


B01000010,


B10100101,


B10010001,


B10010001,


B10100101,


B01000010,


B00111100


};


void setup() {


m.init(); // MAX7219 initialization


m.setIntensity(8); // initial led matrix intensity, 0-15


}


void loop() {

// Seting the LEDs On or Off at x,y or row,column position

m.setDot(6,2,true);


delay(1000);


m.setDot(6,3,true);


delay(1000);

m.clear(); // Clears the display for (int i=0; i<8; i++){ m.setDot(i,i,true);

delay(300);


}

m.clear();

// Displaying the character at x,y (upper left corner of the character)

m.writeSprite(2, 0, A);

delay(1000); m.writeSprite(2, 0, B); delay(1000); m.writeSprite(0, 0,

smile01); delay(1000);

m.writeSprite(0, 0, smile02);


delay(1000);


m.writeSprite(0, 0, smile03);


delay(1000);


for (int i=0; i<8; i++){


m.shiftLeft(false,false);


delay(300);


}

m.clear();

}


Program Description:


So first we need to include the MaxMatrix.h library, define the pins to which the module is connected, set how many modules we use and define the MaxMatrix object.


For displaying characters, we need to define them in an array of characters or bytes, and here I have several examples. We can notice how the bits are forming the characters which are zeros and ones. In this case, they are rotated 90 degrees but the library example suggests using them in such a way so that would be easier later to implement the shift left custom function for scrolling a text.



Precautions:


1. Double Check the connections before powering on the circuit.

2. Don’t use loose jumper cables.

3. Check Whether the proper board is selected from Arduino IDE.

4. Ensure proper placement of sensor for correct working.


Conclusion:


You can successfully program different characters on a matrix display, this display can be combined with many more displays to get a larger display area.



Output::




GET IN TOUCH

We'd love to hear from you

bottom of page