How to Build an Arduino LED Matrix in 3 Simple Steps

By Sohil Patel
Arduino LED matrix DIY Hacking


LED matrixes are some of the most popular projects that are built using Arduinos. Its’ really fun to work with LEDs and the kind of output you get from them is mesmerizing. You can use these matrices for various applications to create sign boards with scrolling texts and play animations. It’s really cheap and simple to build one and it can be easily reprogrammed using an Arduino. You can even customize it to be used with the output of a music system, so we get cool synchronized visuals along with it.

In this tutorial, I will show you how to build a fancy 8 by 10 arduino LED matrix (with scrolling text and animations) using an Arduino and a 4017 decade counter. You can also buy an assembled LED matrix online. This type of matrix is easy to make and program and it is a good way to learn about multiplexing.


Arduino LED matrix DIY Hacking

Required Materials

1. 80 LEDs.
2. Eight 220Ohm resistors.
3. CD4017 decade counter IC.
4. Ten 1K resistors.
5. Ten 2N3904 transistors.
6. Single strand wire.
7. Solder dot board.
8. Arduino.

How Does it Work?

This whole arduino LED matrix project works on the principle of multiplexing. Here, the arduino is connected to the 4017 decade counter IC and sends the data through two lines. The multiplexed data from the Arduino is then decoded into separate signals for the LEDs via the 4017 IC. This then drives the corresponding LEDs in the various rows.

Soldering the Matrix

Choosing the right LEDs is one of the most important parts of this project. because choosing the right ones is very critical to the execution of this project. I recommend using 5mm diffused LEDs because they supply a decent amount of brightness and delivers a clear image.


Arduino LED matrix DIY Hacking

5mm Diffused LED


Soldering the Arduino LED matrix is the tricky part, there are a lot of ways to do it and I will share my method with you. You need to connect all the positive leads of the LEDs in columns and the negative leads in rows. You can use the solder dot prototyping board for soldering the LEDs on it. Push the LEDs through the adjacent holes on the board. Use the circuit figure below to connect the Arduino LED matrix together. Then, take the positive lead of the first LED and bend it down to the other LEDs and solder the pins which touch each other. Next, take the last lead that you soldered and bend it again down and repeat till you have all the positive leads connected in the column. Snip off the extra length of the leads that you didn’t use.

Now a new dilemma is created. That is: connecting the negative pins in a row because you can’t bend them and solder like you did with the positive leads, as they will short each other. My method saves a lot of time and is simpler. The trick is to put some tape on the column’s connections to isolate them from the negative pins. If you do that, you can bend the negative leads too and connect them like you did with the positive ones. They won’t short each other because they will be isolated. The circuit for the Arduino LED matrix is as shown below:


Arduino LED matrix DIY Hacking

Arduino LED matrix connections


Via a resistor, you have to connect each column to the Arduino (pins 0-7). The reset pin of the 4017 goes to pin 8 on the Arduino and the clock pin goes to pin 9 on the Arduino.

Multiplexing for the Arduino LED Matrix

What is multiplexing?

It is basically a way to split information into little pieces and send it one by one. This way you can save a lot of pins on the Arduino and keep your program simple. In our case we split the image that we want to display into 10 pieces (10 rows). We want to scan the rows of the matrix (light up one row at a time) and send info from the Arduino to the columns. All the columns are positives of the LEDs and the rows are negatives. So if the first row is connected to ground and we send a signal to the first column, it will only light the first LED in the row. To get a good display, we need to scan the rows very fast, so fast that the human eye thinks that all of the rows are connected at the same time.

Why IC 4017?

To control this Arduino LED matrix, 4017 IC is the best way to do it. Here’s a good site to learn the basics of this IC: 4017 IC. The 4017 decade counter helps us with the multiplexing. This IC basically scans the rows of the matrix (lights up one row at a time). In our case, we want to connect the rows to ground, but the 4017 provides a signal output and cannot ground the LEDs. To solve this little problem we need to use a transistor with a resistor.
Arduino LED matrix DIY Hacking
The 4017 has 10 output pins, so we need 10 resistors and 10 transistors. We connect the 1K resistors to the outputs of the 4017 and its other end to the base of the transistor as shown in the circuit figure at the top of this page. Next, we connect the collectors of the transistor to the LED rows and the emitter to the ground. You can also use a BC547 NPN transistor.

Programming the Arduino LED Matrix

I have written a little program that scrolls text and added all the letters and numbers to it too. I used ports for my program because it saves space and is easier to handle.

If you don’t know how to work with ports on the Arduino, I recommend going on the Arduino website to learn a few basic things before you start. Here’s the link: Arduino port manipulation.


Arduino LED matrix DIY Hacking

Port control example


Port control is really easy, check out the figure above as an example. The red dots indicate the LEDs which are ON and the white as OFF. In the first row of the matrix, to turn the 2nd and 7th LEDs ON, we give a command to Arduino port: B01000010. Here the 2nd and 7th bits are “1”, which in turn turns the LED ON. “B” indicates to the Arduino that the port is an output port. We do this exercise for all the rows and finally, we will get a smiley face in the lights like in the figure above.

If you want to make your own images, I made a little Excel tool that will make writing images a lot easier. You can find it in the zip folder which I have attached at the end.

And finally, don’t forget to unplug pins 0 and 1 when you upload your program. These pins are also used as communication pins and may cause some errors with the program.
Download the project files.  And it’s done!

Please share your projects so that we can work together! Here’s the video demo Arduino LED matrix:




Recommended Posts
Showing 23 comments
  • PeterG

    Hey so I am currently working on a project for my university concerning an LED display and would like to cite some of the information provided in this tutorial, who may I contact about this, please direct email me, thanks.

  • Chris


    I tried the method above with the tape but it seems like two of the Rows (2 and 3) are interconnected and shorting each other out. Only one LED burns out within those rows and when I did it another within those rows shorts out.

    I can’t find a short in the grid I’m wondering if I accidentally burned through the electrical tape

    Are there anyways to troubleshoot this to find the source ?

  • Choi

    I made the hardware same as the description above using shift register and used the code of Scrolling text(with a shift register) but while in the output all the all the LED of the row and column required for a letter to display glows. I tried a lot still having the same problem. Is it a hardware problem or coding????

  • abhijit

    Can I use ULN darlinton IC instead of transistor?

  • WoRm

    how would i edit the code to control a 5×5 display. i understand that i would have to redo all of the definitions, but after that what is needed?

  • Inoace

    Thank you, very informative, I am working my way towards rgb matrix.

  • Tyler K

    Don’t bend the leads together and short them.
    Buy some 30 aug wire and wrap wrap the positive leads together and
    repeat for the negative. Loner but sure fire way to do it.

  • pratik

    sir i am facing problems with displaying the data in a chain i already have adafruit 16×32 led module but all the modules are displaying the same data at a time insted of sliding. please help me with it

  • Lukas

    For this app is better solution used addressable LED and control it by ONLY ONE pin

  • harikrishna

    how to write a program give any example plsss

  • Brent

    Getting macro names must be identifiers error when compiling. Relativity new to the arduino world, but I can do a few things.

    • Robert Jones

      I was getting the same thing.
      I had to change the #define for the numbers from numbers to words. 1 to ONE, 2 to TWO, 3 to THREE and so on.

      Worked great after that!

  • Elliot

    Hey I’m making a 10.5 by 14 inch LED Matrix with a .060 PET plastic board base so that I can see through it. I’m estimating I’ll need 150 5mm diffused RGB LEDS but I was wondering how many 8t 2200hm resistors,1k resistors and how many 2N3904 transistors I’ll need. Any advice is welcome, thank you!

  • Kevin


  • bella

    Hi. Its me again. From the video the text is scrolling from right to left. It is possible to make it scroll from left to right ?

    • Arvind Sanjeev

      Definitely, but you will have to edit the code correspondingly. Check out the series in which the leds are lit up and then reverse it.

      • bella

        Did you have the tutorial ?

        • Arvind Sanjeev

          Im sorry, I didnt understand.

          • bella

            Sorry if my question is not clear. What I mean is did you have the tutorial to make the text scrolling from left to right ?

            Thank you for keep replying my questions. I really appreciate your time.

            • Arvind Sanjeev

              Not currently Bella, please try editing.

  • TerrenceJ

    Excellent project, some great possibilities with this one, I can see it as part of a robot to give the robot some character or feedback from sensors, the list is huge, well done.

    • Arvind Sanjeev

      Wow, nice idea :) I hope you will build something and share it with us soon.

Leave a Comment

51 − = 43

Start typing and press Enter to search