Hola , I am Javier from Makespace Madrid. Last week we organised a meetup to play with LED matrixes and Arduinos. This was part of  "La noche de la electrónica con Jameco"
This instructable is based on the workshop. It uses one single LED matrix and shows how to switch its LEDs on/off and how to display ASCII characters.
A future instructable will show how to work with mulitple LED matrixes connected together.

Step 1: Components

For this example, you need the following components:
- Arduino Uno board
- MAX7219 Red Dot Matrix Module
- 5 jumper wires F/M (female/male)

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

You can find the matrix module at many online stores (e.g. http://dx.com/p/max7219-dot-matrix-module-w-5-dupont-lines-184854). This includes a 8x8 LED matrix (red colour), a MAX7219 chip to control the LEDs, header PINs and sockets, one 10KOhm resistor, a 100nF capacitor, a 10uF electrolic capacitor and a PCB where everything is connected together. You can purchase the module already soldered and mounted or just the components. Up to you;-)

If you want to learn the low level details, you should check this article at arduino playground.

IMPORTANT: The LED matrix is common cathode. This module does not work with common anode matrixes.
<p>Hii,</p><p>I have different type of matrix tube.I want to program it using Arduino Uno R3. I have attached the photo of my 8*8 Dot Matrix Led Tube</p>
<p>Thanks this is a great tutorial. I learnt a lot from it!</p>
<p>Keep learning :-)</p>
<p>I am only getting two leds showing at once. I have checked for bridges and there are none. Can anyone help me here?</p>
<p>I am now getting more LEDs on at once but no distinguishable letters.</p>
<p>I had the same /similar problem. the reason was that the MAX7219 was wrong inserted. I just removed it and inserted it in the other way round. Then it works!</p>
<p>Sorry for the late response. </p><p>Not sure what is wrong, but I suggest to check three points:</p><p>- Are you providing enough power (miliamps) to the matrix?</p><p>- Have you double/triple checked that the wires are properly connected?</p><p>- Are you using a common cathode matrix? (the code does not work if the matrix is common anode)</p>
<p>I updated the library to display smiles 8x8 using <strong>lc.displaySmile(0,X)</strong>; function replace X with a number from 0 to 3 (I added only 4 smiles).</p><p>you can download it from here: </p><p><a href="https://drive.google.com/file/d/0B0rVZYzj6RpOcFF1Uk9UR1NWRHc/view?usp=sharing" rel="nofollow">https://drive.google.com/file/d/0B0rVZYzj6RpOcFF1U...</a></p><p>to display them copy this code into you loop:</p><p>void loop() { <br> lc.clearDisplay(0);<br> lc.displaySmile(0,0);<br> delay(2000);<br> lc.clearAll();<br> lc.displaySmile(0,1);<br> delay(2000);<br> lc.clearAll();<br> lc.displaySmile(0,2);<br> delay(2000);<br> lc.clearAll();<br> lc.displaySmile(0,3);<br> delay(2000);<br> lc.clearAll();<br>}</p><p>you can custom these smiles (or add other 8x8 icons) using this online tool: <a href="http://www.pial.net/tools/" rel="nofollow"> http://www.pial.net/tools/</a> and paste them into the LedControlMS.h file, under the declaration of smileBitmap matrix (also remember to change size of const static byte smileBitmap if you add or remove items).</p>
<p>Great update to the library!!! And excellent link to code bitmaps:-)</p>
<p>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</p>
I did this one before but didn't have any luck with changing the message. this time I was able to change it but I couldn't figure out how to slow it down so it is more readable. Any suggestions? I really need someone that would be willing to help me from time to time.
<p>If you lare using the method writeString() to display your text, you should modify this method in the corresponding library flle (LedControlMS.cpp). This method waits 300 milliseconds after displaying a character. You can meke this dealy longer just changing '300' value by your desired delay, e.g. delay(1000) if you want to wait for one second.</p><blockquote>void LedControl::writeString(int mtx, char * displayString) {</blockquote><blockquote> while ( displayString[0]!=0) {</blockquote><blockquote> char c =displayString[0];</blockquote><blockquote> int pos= getCharArrayPosition( c);</blockquote><blockquote> displayChar(mtx,pos);</blockquote><blockquote> <strong>delay(300);</strong></blockquote><blockquote> clearAll();</blockquote><blockquote> displayString++;</blockquote><blockquote> } </blockquote><blockquote>}</blockquote>
<p>Nice guide! Thank you!</p><p>First time I tried to use input pins that are located closer to matrix and it was not work. </p>
<p>my frend i need your help, i do all what you did, but when i run the program all the led always are ON and i can't turn them Off. why? i have to increment the intensity to 15 and i can si how the text is moving but other leds always are ON.<br><br></p>
<p>One possible cause is the wrong connection of the wires. Please double-check that you have connected the right PINs in Arduino/LED matrix and that the wires are in good state.</p><p>It could also be that you soldered something wrong in the board or that one of the PINS in the matrix is broken or bended.</p>
<p>di you speak spanish? can you say me you facebook or email to contact to you? thank you.</p>
that's great.
<p>Congratulations :-)</p>
<p>Your library really rocks, congratulation :))</p>
<p>How do I make the text scroll smoothly across a single matrix?</p><p>Because with the sketch I have now (yours), the letters will just appear and dissapear on the same position.</p><p>I hope you can help me!</p>
<p>Sorry for the late reply. The library does not support smooth scrolling. You need to update it addding scrolling functionality (handle every letter/char as a set of pixel columns that scroll over the 8 columns of the matrix). Not difficult, but it requires some coding.</p>
<p>Just use the code from the other Instructable and change #define NBR_MTX 4 to #define NBR_MTX 1</p>
<p>How would I make a 16 row display,... please advise....</p><p>my email is eng.gachara@gmail.com</p>
<p>It is a long time since I made this project, but as fas as I can remember the maximum number of matrices supported by the library and the MAX7219 chip is 8. I tested it in the past and it worked fine. I just had to provide enough power ideally with an external power source other than Arduino (when many LEDS are ON Arduino cannot provide enough miliamps and things start going wrong)</p><p>8 marices make 64 x 8 LEDS. If you need a larger display, the current library is not suitable and you need to either synchronise somehow two sets of matrices or dig into the curent library code and see if you can update it to control two sets of matrices (i.e. 16 matrices)</p>
<p>Excellent stuff, very clear and easy to follow - thanks a lot. </p><p>I have a bunch of matrices lying around and will definitely be doing your other 'ible :) </p>
<p>Thanks for trying it out:) Have fun!</p>
<p>I soldered up a MAX7219 kit ($8 with prime shipping on Amazon - constantly amazes me how cheap things are these days) and this instructable was exactly what I needed next. Just wanted to say thanks!</p>
<p>Thanks for your message! If you decide to solder more matrices, you can then browse my second instructable ;-)</p><p> <a href="http://www.instructables.com/id/Multiple-LED-Matrixes-with-Arduino/" rel="nofollow">http://www.instructables.com/id/Multiple-LED-Matri...</a></p>
<p>Hello,</p><p>congratulations for the project !!!</p><p>I'd like to get help to realize this project using two MAX7219.</p><p>http://scuola.arduino.cc/lesson/l81bRbQ/Tabellone_Segnapunti.</p><p>I have some problem with the code ... it's very urgent.</p><p>best regards</p>
<p>Can you be more specific about the problem that you have? What is not working? Note that the LED matrices in your link are 7x5 instead of 8x8 (the ones my project and library are using)</p>
<p>Hi,</p><p>thank you for answering!<br>Simply'm buildingthescoreboardbutinsteadof the two7x5matricesI would usetwo8x8matricesMAX7219so I shouldrewrite the code(usingifthey also servethe appropriate libraries).I would also liketo addtwo buttonsto increase or decreasethe scoremanually.Unfortunately I am notgood at writingthe code...</p>
<p>Thank-you SO much &mdash; this has been my first successful Arduino &lsquo;anything&rsquo;!!</p>
<p>CONGRATULATIONS!!</p><p>I am getting this error.. Please help me....</p><p>Arduino: 1.6.3 (Windows 8.1), Board: &quot;Arduino Uno&quot;</p><p>please_work.ino:11:40: fatal error: FFT.h: No such file or directory</p><p>compilation terminated.</p><p>Error compiling.</p><p> This report would have more information with</p><p> &quot;Show verbose output during compilation&quot;</p><p> enabled in File &gt; Preferences.</p>
You are trying to import a library (FFT.h) in your Arduino sketch (line 11) and the IDE is not able to find it. I do not know what this library is and why you are importing it but it has nothing to do with the LED matrix project/library<br> <br> Anyway, if your project uses this library, you should import/copy it into your Arduino libraries folder. Google for &quot;how to install a library in Arduino&quot; or check <a href="http://www.instructables.com/id/LED-Matrix-with-Arduino/step2/Arduino-Library/" rel="nofollow">http://www.instructables.com/id/LED-Matrix-with-Arduino/step2/Arduino-Library/</a>&nbsp;to learn how to install the library.
<p>we are actually doing the audio spectrrum analyzer which has to include fft library</p>
<p>Thanks for trying it out!</p><p>Hope this is just the first one of a looong list of Arduino projects :-)</p>
<p>hello</p><p>good sketch</p><p>how many elements can be connected in series?</p>
A maximum of 8 matrices
<p>Why just 8 matrices? Is because of the current supported by Arduino? And if I use an external source?</p>
<p>It has been a while since I made this project but I think that 8 is the maximum number of matrices that can be controlled by the MAX7219. This maximum value (8) is definitely hardcoded in the library.</p>
<p>Thanks you, and well done. This and your other--the scrolling LED matrices--got me started on my first project, an LED clock, which I published today to this site. I'd like to give credit where it's due.</p>
<p>Thanks a lot!</p><p>I do recommend other visitors to check your intstructable to understand how to reuse and adapt my original work:</p><p><a href="http://www.instructables.com/id/Arduino-LED-Matrix-Clock/" rel="nofollow">http://www.instructables.com/id/Arduino-LED-Matrix...</a></p>
<p>My brother tried this yesterday and was very happy about it :)</p>
<p>Glad that he enjoyed it :-) Keep on tinkering!</p>
<p>Does the arduino have to have a UNO bootloader on it for the Matrix fo function? I've tried this code with the libraries, on a Leonardo and a mini pro and all I get is; almost all the leds constantly being on not even a blink.</p>
<p>I have not used it with Leonardo so I cannot tell you:-(</p><p>I have used it with Arduino Mini (5V) without any problem.</p><p>Your behaviour seems to be due to wrong connection of wires (double check them) or to not enough power (try to power the LED matirx (Vcc&amp;GND) form another power supply tan the Arduino. </p><p>Be careful! Vcc of your new power supply should be 5V and ground(GND) of the power supply and the Arduino Leronardo should be connected. If you do this wrong you can burn the chip of the LED matrix.</p>
<p>It works on a Leonardo. I had the same problem as some folks -- all of my LEDs on the Matrix were on the first time. I had two wires in the incorrect spots. Fixed it so that:</p><p>CLK =&gt; pin #11</p><p>CS =&gt; pin #10</p><p>and</p><p>DIN =&gt; pin #12</p><p>Easy mistake to make because the first 3 were in order. Good luck.</p><p>Nice Library too!</p>

About This Instructable




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