Instructables
Picture of 16x8 LED dot matrix with MAX7219 module
BL-M12A881 diagram.png
MAX7219 pinout.png
BL-M12A881 pinout.png
BL-M12A881.jpg
MAX7219_8x8_red_dot_led_matrix_1.jpg
MAX7219_8x8_red_dot_led_matrix_2.jpg
MAX7219_8x8_red_dot_led_matrix_3.jpg
MAX7219_8x8_red_dot_led_matrix_4.jpg
16x8 LED dot matrix with MAX7219 module


The objective of this project is: to show off the use of the module "MAX7219 dot matrix display module MCU control DIY"
In order to using it you will need the module that can be purchased on ebay:

http://www.ebay.com/itm/171048735052?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

And you will need the MaxMatrix libraries files (which are 3):

https://docs.google.com/file/d/0B_YlEklLDDS7MDhRdWJKdmZQTnc/edit?usp=sharing

https://docs.google.com/file/d/0B_YlEklLDDS7WE9lQ1F1aFhnYlE/edit?usp=sharing

https://docs.google.com/file/d/0B_YlEklLDDS7djd5T2JDeFVsaVE/edit?usp=sharing



The sketch with the code can be found on the link below:

https://docs.google.com/file/d/0B_YlEklLDDS7WTF0c2hlVzFCZWc/edit?usp=sharing


Or get all files at GitHub:
https://github.com/Arduinobymyself/Matrix16x8.git


See in the attached picture the interconnection diagram between Arduino module and MAX7219 module (it was used only 2 MAX7219 modules in this case):


Arduino pin 13 (alternative: pin 10) connected to the CLK pin of the module MAX7219
Arduino pin 11 (alternative: pin 8) connected to pin DIN module MAX7219
Arduino pin 10 (alternative: 9 pin) connected to pin CS module MAX7219
GND and VCC (+5V)

To expand the number of modules, you should just connect Dout pin of one MAX7219 module  with the Din pin of the another MAX7219 module... and so on.

The MAX7219 Dout pin is at the top of the module while Din pin is at the botton of the module.


Remembering that you can connect modules as you want, just connecting  the output of one module with the input of the other and leaving the other signals in parallel.
In the sketch, you should to modify the parameter "maxInUse" for the amount of modules that  you will use.





The video is just demo.
Remember that you can modify the messages in the code itself, or use the serial console to enter the message.

http://youtu.be/uG88Tt6Apoo




A second video using four MAX7219 modules.

http://youtu.be/yFx4r-WUp5g



Questions, suggestions and for any trouble with the files, please contact by email:

marcelo.moraes.1971@gmail.com


Thanks.
1-40 of 50Next »

Hello, I´m here, with a question, my problem is when I try to enter a message vial serial console, nothing happened, can you tell me, what can we do for use the serial console to show something

Hello, I´m here, with a question, my problem is when I try to enter a message vial serial console, nothing happened, can you tell me, what can we do for use the serial console to show something

IainM128 days ago

Hi Marcelo, or anyone who has made this project.

My problem is that with using any more than one matrix (2 or 3) then the text and scrolling effects are just duplicated on the 2nd and 3rd matrix ???? Basically as if they are working independently. Data in is serial connection and clock and cs are parallel. I have used other similar libraries and the same result. Begining to think the HW may be faulty. Any Ideas anyone?

BIGDOG1971 (author)  IainM111 days ago
do not forget to modify the MAXINUSE code line to the amount of modules you are using.
BIGDOG1971 (author)  IainM111 days ago
You must use the code as shown below (up to 8 modules are allowed).

#include
#include

PROGMEM prog_uchar CH[] = {
3, 8, B00000000, B00000000, B00000000, B00000000, B00000000, // space
1, 8, B01011111, B00000000, B00000000, B00000000, B00000000, // !
3, 8, B00000011, B00000000, B00000011, B00000000, B00000000, // "
5, 8, B00010100, B00111110, B00010100, B00111110, B00010100, // #
4, 8, B00100100, B01101010, B00101011, B00010010, B00000000, // $
5, 8, B01100011, B00010011, B00001000, B01100100, B01100011, // %
5, 8, B00110110, B01001001, B01010110, B00100000, B01010000, // &
1, 8, B00000011, B00000000, B00000000, B00000000, B00000000, // '
3, 8, B00011100, B00100010, B01000001, B00000000, B00000000, // (
3, 8, B01000001, B00100010, B00011100, B00000000, B00000000, // )
5, 8, B00101000, B00011000, B00001110, B00011000, B00101000, // *
5, 8, B00001000, B00001000, B00111110, B00001000, B00001000, // +
2, 8, B10110000, B01110000, B00000000, B00000000, B00000000, // ,
4, 8, B00001000, B00001000, B00001000, B00001000, B00000000, // -
2, 8, B01100000, B01100000, B00000000, B00000000, B00000000, // .
4, 8, B01100000, B00011000, B00000110, B00000001, B00000000, // /
4, 8, B00111110, B01000001, B01000001, B00111110, B00000000, // 0
3, 8, B01000010, B01111111, B01000000, B00000000, B00000000, // 1
4, 8, B01100010, B01010001, B01001001, B01000110, B00000000, // 2
4, 8, B00100010, B01000001, B01001001, B00110110, B00000000, // 3
4, 8, B00011000, B00010100, B00010010, B01111111, B00000000, // 4
4, 8, B00100111, B01000101, B01000101, B00111001, B00000000, // 5
4, 8, B00111110, B01001001, B01001001, B00110000, B00000000, // 6
4, 8, B01100001, B00010001, B00001001, B00000111, B00000000, // 7
4, 8, B00110110, B01001001, B01001001, B00110110, B00000000, // 8
4, 8, B00000110, B01001001, B01001001, B00111110, B00000000, // 9
2, 8, B01010000, B00000000, B00000000, B00000000, B00000000, // :
2, 8, B10000000, B01010000, B00000000, B00000000, B00000000, // ;
3, 8, B00010000, B00101000, B01000100, B00000000, B00000000, // <
3, 8, B00010100, B00010100, B00010100, B00000000, B00000000, // =
3, 8, B01000100, B00101000, B00010000, B00000000, B00000000, // >
4, 8, B00000010, B01011001, B00001001, B00000110, B00000000, // ?
5, 8, B00111110, B01001001, B01010101, B01011101, B00001110, // @
4, 8, B01111110, B00010001, B00010001, B01111110, B00000000, // A
4, 8, B01111111, B01001001, B01001001, B00110110, B00000000, // B
4, 8, B00111110, B01000001, B01000001, B00100010, B00000000, // C
4, 8, B01111111, B01000001, B01000001, B00111110, B00000000, // D
4, 8, B01111111, B01001001, B01001001, B01000001, B00000000, // E
4, 8, B01111111, B00001001, B00001001, B00000001, B00000000, // F
4, 8, B00111110, B01000001, B01001001, B01111010, B00000000, // G
4, 8, B01111111, B00001000, B00001000, B01111111, B00000000, // H
3, 8, B01000001, B01111111, B01000001, B00000000, B00000000, // I
4, 8, B00110000, B01000000, B01000001, B00111111, B00000000, // J
4, 8, B01111111, B00001000, B00010100, B01100011, B00000000, // K
4, 8, B01111111, B01000000, B01000000, B01000000, B00000000, // L
5, 8, B01111111, B00000010, B00001100, B00000010, B01111111, // M
5, 8, B01111111, B00000100, B00001000, B00010000, B01111111, // N
4, 8, B00111110, B01000001, B01000001, B00111110, B00000000, // O
4, 8, B01111111, B00001001, B00001001, B00000110, B00000000, // P
4, 8, B00111110, B01000001, B01000001, B10111110, B00000000, // Q
4, 8, B01111111, B00001001, B00001001, B01110110, B00000000, // R
4, 8, B01000110, B01001001, B01001001, B00110010, B00000000, // S
5, 8, B00000001, B00000001, B01111111, B00000001, B00000001, // T
4, 8, B00111111, B01000000, B01000000, B00111111, B00000000, // U
5, 8, B00001111, B00110000, B01000000, B00110000, B00001111, // V
5, 8, B00111111, B01000000, B00111000, B01000000, B00111111, // W
5, 8, B01100011, B00010100, B00001000, B00010100, B01100011, // X
5, 8, B00000111, B00001000, B01110000, B00001000, B00000111, // Y
4, 8, B01100001, B01010001, B01001001, B01000111, B00000000, // Z
2, 8, B01111111, B01000001, B00000000, B00000000, B00000000, // [
4, 8, B00000001, B00000110, B00011000, B01100000, B00000000, // \ backslash
2, 8, B01000001, B01111111, B00000000, B00000000, B00000000, // ]
3, 8, B00000010, B00000001, B00000010, B00000000, B00000000, // hat
4, 8, B01000000, B01000000, B01000000, B01000000, B00000000, // _
2, 8, B00000001, B00000010, B00000000, B00000000, B00000000, // `
4, 8, B00100000, B01010100, B01010100, B01111000, B00000000, // a
4, 8, B01111111, B01000100, B01000100, B00111000, B00000000, // b
4, 8, B00111000, B01000100, B01000100, B00101000, B00000000, // c
4, 8, B00111000, B01000100, B01000100, B01111111, B00000000, // d
4, 8, B00111000, B01010100, B01010100, B00011000, B00000000, // e
3, 8, B00000100, B01111110, B00000101, B00000000, B00000000, // f
4, 8, B10011000, B10100100, B10100100, B01111000, B00000000, // g
4, 8, B01111111, B00000100, B00000100, B01111000, B00000000, // h
3, 8, B01000100, B01111101, B01000000, B00000000, B00000000, // i
4, 8, B01000000, B10000000, B10000100, B01111101, B00000000, // j
4, 8, B01111111, B00010000, B00101000, B01000100, B00000000, // k
3, 8, B01000001, B01111111, B01000000, B00000000, B00000000, // l
5, 8, B01111100, B00000100, B01111100, B00000100, B01111000, // m
4, 8, B01111100, B00000100, B00000100, B01111000, B00000000, // n
4, 8, B00111000, B01000100, B01000100, B00111000, B00000000, // o
4, 8, B11111100, B00100100, B00100100, B00011000, B00000000, // p
4, 8, B00011000, B00100100, B00100100, B11111100, B00000000, // q
4, 8, B01111100, B00001000, B00000100, B00000100, B00000000, // r
4, 8, B01001000, B01010100, B01010100, B00100100, B00000000, // s
3, 8, B00000100, B00111111, B01000100, B00000000, B00000000, // t
4, 8, B00111100, B01000000, B01000000, B01111100, B00000000, // u
5, 8, B00011100, B00100000, B01000000, B00100000, B00011100, // v
5, 8, B00111100, B01000000, B00111100, B01000000, B00111100, // w
5, 8, B01000100, B00101000, B00010000, B00101000, B01000100, // x
4, 8, B10011100, B10100000, B10100000, B01111100, B00000000, // y
3, 8, B01100100, B01010100, B01001100, B00000000, B00000000, // z
3, 8, B00001000, B00110110, B01000001, B00000000, B00000000, // {
1, 8, B01111111, B00000000, B00000000, B00000000, B00000000, // |
3, 8, B01000001, B00110110, B00001000, B00000000, B00000000, // }
4, 8, B00001000, B00000100, B00001000, B00000100, B00000000, // ~
};

int data = 8; // DIN pin of MAX7219 module
int load = 9; // CS pin of MAX7219 module
int clock = 10; // CLK pin of MAX7219 module

int maxInUse = 4; //change this variable to set how many MAX7219's you'll use

MaxMatrix m(data, load, clock, maxInUse); // define module

byte buffer[100];

// active sentenses
char string1[] = " Hello, my name is ... ";
char string2[] = " I am glad to show you my Arduino scrolling dot Matrix ";
char string3[] = " using MAX7219 IC ";
char string4[] = " up to 8 modules ";
char string5[] = " There you will find a lot of projects with Arduino. ";
char string6[] = " =) ";

// just for tests
char string7[] = " A B C D E F G H I J K L M N O P Q R S T U V X W Y Z ";
char string8[] = " a b c d e f g h i j k l m n o p q r s t u v x w y z ";
char string9[] = " 1 2 3 4 5 6 7 8 9 0 - = ";
char string10[] = " ! @ # $ % ¨ & * ( ) _ + ";
char string11[] = " ' , . ; ~ ] ´ [ | < > : ^ } ` { / ? ";

void setup(){
m.init(); // module initialize
m.setIntensity(5); // dot matix intensity 0-15
Serial.begin(9600); // serial communication initialize
}

void loop(){

// this is the code if you want to entering a message via serial console
while (Serial.available() > 0){
byte c = Serial.read();
Serial.println(c, DEC);
printCharWithShift(c, 100);
}
delay(100);
m.shiftLeft(false, true);

/*
// print the active sentences
printStringWithShift(string1, 100);
printStringWithShift(string2, 100);
printStringWithShift(string3, 100);
printStringWithShift(string4, 100);
printStringWithShift(string5, 100);
printStringWithShift(string6, 100);
*/


}

void printCharWithShift(char c, int shift_speed){
if (c < 64) return;
c -= 64;
memcpy_P(buffer, CH + 7*c, 7);
m.writeSprite(64, 0, buffer);
m.setColumn(64 + buffer[0], 0);

for (int i=0; i {
delay(shift_speed);
m.shiftLeft(false, false);
}
}

void printStringWithShift(char* s, int shift_speed){
while (*s != 0){
printCharWithShift(*s, shift_speed);
s++;
}
}

Hi great project,ive been looking for this exact think,this the only one ive found that works,just one problem getting serial to work,ive uncomented the serial bit of code but am i suposed to coment out somthing els to stop the code thats allready running. thank.

Had the same issue and found the solution: When chaining them together, remember that the one that is connected to the Arduino is where the message STARTS. So, arrange them in order from the last connected to the first. When the message scrolls, it should appear normally, scrolling from right to left.

parsing1 month ago

Fantastic work fine !!!!! Finalmente grazie a Marcelo comincio ad entrare un pò nel mondo arduino!!! Grazie!!!! Thank you very much for your work!!!!!!!

BIGDOG1971 (author)  parsing1 month ago
You're welcome :)
Thanks you too.

Cheers!
davebodnar5 months ago

Good news! I spent some time experimenting today and have the software working well with up to 9 modules. Details of how this can be done are on my web page here:

http://www.trainelectronics.com/Arduino/LED_Matrix...

I was unable to get more than 9 working but hope that I or someone else will figure it out!

Again, Marcelo, thanks for your project!

dave

index.2.jpgindex.4.jpg

Thank you davebodnar!!!!!! Grazie alle tue fotografie sono riuscito a collegare tutto in modo funzionante!!!!!!!!!!!!!!!!!!! You are great!!!!!!

RFOA3 months ago

Gostaria se possível mostrar com liga dois módulos, a gente não acha material nenhuma ensinando, só fala por auto, vi materiais que diz que é só conectar a saída de cima na entrada do outro que da certo, in no out do outro, mas não consegui se possível poste fotos e um exemplo de código, ajudará muitas pessoas deste forum obrigado pela atenção.

BIGDOG1971 (author)  RFOA2 months ago
Olá

Todo o esquema está na matéria.

Realmente é só ligar a saída de um módulo com a entrada do próximo e assim por diante. os outros pinos ficam em paralelo.

Dá uma olhada no esquema.


Atenciosamente.

Marcelo
rinthesun4 months ago

For anyone else trying to build a banner display with these modules here are some comments. 1) I have followed davebodna software suggestions for code changes with success, i.e., the second 32's. 2) I have been linking the modules with the jumper wires provided in a daisy chain and found that the banner becomes unstable at 6 units. I note that davebodnar is bussing power, grd, CS and CLK and, in my case, suspect that the daisy chaining is the problem, so take note.

davebodnar made it!5 months ago

Good news! I spent some time experimenting today and have the software working well with up to 9 modules. Details of how this can be done are on my web page here:

http://www.trainelectronics.com/Arduino/LED_Matrix...

I was unable to get more than 9 working but hope that I or someone else will figure it out!

Again, Marcelo, thanks for your project!

dave

index.2.jpgindex.4.jpg
davebodnar5 months ago

Marcelo - First I would like to thank you for an excellent project! I have a number of units working well and find them fascinating!

Unfortunately I have the same problem as "perryscope" when I get above 5 modules. Even after editing the code (changing 32 to 64, etc) the display shows only upper case and some characters are not represented accurately at all.

Can you help with code that works reliably with six or more modules? I have materials to go to 10 modules and hope to get it working soon.

I apprecaite your help!

dave

perryscope5 months ago

I am having problems using any more that 4 modules?

Up to 4 and its working great!

If I add a fifth module then i get corrupted columns on the first module, iF i add a sixth I get more corrupted columns on the second display as well as corruption on all of the first?

I tried the change to the printCharWithShift Function as sugested to..

void printCharWithShift(char c, int shift_speed){
if (c < 64) return;
c -= 64;
memcpy_P(buffer, CH + 7*c, 7);
m.writeSprite(64, 0, buffer);
m.setColumn(64 + buffer[0], 0);

for (int i=0; i<buffer[0]+1; i++)

delay(shift_speed);
m.shiftLeft(false, false);
}
}

...and this then used all six modules correctly but everything was in upper case and no spaces were shown?

Can anyone share some there code thats working for more than 4 modules?

Cheers

sweet_coffee made it!5 months ago

Wonderful! Done with five 8x8 arrays, the next target is fifteen or even twenty :-)

Dude you re great!

10314556_10204003808921649_7728854692234660514_n.jpg10169174_10204003809521664_6395581929923837895_n.jpg
pisler7 months ago

Goal achieved

http://youtu.be/u0E5JSqfUfU

BIGDOG1971 (author)  pisler7 months ago
Awesome!

Well done!!! Congratulations. You did a perfect Daft Punk Helmet.
Do you plan to market this project?


Cheers!
VSS7 months ago

Hello !

I have the same problem as makini_kini:

Build options changed, rebuilding all
MAX7219_5:135: error: 'MaxMatrix' does not name a type
MAX7219_5.ino: In function 'void setup()':
MAX7219_5:159: error: 'm' was not declared in this scope
MAX7219_5.ino: In function 'void printCharWithShift(char, int)':
MAX7219_5:196: error: 'm' was not declared in this scope
MAX7219_5.ino: In function 'void printString(char*)':
MAX7219_5:221: error: 'm' was not declared in this scope

I deleted the contents of the directory libraries. It does not work still. I installed the Arduino again. I still have a problem :(

Please help

Artur

BIGDOG1971 (author)  VSS7 months ago
Hi,

This kind of issue is due to libraries installation failure.
To solve the problem, proceed as shown below.

Remove all project libraries from the "libraries" folder.
To install the libraries, follow the steps below:
1 - take sure that the Arduino's IDE is closed;
2 - unzip the libraries in the "libraries" folder of the Arduino's IDE;
3 - open the .ino file and compile it..

90% of people with this kind of problem, have solved it by following the procedure above.
If not, please re-install the arduino's IDE.


I hope I have helped you.

Feel free to send me your questions.


Best Regards


Marcelo Moraes
arduinobymyself.blogspot.com.br
arduinobymyself@gmail.com
pisler made it!7 months ago

Hello,

I'm trying to make a replica of the daft punk helmet for my daughter.

I have a problem of display with 6 MAX7219.

You see on these video you can see my wiring, and the part of code used for display the strings.

http://youtu.be/1DcY2Yp2T1g

First problem (with the first part of code):

When MaxinUse is > 4, on the right, after 4 characters displayed there on the first and second matrix some lines and not the following characters.

Second problem (with an other part of code):

It's not the correct characters displayed (A is replaced by !) etc... and i have never the small characters (abcdef...).

Question:

Is my wiring correct (the first maxtrix connected to arduino is at right), could you help me ?

Thanks

Diapositive1.jpg
makini_kini7 months ago

HELP ME PLEASE

Arduino: 1.5.6-r2 (Windows 7), Board: "Arduino Uno"

MAX7219_5:135: error: 'MaxMatrix' does not name a type
MAX7219_5.ino: In function 'void setup()':
MAX7219_5:159: error: 'm' was not declared in this scope
MAX7219_5.ino: In function 'void printCharWithShift(char, int)':
MAX7219_5:196: error: 'm' was not declared in this scope
MAX7219_5.ino: In function 'void printString(char*)':
MAX7219_5:221: error: 'm' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

BIGDOG1971 (author)  makini_kini7 months ago
Hi Makini_kini.

This kind of issue is due to libraries installation failure.
To solve the problem, proceed as shown below.

Remove all project libraries from the "libraries" folder.

To install the library(ies), follow the steps below:
1 - take sure that the Arduino's IDE is closed;
2 - unzip the library(ies) in the "libraries" folder of the Arduino's IDE;
3 - open the .ino file and compile it..

90% of people with this kind of problem, have solved it by following the procedure above.
If not, please re-install the arduino's IDE.


I hope I have helped you.
Feel free to send me your questions.

Best Regards

Marcelo Moraes
arduinobymyself.blogspot.com.br
arduinobymyself@gmail.com
Hello Marcelo
I am trying to do scrolling text with two pieces of MAX7219 module.
The sketch code for this ....is your and found it here
https://docs.google.com/file/d/0B_YlEklLDDS7WTF0c2hlVzFCZWc/edit?usp=sharing the link found it here
i want to do something like this http://youtu.be/uG88Tt6Apoo
But i do not found the sketch ....i have arduino Uno and the last arduino software .
I was trying all your solutions without results .....always problem.....
Please help me.
BIGDOG1971 (author)  makini_kini7 months ago

Hi Makini,

Send me an email requesting the code and libraries and I will share the files with you.

email adrress: arduinobymyself@gmail.com

Thank you Marcelo for your time i will send you asap..........

saleemqamar8 months ago

Hi,

I have 7 modules working but when I start the power, sometimes all or some modules are coming ON. How can I switch OFF all the modules at reset/start up?

Thx

Sal

BIGDOG1971 (author)  saleemqamar7 months ago
Hi Sal,

There is not any function to reset the matrix.
Maybe you can set the intensity to zero at the start-up.


Best regards.

Thanks a lot, I will try this.

Sal

Elsoy8 months ago
What i make wrong?

http://www.youtube.com/watch?v=qTn29zvH750&feature=youtu.be
BIGDOG1971 (author)  Elsoy7 months ago
Hi Elsoy,

Check if the "maxInUse" parameter is set to 4 modules.
And check all connections between modules.


Best regards.


Marcelo Moraes
arduinobymyself.blogspot.com.br
arduinobymyself@gmail.com
lmantovan9 months ago

Hi Marcelo, great project!!! But I'm trying to make a 8x64 matrix by using 8 MAX7219 and something doesn't work. As you suggested I changed the maxInUse parameter to 8 and the first 4 modules don't show any message but only strange figures.

Please, can you help me? Have you ever tried to put together more than 4 modules?

thx in advance!

Luca

BIGDOG1971 (author)  lmantovan8 months ago
Hello Luca,

Do you need to change the code lines below on the printCharWithShift() function.

void printCharWithShift(char c, int shift_speed){
if (c < 64) return;
c -= 64;
memcpy_P(buffer, CH + 7*c, 7);
m.writeSprite(64, 0, buffer);
m.setColumn(64 + buffer[0], 0);

for (int i=0; i {
delay(shift_speed);
m.shiftLeft(false, false);
}
}

Try this code and tell me the results.


Best Regards


Marcelo Moraes
arduinobymyself.blogspot.com.br
arduinobymyself@gmail.com
ctakai10 months ago
Hello!
You brazilian:
BIGDOG1971 (author)  ctakai10 months ago
Yes, I am Brazilian.
Sim, eu sou Brasileiro.
ctakai BIGDOG197110 months ago
Oi, Marcelo - estou começando no arduino agora.q mes atrás (meu novo Hobby)

Meu interesse veio pelo meu vizinho que montou uma impressora 3D.
Parabens pelo seu Instructables e o seu blog, bem didático..
Agora vou montar um cubo de led de 8x8x8 (já montei um de 3 e 4)

Valeu! forte abrs
alexkirlian11 months ago
Marcelo will.
How can I insert special characters in the table so that they appear in the array?
Kind hearts and arrows.
BIGDOG1971 (author)  alexkirlian10 months ago
Hi Alexkirlian,

Yes, you can insert these types of characters in the array and replace characters not normally used by him (example: the character "}" could be the symbol "Heart".
1-40 of 50Next »