Controlling 8x8 LED Matrix with MAX 7219

Hey guys,

I’m relative new to the Arduino world. I’ve got this LTP-2B88AG-NB LED Matrix from the LITEON brand. And a Max7219 Driver for controlling it. I also have an Arduino UNO. As the thread title suggests i want to control the matrix with the MAX 7219 using the arduino.

I tried to wire things up correctly on the breadboard several times but failed at having success. The lights of the arduino light up and moved but in some weird way which doesn’t make any sense in regards to the sketch I am using. I’ll post the sketch here and some pictures concerning the wiring, for your further understanding.

My first question is are all pins on an 8x8 led matrix components ordered the same way on every 8x8 matrix from every brand? They all look the same but is the order of the pins on the back of the matrix also the same? The following video would indicate it…

After a longer rather period of time i found it but I still can’t seem to get things up and running.

In this video it seems that all led matrixes would be built the same and one could just lay them on your table in a certain position to know how the pin numbers are ordered, am I actually right with this? :confused:

I am doing this project for a subject in university some fellow students gave me the sheet which i attached to this post.

Am I reading it right as it indicates to connect the pin numbers near the graphic on the sheet to each port of the MAX7219? I have done that, but it just won’t give me the sequence of flashing LEDS as outlined in the sketch.

My routing from the Max7219 to the arduino is the following:

int DIN = 12;
int CS = 11;
int CLK = 10;
int GND = GND;
int V+ = 5V;

I am using this LCD Demo Matrix Code:

#include <LedControl.h>

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

byte e[8]=     {0x7C,0x7C,0x60,0x7C,0x7C,0x60,0x7C,0x7C};
byte d[8]=     {0x78,0x7C,0x66,0x66,0x66,0x66,0x7C,0x78};
byte u[8]=     {0x66,0x66,0x66,0x66,0x66,0x66,0x7E,0x7E};
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};
byte m[8]=     {0xE7,0xFF,0xFF,0xDB,0xDB,0xDB,0xC3,0xC3};

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

void loop(){ 

   byte smile[8]=   {0x3C,0x42,0xA5,0x81,0xA5,0x99,0x42,0x3C};
   byte neutral[8]= {0x3C,0x42,0xA5,0x81,0xBD,0x81,0x42,0x3C};
   byte frown[8]=   {0x3C,0x42,0xA5,0x81,0x99,0xA5,0x42,0x3C};




void printEduc8s()

void printByte(byte character [])
 int i = 0;

And the LedControl library I added to my arduino via the library manager it is from Eberhard Fahle.

I hope this post is somewhat clear to you if somethings not clear please ask. As already mentioned I am attaching pictures of the whole builup, the “cheat-sheet” and the code. I hope someone can help… :slight_smile:

I may already thank you in advance for your help!

Closer Look.JPG




Please post your code using code tags </> in the edit control. You should edit your previous post to include them. This avoids the markup functionality from creating artefacts like smiley faces and italics (which you have) and makes it easier to read the code.

In this video it seems that all led matrixes would be built the same and one could just lay them on your table in a certain position to know how the pin numbers are ordered, am I actually right with this?

Yes, all the matrices with similar part numbers are built the same way. There are 2 types of matrix, however, where the rows and columns are switched around (ie, common cathode or common anode, or similar naming) but they also have different part numbers. You can download the data sheet from the web to see what the actual pinout is. You will find that on the lower edge of the matrix there is a little square tab that will help you orient them in a consistent manner.

The data sheet for the MAX7219 also has suggestions for 2 capacitors and a resistor in the circuit that I cannot see in yours. You should get that data sheet and read it.


thanks for the help. :slight_smile: I have got the datasheets of both of the components here. I attached three pages of the Matrix-Datasheet to this reply. One with the order of the pins on how to connect the pin numbers, one with the circuit diagram and one with the package dimensions. Also i attached one picture of the back of the LED-Matrix already indicating pin-numbers that seem to be false… (As already mentioned this is a university project so the matrix was in other hands before…)

But I am still struggling to know how the pin-numbers are ordered on the back of the Matrix. Are the pin numbers on the one side from 1-8 and then from 9-16 or are they ordered in the following way as the circuit diagram seems to show from 1-6-16-4-9-15-10-13 and then from 8-7-3-14-2-12-11-5 on the other side? I tried to connect either ways several times but I can’t get it to work…

I attached another picture for the square tab. Is it this little square on the outer left of the matrix? If it is what does it indicate for me?

Little square tab on mine are shown in Fig 9 in the PDF attached. Once you work out where pin 1 is in relation to the tab you can get the same orientation every time. That PDF also has a circuit that i know works.

Pins for devices like this are numbered in order the same as DIP ICs - 1 to n down one side and then n+1 to x up the other side.

Parola PCB Hardware BOM and Construction (1).pdf (279 KB)