Arduino LED Matrix




In this short tutorial you will learn how to make an Arduino-powered LED matrix. Unlike several other designs, this one uses a "companion" computer to notify the Arduino which LEDs should be powered.

I have provided the code for the Arduino, as well as some Java code for displaying text on the LED matrix (this includes a custom-made 7x5 character font).

Things to keep in mind:

  • With the software provided, a maximum of 7 rows is possible if you want to display text. It would technically be possible to increase this limit to 15, but I'll leave that to someone else.
  • If you want to just display sound values (i. e you want to light up the LEDs consecutively from the bottom), it would be technically be possible to use up to 127 rows.
  • I cannot release the code for the audio visualization(sorry!) for various reasons

Step 1: The Materials

For this project, you will need the following materials:

  • An Arduino that has as many digital pins as you want rows and columns combined. (eg, If you want to have a 7x5 LED matrix, you need at least 12 digital pins on your arduino). I used an Arduino Mega 2560 as the Mega has 54 digital I/O pins and was the only which allowed me to make a 20 by 7 grid (I needed 27 pins).
  • In order to connect your Arduino to the LED matrix, it would be helpful to have female to male breadboard wires
  • Enough LED's for your matrix. (With a 7x5 matrix, you need 35 LEDs). For this project, I used the blue LEDs which can be found here
  • The link above also has the resistors you need. You will need as many resistors as you have rows in your LED matrix
  • A wooden board for mounting the LEDs. You'll need some reasonably thin wood for this project. How thick and how big the wood should be depends on how much you want your LEDs to protrude out the front and how far apart you want the LEDs to be spaced. I would recommend a 1 cm spacing between your LEDs(mine were 5mm in diameter). Remember to leave some space on all sides(especially to the left and right of the matrix).
  • A companion computer to connect the Arduino to.
  • Spray paint for the added effect.

You will also need various tools: drill (+ a selection of drill bits), pliers, clippers(or wire cutters), and a soldering iron(with solder)

Step 2: Cutting/Drilling the Board

(The picture above is of a prototype board, not the final product. Use it as inspiration to come up with other cool LED patterns)

The first thing you need to construct is the board on which the LEDs will be mounted. Here you have several options on how to structure the LED board. You could design you LED board in the classical, grid LED matrix or you could take a more interesting approach by making a circular LED pattern.

In this step you will also have to take into account the spacing of your LEDs. I would recommend having the centers of the LEDs be 1 cm apart from each so that the LEDs(which are 5mm in diameter) will be tightly packed(but not so tightly it is impossible to work with).

The size drill bit you should use depends on the size of the LEDs. I bought a special 5mm drill bit so the LEDs would fit exactly. Take into consideration that if you are going to spray paint the board, this will make the holes slightly smaller.

Step 3: Spray Painting the Board

If you want to make your board a certain color, then now is the time to do that. Before inserting your LEDs, you should consider spray painting your board (as this will not be an option once the LEDs are in place--you don't want to spray paint the LEDs).

I chose black as the preferred color for my board as I happened to have a black spray paint on hand and thought it would go well with my blue LEDs.

Step 4: Soldering the LED's

The next step is soldering the LED's. I have provided a schematic on how the LEDs should be wired up (the rows should never cross with the columns. I was unable to change this after exporting the diagram).

Note: In these instructions, I generally refer to the legs of the LEDs as "pins" for the lack of more specific terminology.

If found the best way to solder them was column by column. I have broken down the process into several steps.

  1. Insert the LEDs into the column. Assure that all the LEDs are in the same positive/negative orientation. Positive should be on the left, while negative should be on the right.
  2. Take the column pins (right "leg" of the LEDs) and bend all but the bottom pin down (towards the ground) so that they are flat with the board.
  3. For the lowest pin, bend the pin down, but in the opposite direction of the other column pins(bend it upwards, away from the ground).
  4. Then, bend the lowest pin up about halfway between the bottommost pins. This will allow you to easily plug the column pins to the Arduino.
  5. Next, use pliers to hold the base of the row pins so you can bend the row pins down horizontally. Do not bend them down all the way (so that the row pins do not touch the column pins)
  6. Use some clippers(or wire cutters) to neatly trip the legs of the LEDs so that they do not protrude too far down or to the left.
  7. Solder the row pins to the previous column's row pins. Then solder column pins to the next lowest LED's column pin. Assure that no row pins and column pins ever touch.

Step 5: Connecting the LEDs to the Arduino

The first step will be to solder the row resistors on to the row pins of the leftmost LEDs, as shown in the image. I used a connector I had lying around to neatly organized the pins. If you do not happen to have such a connector, you can bend up the left leg of the resistors in a similar fashion to the lowest column pins.

Then, use the breadboard female to male cables to connect the rows to the Arduino. The male side should be connected to the pins sticking horizontally out of the LED board. Which pins you use on the arduino don't matter. Both analog and digital should work, but know which pins are plugged in where.

At this point, if you are so inclined, you can attach a base to the bottom of the LED board using wood glue or any other adhesive of your choosing.

Step 6: The Code

Excellent! With the physical assembly of the board done, it's time to get coding. I have written some Arduino code for receiving and displaying the LED values sent from the computer to the Arduino (the technique used to light multiple LEDs at the same time is called multiplexing, give it a google if you have some time). The arduino code is in the

I have also written some Java code, also attached, for writing simple programs to display text on the Arduino. The example java program will display the current time in a news-ticker manner. For instructions on how to run the java code check the README.txt in the zip file attached.

You will need to adjust the arduino code to use the correct number of rows, columns, and input pins. Do this by changing the #define ROWS and #define COLUMNS lines to the number of rows and columns you are using. Change the rowPins and columnPins to the input pins you are using.

For the more advanced coders, I will give a brief description on how the Arduido "API" works.

Every byte the Arduino receives is one band(i.e. column). The bands to the left are shifted one over. If you want to overwrite the entire LED matrix at a time, just keep writing column values until you have overwritten the entire LED matrix.

There are two ways of specifying column values:

The first is the specify the number of LEDs (from the bottom) to light up. (eg. writing a 1(0x01) will make the bottom most LED light up. Writing a 2(0x02) will make the bottom 2 LEDs light up. Writing 3 will.... And so on and so forth.

The second mode is where the left most bit is one(add 128 to the value). This signifies to the Arduino code to interpret the values differently. In this mode, each bit represents a different light, with the rightmost bit signifying whether the bottom LED is on or off. For example, the byte 0b10000101 would light up the first and third LEDs from the bottom.

The software provided(including the font) is yours to distribute and modify, commercially or non-commercially.

3 People Made This Project!


  • Planter Challenge

    Planter Challenge
  • Paint Challenge

    Paint Challenge
  • Sensors Contest

    Sensors Contest

14 Discussions


3 years ago

Looks great! I'll do this as soon as I manage to get some time. I'm wondering how it works though, a pulse is set on a desired pin then travels across the LED where the a specific switch is closed. These second switches are programmed on the Arduino to open on ground? (I'm new to Arduino/Electronics)

2 replies

Reply 3 years ago

The switches in the diagram are not "physical" switches in the setup. I drew those switches in the diagram to illustrate how, theoretically, you could control which lights were on and off. The Arduino turns the lights on and off by controlling the voltage on the output and input ports ports, effectively doing the same thing as the switches.


Reply 3 years ago

Perfect thanks!

I did not know about this:

"Arduino (Atmega) pins default to inputs, so they don't need to be
explicitly declared as inputs with pinMode() when you're using them as
inputs. Pins configured this way are said to be in a high-impedance state.
Input pins make extremely small demands on the circuit that they are
sampling, equivalent to a series resistor of 100 megohm in front of the
pin. This means that it takes very little current to move the input pin
from one state to another, and can make the pins useful for such tasks
as implementing a capacitive touch sensor, reading an LED as a photodiode, or reading an analog sensor with a scheme such as RCTime."



3 years ago

hello. i need a bit of help. i want to make a bigger led dot matrix display for my shop and i want to make a scrolling led dot matric display. what should i do?

1 reply

Reply 3 years ago

The scrolling (I assume it's text that you want to scroll) can be done with the code provided. And for a bigger led dot matrix (I assume you mean you want bigger leds, not a bigger matrix), then I would try combining multiple led's in the matrix (as I cannot find extra large LEDs anywhere online). So, for example, you would wire up 4 leds in parallel to the two wires where one led would normally be soldered to. Really, it all depends on how big you want the LED matrix to be.


4 years ago on Introduction

Nice idea, but where is the schematic? Also, you didn't really mention how you got all the holes for the LEDs to line up so perfectly. Drill press?

I also didn't see any mention that the Arduino must be a MEGA. It's the only one with enough IO to build this project.

1 reply

Reply 4 years ago on Introduction

The schematic is attached as a download for step 4 (it's a bit shoddily done, but I decided I'm not going to put in the effort to re-make the diagram).

For getting the holes to line up, I first used a ruler/pencil to carefully mark where the holes should go and then I made pilot holes using a kind of punch tool to ensure that that all my holes lined up. I considered getting a drill press for drilling the holes as I was worried about the holes not lining up but ended up doing without and used a standard drill instead.

I never mentioned that the Arduino MUST be a mega, but I did say this in the first step(Materials):

"An Arduino that has as many digital pins as you want rows and columns combined. (eg, If you want to have a 7x5 LED matrix, you need at least 12 digital pins on your arduino). I used an Arduino Mega."

However, I see your point and will change the instructions to reflect why I used the mega.


4 years ago on Introduction

This looks so cool! I love all sorts of LED matrices! I would love to see a video of some of the different designs your's can display!

4 replies

That looks so cool! It might be a little easier to see if the background was a little darker. But I can still tell it was showing the time. Great project!