Introduction: Multiple LED Matrices With Arduino

Picture of Multiple LED Matrices With Arduino
This project is based on a workshop that we organised at Makespace Madrid as part of  "La noche de la electrónica con Jameco".  In a previous instructable we already introduced how to manage a single LED matrix with Arduino. In this project we connect multiple matrices to display text  messages.

It is recommended that you have followed the previous instructable before you do this one.

Step 1: Components

Picture of Components

For this project, you need the following components:
- Arduino Uno board
- 4 MAX7219 Red Dot Matrix Module
- 17  jumper wires M/M (male/male)
- 3 jumper wires F/M (female/male)
- Breadboard

Although this instructable uses an Arduino Uno board, you can use other Arduino (compatible) boards

IMPORTANT: The LED matrix is common cathode. This module does not work with common anode matrices.

Step 2: Arduino Library

If you have not installed the Arduino library yet (LEDControlMS), do it now. You can find the library and the installation instructions here.

Step 3: Wiring of Common PINs

Picture of Wiring of Common PINs

The LED Matrix modules have two sets of male header PINs, one for input (the PINs located closer to the MAX 7219 chip) and one for output.

All the PINs are named in the modules.
The difference between input and ouput only applies to the data PIN (DIN and DOUT).
For the rest of the PINs (VCC, GND, CS and CLK), the PIN at the input header is physically connected/shortcut to the PIN at the output header (this is because all the MAX7219 are daisy-chained sharing an SPI bus).

Enough talking. Let's wire the LED matrices:

First use the breadboard to plug the matrices. Plug them through the input headers (the MAX7219 chip should be below the LED matrix). and the output header PINs should show up at the top).
Place the four matrices next to each other so that there is no space left between them (see picture)

Now you have to connect all the VCC PINs of all the four matrices. Use 3 jumper wires (M/M) and connect using the breadboard holes:
 - VCC of matrix 1 with VCC of matrix 2
 - VCC of matrix 2 with VCC of matrix 3
 - VCC of matrix 3 with VCC of matrix 4

To avoid errors connecting the wrong cable to the wrong PIN, it is recommended that you use different wire colours for different PINs (red colour in the pictures for VCC)

Repeat the same process to connect all the GND PINs of the four matrices (yellow colour in the pictures)
Repeat the same process to connect all the CS PINs of the four matrices (blue colour in the pictures)
Repeat the same process to connect all the CLK PINs of the four matrices (white colour in the pictures)

Step 4: Wiring of Data PINs

Picture of Wiring of Data PINs

The four LED matrices are daisy-chained and this requires that the DATA output (DOUT) of one matrix is input to the next matrix (DIN).

Connect using F/M jumper wires (orange colour in the picture):
- DOUT of matrix 1 (header PINs) with DIN of matrix 2 (hole in breadboard)
- DOUT of matrix 2 (header PINs) with DIN of matrix 3 (hole in breadboard)
- DOUT of matrix 3 (header PINs) with DIN of matrix 4 (hole in breadboard)

Step 5: Wiring of Arduino

Picture of Wiring of Arduino

Now you have to connect Arduino to the first LED matrix.

Use 5 M/M jumper wires to connect:
LED Matrix 1               Arduino         Colour of wire in picture
(hole in breadboard)
VCC                              5V                       Red
GND                            GND                    Yellow
DIN                              D12                     Orange
CS                                D10                     Blue
CLK                             D11                      White

It is important that you double-check all the wires and connections. One wire wrongly connected (or disconnected) is enough to prevent the correct working of the 4 matrices.

Step 6: Arduino Sample Sketch

Picture of Arduino Sample Sketch

Download the arduino sketch below (you will need to unzip it), open it from your arduino IDE and upload it to your Arduino

Note1: if the version of your Arduino IDE is "quite" old (0.x) you will need to change the extension of the arduino sketch from .ino to .pde (MakeSpaceTitle_LEDMatrix.ino -> MakeSpaceTitle_LEDMatrix.pde)

Note2: Before uploading the sketch, make sure that you have selected the right card and serial port for your arduino

Step 7: Sketch File (just in Case)

If you have been able to open the sketch file in the previous step, skip this step.

Here is the sketch file with .txt extension.  For security reasons, instructable does not allow to upload files with uncommon extensions such as .ino used by arduino sketches.

Open a new sketch in your arduino IDE and copy the text content of this file. You can then upload it to your arduino as explained in the previous step.


Picture of Scroll "MAKESPACE MADRID"
If everything worked fine, your LED matrices  should start scrolling the text "MAKESPACE MADRID" as shown in the video.

Study the code in the example sketch and update it to display other texts or create new effects.

Just one hint: most of the methods in the library have a first parameter called 'addr' or 'matrix'. This is the index of the matrix that the command refers to. This index starts from 0, so in our example, the matrix connected to the arduino board is index 0 and the last matrix is index 3 (see picture).

And now, if you really want to learn, dive into the code of the library to understand how it works and create new functions to make the most of your LED matrices.


EspinozaL (author)2017-11-27

Buen tutorial tumaku quiero saber si existe librerias que se pueden controlar unas 25 matrices para arriba?

jez990 (author)2017-03-04

I have cascaded led matrices 8x32 built together. I did the coded above but the characters are scrolling vertically. Just wondering if the library has function to have it scroll horizontally on 4 cascaded led matrix. Thanks!

tumaku (author)jez9902017-03-04

I am not sure what you mean by "scroll horizontally".

The current library can drive up to 8 matrices (8x8 leds each) with a basic/coarse scroll. If you want another type of scroll, the library or the sketch will require to be updated.

PierreV16 (author)2017-01-26

I have only 2 matrix 8x8. The text is not scrolling but moves from letter to letter. I used the codes from this site. Can anyone help that it can scrolling? Thanks.

tumaku (author)Caristico2017-02-14

Thanks for the link!

engdar (author)2016-10-25

Hello Tumaku. Great project! I have a question about how can I change the letters to display to display something else? Which file would I change and where would that change be? Thanks.

ToreE3 (author)2016-08-03

Hi, Grate instruction,, But have you found out how to put text on the matrix
that dont scrol, ?? I got 4 matrix displays, eatch with a Max72 hov can i
put up the a number ie 2016 without scrolling ??


guillermo5371 (author)2016-06-24

Hi, How can I change the the direction of the words?, I charge the code, then in each matrix display the same message, thanks for your response

tumaku (author)guillermo53712016-06-25

I am not sure if I understand what you mean by "changing the direction of the words"
The current code starts displaying the first character on the right-most matrix (index 0) and then it scrols the text moving to the left.
This means that your matrices are aligned with matrix 0 on the right and matrix 3 on the right and the text scrolls right to left

To achieve the effect of the text entering through the left-most matrix and scrolling left to right, you should change the code. Alternatively you can:
- reorder physically the matrices: make matrxi index 0 the left-most and matrix 3 the right-most.
- reverse the order of the string you want to write (e.g. "DLROW OLLEH" instead of "HELLO WORLD"

EmilyW60 (author)2016-05-08

only two of mine are working, i've checked the code and my wiring multiple times but nothing is wrong :/

tumaku (author)EmilyW602016-05-08

I cannot help you without further info. It looks like wrong wiring or wrong soldering (if one matrix is wrong, the other matrices down the lane may not work).

Two things you could check:

- make sure that your code includes: #define NBR_MTX 4

- change the connecting order of your matrices. If the issue is with just one of them, you will be able to identify which one is the culprit.

KyleL37 (author)2016-03-25

Hi Tumaku, very cool. I am trying to get 10 matrices to run, but have only been able to use 8 so far. Is this an issue with the chip or the software?

tumaku (author)KyleL372016-03-25

Definitely the library (SW) limits the maximum number of matrices to 8.
I am not usre if the HW sets a limmit to the number of matrices that can be daisy-chained. Searching in Internet I have found this project that uses 12 matrices You should also be careful with the power you need to lit so many matrices.

joshual40 (author)2016-01-17

When I use 5 matrices only four of them display letters, but when I reset they all light up and then go back to only 4, I already edited the code to 5 MTX. Help plz

joshual40 (author)joshual402016-01-17

never mind I just had to at ch. 4

tumaku (author)joshual402016-01-17

Hi joshual40,

from your comments I guess that you have solved your issues installing and using the library. Let me know otherwise.

I never used the library with 5 matrices, but I did with 1, 4 or 8 matrices and it worked fine.

Thanks for following my instructable!

joshual40 (author)tumaku2016-01-19

all I did was declare another character (ch4) and insert it into the code where needed but this instructable was very fun to follow and do

joshual40 (author)2016-01-16

I'm sill confused on how to install the library. Help please. A video would be best. rsvp Thanks

MarcusB24 (author)2016-01-02

I copied and pasted the 4 matrix code and yet when i compile it it say error about the

#include "LedControlMS.h"

help please??

tumaku (author)MarcusB242016-01-03

Probbly this errr appears because the Arduino compiler cannot find the library file. Please follow the instructions in my instructable about how to instll the library (or any other tutorial). Take into account that different installations of the IDE may stre libraries at different locations. Also note that older versions of the Arduino IDE require that you close ALL Arduino windows after installing a library before you can use it.

WhittlinThom (author)2016-01-02

Hi, I built it just like your instructor said but when I try to upload it it says in orange, "avrdude: stk500_getsync(): not in sync: resp=0x30". Can you tell me what I did wrong and how I can fix it, please? Thank you, Thom Mulford / WhittlinThom

tumaku (author)WhittlinThom2016-01-03

This error has nothing to do with this project but rather with the arduino IDE and driver that you have nstalled in your computer. Do a ogle search and you will find solutions to install the right driver for your board. It might alo be that you selected the wrong board in Tools menu

pranavkompally (author)2015-11-21


Please send me the arduino code with my text hello instead of yours. The code you attached to download is not compiling and is displaying a error saying no directory or file found about the led control.h kind of thing which u entered at the starting saying include the led kind library. Please sir I need to finish this instruct able as soon as possible . Please send me the code to

I request u sir

Thank u


please send also code that says hello to

please help me,thank you

Jandirk VanO (author)2015-10-06

Dear Friend,

I Built My Project according to this Instructable. I only changed the Text to "HOW WE MAKE THINGS". After a while LED Matrix 1 Stops. Can you tell me, what I did wrong? Thank you.

tumaku (author)Jandirk VanO2015-10-16

Hi Jandirk,

When one of the matrices stops working after a while it is usually due to a bad connection in one of the cables or to a lack of power. If you are powering the matrices from Arduino, some times they may be demanding too much intensity and Arduino cannot provide it. You can power the matrices with an external power source, but make sure that you connect the grounds of Arduino and the power source.

RonnieZ1 (author)2015-10-16

Hi, I would like to add ":" to a number, I am displaying a time, I tried to do but I can't figure out how to do.

Is it available any command to add characters before sending it to display?

Thanks in advance!


tumaku (author)RonnieZ12015-10-16

Hi Ronnie,

Thanks for trying out my instructable:-)

The font is fixed and defined in the library (variable alphabetBitmap in file LedControlMS.h) You can change this variable and add/remove/change characters according to your needs. Look for one of the comments below to get more information on how it works.

But if you are looking for a colon character, it is already defined in there at alphabetBitmap[11]:

lc.displayChar(0, lc.getCharArrayPosition(11));
NoahP5 (author)2015-07-02

Can you use three matrices instead of four?

tumaku (author)NoahP52015-07-02

Yes, just update the line in the code that defines the number of matrices (change '4' by '3')

#define NBR_MTX 3

NoahP5 (author)tumaku2015-07-02


Riscyg (author)2015-06-24

Great information and very clear - many thanks :)

ElectroM (author)2015-06-10

Sir, i am a daily visitor in instructables....i planned to. make scrolling led matrix bar display in front of my shop...i want to display services like photostat,print,recharge,scanning , etc. In a scrolling manner......can you please give me a guideline to do this work.....

cool paul (author)2015-05-23

i have this problem of my home made 16 by 8 led matrix does not scroll one message continuously. well i have used two max 7219 and they are in a daisy chain but i just see the text scrolling like they are two independent chips! what could be the problem

alvoron (author)2014-09-07

How many led modules can I connect togeter? Firts of all, I'm concerned about power supply. I'm going to connect 5-7 modules together. Is it possible? Should I change something or just follow your instruction?

tumaku (author)alvoron2014-09-29

I have connected up to 8 matrices (your power supply should be able to provide enough amperage though).

By the way, 8 is the logial maximum that this library supports.

gqregqrg (author)tumaku2014-12-24

I've just managed 9 and it works great, attempting 10 simply flickers once and then dies out :( Is there another way to get 10+ ?

cako_filho (author)2014-12-17

What to do need to be more smooth scrolling?Thank´s,Carlos.

tumaku (author)cako_filho2014-12-18

You need a scrolling function in the library that is not implemented right now. Basically you need to display characters column by column starting at a "random" column number. Then you start displaying characteres starting at the last column of the last matrix and start moving them column by column until you arrive to the first column of the first matrix.

It is not diffciult and you can code it if you want it but it takes a little bit more time.

cako_filho (author)tumaku2014-12-18

I am very grateful to have spent your time to answer my question. His answer was very precious and when can I will post the results to you. Good Holidays and Happy Natal.Carlos (author)2014-11-23

Can you post the flowchart pls?

verdelj (author)2014-06-17

I finally got around to work on you library. I added two new characters or figures. its very easy to create new characters but it is a little bit time consuming. I will try two make more when I get a chance probably lowercase and all special characters plus a few figures, happy face, skulls, flowers, hearts...ect

once again thanks for taking the time to answer my questions.



{0x72,0x89,0x89,0x91,0x7E,0x00}, //@

{0x1C,0xF6,0x5F,0x5F,0xF6,0x1C}, //Skull

{0x3E,0x42,0x84,0x84,0x42,0x3E} //heart

VictòriaB1 (author)verdelj2014-11-16

Hi! I am looking how to display 8x8 bit characters in a LED matrix using hex notation. I saw that you wrote this and thought that you might be helpful. Thanks!

tumaku (author)VictòriaB12014-11-16

The library where characters are defined is freely available. There is also an example of how to code a new char in the Comments section. If that is not enough, please come back with a more concrete question. Good luck!

tumaku (author)VictòriaB12014-11-16

The library where characters are defined is freely available. There is also an example of how to code a new char in the Comments section. If that is not enough, please come back with a more concrete question. Good luck!

tumaku (author)verdelj2014-06-17

Great:-) Glad that you were able to update the library/skecth by yourself!
It is tedious, but you learn a lot of binary/hexadecimal coding...

RonG3 (author)2014-09-28

I am interested in a clock of some sort using the multiple 8x8 led matrixes. Anybody done this?

tumaku (author)RonG32014-09-29

I have not made it, but it should be simple using a real time clock (RTC) connected to the Arduino. you could also use the Arduino clock, but it would not be that precise and you would have to set the time value after every reset of the Arduino.

If you search internet (instructables, adafruit,...) there are plenty of tutorials/kits to build a LED-matrix clock.

RonG3 (author)tumaku2014-09-30

I have searched and searched, but there does not seem to be a full description of a multiple matrix clock, surprisingly.

About This Instructable




More by tumaku:Multiple LED Matrices with ArduinoLED Matrix with Arduino
Add instructable to: