Arduino tutorial: LED Matrix red 8×8 64 Led driven by MAX7219 (or MAX7221) and Arduino Uno

Arduino tutorial: LED Matrix red 8×8 64 Led driven by MAX7219 (or MAX7221) and Arduino Uno

Dear friends welcome back. Today we
play with his popular 8 by 8 LED matrix. As you can see
the matrix is working fine and it displays some simple graphics and some text. The LED’s are very bright and the result is really impressive. The display consists of 64 red LED’s which are driven by this chip here. This is the MAX7219 in our case but in your case it could be
that MAX7221. You can buy this ready to use module presoldered on ebay for around 3.5 euros but if you wish
to solder it by yourself you can buy it for less. You can connect as many as 8 units like this and produce larger displays. That’s quite interesting but we will
try this in a future video. Today we will see how
to light up only a single unit. The connection with
the Arduino board is extremely easy we only need to connect 5 wires. So let’s begin The first pin is Vcc. Vcc goes to Arduino 5V. The second pin is Ground. Ground goes to Arduino Ground. The third pin is DIN. DIN, goes to digital pin 12. The fourth pin is CS. CS goes to digital pin 11. And the last pin is CLK. CLK goes to digital pin 10. Okay we’re now ready to power on Arduino and see if the matrix is working. Let’s do it. OK it is working fine. If I remove the LED light a little bit you can see how bright the matrix really is. Now let’s go to the computer and see the software side of this project. The
library that we are going to use in order to drive this LED matrix is
the LEDControl library. You can download it from this link and then you have to unzip it in your
Arduino-Libraries folder. Next we load the LCDemoMatrix program that you can find in a link in the description
of the video. Let’s take a look at the code. First we declare the pins that we
have connected on Arduino. Then I have created some byte arrays that contain the data
for each character or graphic that we display on the screen.
Let’s see an example. The first byte is the graphic
of a smile. This one is the data for character d. This one is for number 8 and so on. In order to display a byte array all we have to do is to call the printByte custom function and enter, as an argument, the name of the byte array. For example if we want to print the smile icon, all we have to do is to call the command printByte and enter the name of the byte array – smile. That’s it. Let’s now see how to create
your own byte arrays with your custom fonts or graphics. We are going to use a small program I found in which you design your graphic and it
quickly produces the data for the byte array. You can find a link for the program in
the description of the video. so let’s design a Greekcharacter, the Π. okay I have created the character and all I have to do is to click the generate button. It creates the byte array data we need. We copy it and we create a new byte array in our code. I have created this byte and let’s call it in our main loop. okay the first character that is going to be displayed when I power on Arduino is the character Π that we have
just created. Let’s see. That’s how easy it is to light
up this display. Before we go I’m going to show a small footage frow where I live. If you find this video useful
please hit the like button. It really helps.Thanks and see you next

100 thoughts on “Arduino tutorial: LED Matrix red 8×8 64 Led driven by MAX7219 (or MAX7221) and Arduino Uno

  1. This code is not uploading and verifying in my uno board.It is showing an error.I test this code on my both arduino uno boards.

  2. Hi , It is working very well.But i wants to change somethings in the code . When i am changing something in the code it is showing an error.I was increasing the alphabets size and there number.

  3. Thank you for this demonstration. This helped me to get started with my LED matrix. I bought 4 of them to chain together. Cheers. 🙂

  4. I don't know why my arduino doesn't recognise the "printByte" command, it says that wasn't declared in this scope, something like that.

  5. I tried to connect 8 units of 8×8 dot matrix display, after i change the program for 8 units and try to display alphabets in scrolling mode then after few seconds the text gets corrupted.. I dont know why this is happening… While its works good if i use four or five units or less units together.. Please help.. Thank you.

  6. This was a very good tutorial. It help me alot. Could you make a tutorial on how to make a game with it? thanks alot!

  7. where is the windows program you used to generate the byte code? 😀

    Edit: it's obviously not in the GitHub-Project:
    Here a direct link:

  8. Hi, is there a board available where the program can be written to an EPROM, rather than having to connect to a PC all the time?

  9. i'm have a problem can you help me? i connect my matrix and it just turns on all the leds, even with your code

  10. Wrote a program, and everything worked until I tried to verify the program, and the printByte custom command wasn't recognized, I don't know what the problem is because I reinstalled the library several times, and all the other commands work, because the library is included, but it won't recognize the printByte command, PLEASE HELP

  11. Hey guys i bought 16×16 arduino matrix and i don't know how to write the code. Does this code will work on 16×16 matrix ?pleas Help if you Can.Thanks.

  12. Parabéns ótimo vídeo, não achei nem um vídeo bom brasileiro que ensinasse tão bem.

    Congratulations great video, I did not find a good Brazilian video that taught such good.

  13. This is absolutely wrong: CLK (clock) should be connected to pin 13, NOT any other pin. You should use the header file <SPI.h> and that would take care of the clocking. If you connect the CLK wrong you have to clock out the bits your self. Don't be studip: Let the Arduino clock out the bits. Take a look at – it is small and well tested – it works.

  14. i Have 8×8 bicolor and (12×12 Pins) led matrix. can MAX7219 works with 12×12 pins and 8×8 bicolor matrix?

  15. Hi,
    has anyone the link for this nice programm that generates the data for the bitrate? (as he describes in minute 3:18) cheers

  16. I bought a matrix 8×8 with a MAX7219 on EBAY. The compilation and UpLoad of the file LCDemoMatrix.ino  are ok. I'm sure of my wiring (DIN CS CLK, Alim.) but it doesn't work 🙁  An idea ? Thanks.

  17. when i try to verify its shown like this//Arduino: 1.8.3 (Windows 10), Board: "Arduino/Genuino Uno"C:Userssuwarno hpAppDataLocalTempRar$DIa0.842LCDemoMatrixLCDemoMatrix.ino:1:24: fatal error: LedControl.h: No such file or directory #include <LedControl.h>                        ^compilation terminated.exit status 1
    Error compiling for board Arduino/Genuino Uno.This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.//any Solution ? pls help me

  18. I've got an problem, i upload the code and everything is connected right but the result i get is just that first two led blinks in very short amount of time then one led just blinks in 1 second. Please help


    The best explanation ever
    After watching this I was able to write my own Library to run the MAX7219. You can write functions for driving the MAX7219 on any microcontroller.
    I wrote it on 8051 mirocontroller.
    If any one wants code put a reply to this

  20. How quickly can these boot up to play the image ? 

    Lets say I could fit a few of these in my indicators and I want them to play a loop of arrows <<< or >>> depending which way I'm indicating, would the on and off signal from the car be too quick for the Arduino to react? Or would I need the Arduino to be powered on constantly and program it to run through the loops when another electoral input is sent to the board?

  21. Is it possible to crontrol the thing show in the display with a push button switch or a ir remote…. If yes then how…

  22. Hi, great video! I just wonder, how to use 8 8×8 led matrix for a clock or other scrolling text? I would like the text be "correct way" with wiring up or down, hope you understand 🙂 rotate text

  23. Hi there, I just recently bought a matrix with 4 of these 8×8 matrices together. I'd like to display the same byte on all 4 of the matrices at once. Do you know how I could modify this code to achieve this? Right now, it just illuminates all of the LEDs on one matrix, then illuminates on the LED matrix to the right, etc.. I've tried changing the value 0 in LedControl(DIN,CLK,CS,0) to 4 but that doesn't work either. Any help would be greatly appreciated! Thank you for your time

  24. I hope you find this video useful. If you want to support the channel see how here:

  25. Hey! Thanks for this great video and for the tipp with this little generator software, it's awesome! Is it possible to have several predefined letters/pictograms and switch through them with a button? I'm a bloody beginner, maybe you can give me a hint for the code 🙂
    best regards

  26. Is there also a more simple code because somewhere(i cant find it again)i found one where you dont need to define all the leds sepreatly

  27. Hello, I am a beginner in Arduino. Would you tell me in detail how to open files with 'ino' extension please? Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *