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

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.
<p>sir,</p><p>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 pkompally@gmail.com</p><p>I request u sir</p><p>Thank u </p><p>Pranav </p>
<p>Dear Friend,</p><p>I Built My Project according to this Instructable. I only changed the Text to &quot;HOW WE MAKE THINGS&quot;. After a while LED Matrix 1 Stops. Can you tell me, what I did wrong? Thank you.</p>
<p>Hi Jandirk,</p><p>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.</p>
<p>Hi, I would like to add &quot;:&quot; to a number, I am displaying a time, I tried to do but I can't figure out how to do.</p><p>Is it available any command to add characters before sending it to display?</p><p>Thanks in advance!</p><p>Ronnie</p>
<p>Hi Ronnie,</p><p>Thanks for trying out my instructable:-)</p><p>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. </p><p>But if you are looking for a colon character, it is already defined in there at alphabetBitmap[11]:</p><blockquote>lc.displayChar(0, lc.getCharArrayPosition(11));</blockquote>
Can you use three matrices instead of four?
<p>Yes, just update the line in the code that defines the number of matrices (change '4' by '3')</p><p><br>#define NBR_MTX 3</p>
<p>Great information and very clear - many thanks :)</p>
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.....<br>thanks<br>Jibin<br>jibinsabu24@gmail.com
<p>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</p>
<p>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?</p>
<p>I have connected up to 8 matrices (your power supply should be able to provide enough amperage though). </p><p>By the way, 8 is the logial maximum that this library supports.</p>
<p>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+ ?</p>
<p>What to do need to be more smooth scrolling?Thank&acute;s,Carlos.</p>
<p>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 &quot;random&quot; 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.</p><p>It is not diffciult and you can code it if you want it but it takes a little bit more time.</p>
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
<p>Can you post the flowchart pls?<br></p>
<p>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</p><p>once again thanks for taking the time to answer my questions.</p><p>{0x3,0x4,0xF8,0x4,0x3,0x0},//Y</p><p>{0xE1,0x91,0x89,0x85,0x83,0x0},//Z</p><p> {0x72,0x89,0x89,0x91,0x7E,0x00}, //@</p><p> {0x1C,0xF6,0x5F,0x5F,0xF6,0x1C}, //Skull</p><p> {0x3E,0x42,0x84,0x84,0x42,0x3E} //heart</p>
<p>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!</p>
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!
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!
Great:-) Glad that you were able to update the library/skecth by yourself! <br>It is tedious, but you learn a lot of binary/hexadecimal coding...
<p>I am interested in a clock of some sort using the multiple 8x8 led matrixes. Anybody done this?</p>
<p>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.</p><p>If you search internet (instructables, adafruit,...) there are plenty of tutorials/kits to build a LED-matrix clock.</p>
<p>I have searched and searched, but there does not seem to be a full description of a multiple matrix clock, surprisingly.</p>
<p>Thanks alot Tumaku you rock dude hope you continue making more awesome projects</p>
Your library is incomplete you are missing the forecasts letters and some special characters ex&quot; @ &quot; I need the @and some lower case can you please tell me how i can add them. Thank you.
<p>You can add new chars by addind their binary representation to the alphabetBitmap array in LEDControlMS.h file</p><p>Every new character is represented by 6 byes (each byte corresponds to one column of 8 bits/pixels). Note that also have to change the size of the array (the current version of the library has 41 characters -&gt; alphabetBitmap[41][6]</p><p>Finally you must also update the method int LedControl::getCharArrayPosition(char input) in LEDControlMS.cpp to consider the new characters that you have added to the array.</p>
I tried but i.just couldnt get it to work and i search the whole web but only found arrays with 7 and 8 bytes. Like I said before my programming skills are very limited. The charracter that I need is &quot;@&quot; what would be the binary representation in 6 bytes
<p>It is not difficult, but it is not straightforward to explain how to code a new char. It is basically binary/hexadecimal coding of a pixel image/character.</p><p>I have handdrawn a picture of character 'G' and its coding:</p><p>0x7E,0x81, 0x81,0x91,0x72,0x00</p><p>And I have also created character '@' in the same way:</p><p>0x72,0x89,0x89,0x91,0x7E,0x00</p><p>Note that this coding is required for this specific library. Other libraries might code the images in a diffferent way/order.</p><p>Hope this helps!</p>
<p>Now it makes alot of sense, the only question I have is what do I have to do to LedControl::getCharArrayPosition(char input) in LEDControlMS.cpp </p><p>I am a little bit lost</p><p>int LedControl::getCharArrayPosition(char input){</p><p> if ((input==' ')||(input=='+')) return 10;</p><p> if (input==':') return 11;</p><p> if (input=='-') return 12;</p><p> if (input=='.') return 13;</p><p> if ((input =='(')) return 14; //replace by '&ntilde;' </p><p> if ((input &gt;='0')&amp;&amp;(input &lt;='9')) return (input-'0');</p><p> if ((input &gt;='A')&amp;&amp;(input &lt;='Z')) return (input-'A' + 15);</p><p> if ((input &gt;='a')&amp;&amp;(input &lt;='z')) return (input-'a' + 15); </p><p> return 13;</p><p>}</p><p>lets say that I wanted to add &quot;@&quot; to the library how would I need to modify this? and do I need to modify for every letter that I add? </p>
<p>The simplest way is to add the byte string at the end of the char array in the library. Note that you also need to change the array dimension!</p><p>const static byte alphabetBitmap[42][6]={<br> {0x7E,0x81,0x81,0x81,0x7E,0x0}, //0<br> ...<br> {0xE1,0x91,0x89,0x85,0x83,0x0},//Z</p><p>{0x72,0x89,0x89,0x91,0x7E,0x00} //@<br>};</p><p>Then on the LedControl::getCharArrayPosition(char input) method, add one line for the &quot;@&quot; char:</p><p>if (input=='@') return 41;</p><p>That should work...</p>
<p>return 41? what does 41 mean? </p>
<p>The data for &quot;@&quot; has been added at position 41 of the array (the initial index is 0).</p><p>If you now add a new character definition, the array will be </p><p>const static byte alphabetBitmap[43][6]={...</p><p>and the getCharArrayPosition() method should be updated with:</p><p>if (input==' ') return 42;</p>
<p>thanks a million now It all makes sense, will try to update it this weekend. thank you for your time</p>
<p>The data for &quot;@&quot; has been added at position 41 of the array (the initial index is 0).</p><p>If you now add a new character definition, the array will be </p><p>const static byte alphabetBitmap[43][6]={...</p><p>and the getCharArrayPosition() method should be updated with:</p><p>if (input==' ') return 42;</p>
Thanks will try to update the library this weekend.
<p>you have it wrong should be</p><p>#include &quot;LedControlMS.h&quot;</p><p>not </p><p>#include &quot;LEDControlms.h&quot;</p>
<p>Thanks <a href="http://www.instructables.com/member/verdelj/" rel="nofollow">verdelj</a>! You are right, the problem is that th Arduino IDE cannot find the library because of the wrong name (the library name is case sensitive)</p>
<p>hey coding seems like has no problem but then I have this weired error compiling.</p><p>Do you know what is the problem?</p><p>Interface_Final.cpp.o: In function `__static_initialization_and_destruction_0':</p><p>/Applications/Interface_Final.ino:4: undefined reference to `LedControl::LedControl(int, int, int, int)'</p><p>Interface_Final.cpp.o: In function `displayString(String, short)':</p><p>/Applications/Interface_Final.ino:40: undefined reference to `LedControl::getCharArrayPosition(char)'</p><p>/Applications/Interface_Final.ino:40: undefined reference to `LedControl::displayChar(int, int)'</p><p>/Applications/Interface_Final.ino:41: undefined reference to `LedControl::getCharArrayPosition(char)'</p><p>/Applications/Interface_Final.ino:41: undefined reference to `LedControl::displayChar(int, int)'</p><p>/Applications/Interface_Final.ino:42: undefined reference to `LedControl::getCharArrayPosition(char)'</p><p>/Applications/Interface_Final.ino:42: undefined reference to `LedControl::displayChar(int, int)'</p><p>/Applications/Interface_Final.ino:47: undefined reference to `LedControl::clearAll()'</p><p>/Applications/Interface_Final.ino:52: undefined reference to `LedControl::clearAll()'</p><p>Interface_Final.cpp.o: In function `setup':</p><p>/Applications/Interface_Final.ino:17: undefined reference to `LedControl::shutdown(int, bool)'</p><p>/Applications/Interface_Final.ino:18: undefined reference to `LedControl::setIntensity(int, int)'</p><p>/Applications/Interface_Final.ino:19: undefined reference to `LedControl::clearDisplay(int)'</p><p>/Applications/Interface_Final.ino:22: undefined reference to `LedControl::clearAll()'</p><p>here's my coding</p><p>#include &quot;LEDControlms.h&quot;</p><p>#define NBR_MTX 4</p><p>LedControl lc=LedControl(12,11,10, NBR_MTX);</p><p>String scrollString1= &quot;INTERFACE CLASS &quot;;</p><p>String scrollString2= &quot;MOVE IT SLOW &quot;;</p><p>String scrollString3= &quot;AND MOVE IT FAST &quot;;</p><p>char ch0, ch1, ch2;</p><p>void setup() {</p><p> Serial.begin(9600);</p><p> Serial.println(&quot;Setup&quot;);</p><p> for (int i=0; i&lt; NBR_MTX; i++){</p><p> lc.shutdown(i,false);</p><p> lc.setIntensity(i,1);</p><p> lc.clearDisplay(i);</p><p> }</p><p> delay(1000);</p><p> lc.clearAll();</p><p>}</p><p>void loop() {</p><p> Serial.println(scrollString1);</p><p> displayString(scrollString1,500);</p><p> Serial.println(scrollString2);</p><p> displayString(scrollString2,1000);</p><p> Serial.println(scrollString3);</p><p> displayString(scrollString3,200);</p><p>}</p><p>void displayString(String displayString, short speed) {</p><p> short nextCharIndex=3;</p><p> ch0= displayString[0];</p><p> ch1= displayString[1];</p><p> ch2= displayString[2];</p><p> while (true) {</p><p> lc.displayChar(0, lc.getCharArrayPosition(ch0));</p><p> lc.displayChar(1, lc.getCharArrayPosition(ch1));</p><p> lc.displayChar(2, lc.getCharArrayPosition(ch2));</p><p> ch0=ch1;</p><p> ch1=ch2;</p><p> ch2=displayString[nextCharIndex++];</p><p> if (ch2==0) {</p><p> lc.clearAll();</p><p> delay(25);</p><p> return;</p><p> }</p><p> delay(speed);</p><p> lc.clearAll();</p><p> delay(25);</p><p> }</p><p>}</p>
<p>where did i can download the code?</p>
<p>There are links to code files in Steps 2 and 6</p>
<p>There are links to code files in Steps 2 and 6</p>
<p>the code worked great I just had to modify it a little because i am using 5. I play the accordion and I want to add the led matrix to the front on the accordion and display some info and also want to have an audio spectrum analyzer and a mic so that when I start to play ill have so graphics on the matrix. my programming skills are very limited like I said before but I researching and looking for some code for the analyzer. I plan to have two buttons one for the power and then one to cycle the display example push once &quot; Gabbanelli &quot; another push and &quot; name and phone # &quot; another push spectrum analyzer.</p><p>this picture is from a few days ago of the when I was making the base for my leds I will post a full instructable of the finish accordion when I am done mounting it and painting it. </p><p>thank you for all the help. I repair accordions as a hobby but I am a diesel mechanic so if you ever need to know anything about accordions of cars let me know. </p>
Thanks a million, that's exactly what I need it, I will try it out tomorrow and let you know. Thanks again
<p>Thanks for your message!</p><p> I do not know how I can help you. If you have concrete questions, I will try to answer them. </p><p>The good thing about these max7219 modules is that you do not need to refresh the matrices at regular intervals so you can &quot;isolate&quot; your code form the matrices.</p>
I want to dispay, some messages lets say 3 messages but all 3 using different scrolling speeds how can I complish that. Display &quot; hello&quot; delay 500 once done dispay &quot; have a nice day&quot; delay 1000 then &quot;welcome back&quot; delay 500. Like I said my programming skills are very limited I need an example. I have been looking around but haven't found alot of info. Thanks for the reply.
<p>I have not been able to test this (I do not have the matrices with me now), but this should work with three different strings moving at different speeds. You define the &quot;speed&quot; in the second parameter that you pass to displayString() function.</p><p>In C, Strings are finished with a null character (0). That is the trigger that I use to exit the displayString() function.</p><p>//We always have to include the library<br>#include &quot;LedControlMS.h&quot;<br><br>/*<br> Now we need a LedControl to work with.<br> pin 12 is connected to the DataIn <br> pin 11 is connected to the CLK <br> pin 10 is connected to LOAD <br> We have only a single MAX72XX.<br> */<br>#define NBR_MTX 4 <br>LedControl lc=LedControl(12,11,10, NBR_MTX);<br><br>String scrollString1= &quot;MAKESPACE MADRID &quot;;<br>String scrollString2= &quot;THIS MOVES SLOWER &quot;;<br>String scrollString3= &quot;AND THIS MOVES FASTER &quot;;<br><br>char ch0, ch1, ch2, ch3;<br><br>void setup() {<br> /*<br> The MAX72XX is in power-saving mode on startup,<br> we have to do a wakeup call<br> */<br> Serial.begin (9600);<br> Serial.println(&quot;Setup&quot;);<br><br><br> for (int i=0; i&lt; NBR_MTX; i++){<br> lc.shutdown(i,false);<br> /* Set the brightness to a low value */<br> lc.setIntensity(i,1);<br> /* and clear the display */<br> lc.clearDisplay(i);<br> }<br> delay(100);<br> lc.clearAll();<br>}<br><br>void loop(){<br> Serial.println(scrollString1);<br> displayString(scrollString1,500);<br> Serial.println(scrollString2);<br> displayString(scrollString2,1000);<br> Serial.println(scrollString3);<br> displayString(scrollString3,200);<br>}<br><br>void displayString(String displayString, short speed){<br> short nextCharIndex=4;<br> ch0= displayString[0];<br> ch1= displayString[1];<br> ch2= displayString[2];<br> ch3= displayString[3];<br> while (true) {<br> lc.displayChar(0, lc.getCharArrayPosition(ch0));<br> lc.displayChar(1, lc.getCharArrayPosition(ch1));<br> lc.displayChar(2, lc.getCharArrayPosition(ch2));<br> lc.displayChar(3, lc.getCharArrayPosition(ch3));<br> ch0=ch1;<br> ch1=ch2;<br> ch2=ch3;<br> ch3=displayString[nextCharIndex++];<br> if (ch3==0) {// end of string<br> lc.clearAll();<br> delay(25);<br> return;<br> }<br> delay(speed);<br> lc.clearAll();<br> delay(25);<br> }<br>}</p>
Great instructable, I am a begginer and I build a 32x8 matrix using the 4 max7219 modules just like in your instructable, I have an idea for a project but after reading a lot of articles and tutorials. I still don't understand the code to the point where I can write my own program can you please help me.

About This Instructable


119 favorites


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