loading

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.

<p>First of all, thank you for making this instructable. You inspired me to make a lovely present for my girlfriend, and this was my first programming project.</p>
<p>Glad it was of use!</p>
<p>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)</p>
<p>The switches in the diagram are not &quot;physical&quot; 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.</p>
<p>Perfect thanks!<br><br>I did not know about this:<br></p><p>&quot;Arduino (Atmega) pins default to inputs, so they don't need to be <br>explicitly declared as inputs with pinMode() when you're using them as <br>inputs. Pins configured this way are said to be in a <strong>high-impedance state</strong>.<br> Input pins make extremely small demands on the circuit that they are <br>sampling, equivalent to a series resistor of 100 megohm in front of the <br>pin. This means that it takes very little current to move the input pin <br>from one state to another, and can make the pins useful for such tasks <br>as implementing <a href="http://www.arduino.cc/playground/Code/CapacitiveSensor" rel="nofollow">a capacitive touch sensor</a>, reading an LED as a <a href="http://www.arduino.cc/playground/Learning/LEDSensor" rel="nofollow">photodiode</a>, or reading an analog sensor with a scheme such as <a href="https://www.arduino.cc/en/Tutorial/RCtime" rel="nofollow">RCTime.&quot;</a></p><p>source: https://www.arduino.cc/en/Tutorial/DigitalPins</p><p></p>
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?
<p>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.</p>
why the code isn't opening ??!! :-!
<p>Are you having problems downloading the zip file? Or are you having trouble unzipping the code?</p>
<p>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?</p><p>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.</p>
<p>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).</p><p>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.</p><p>I never mentioned that the Arduino MUST be a mega, but I did say this in the first step(Materials):</p><p>&quot;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.&quot;</p><p>However, I see your point and will change the instructions to reflect why I used the mega.</p>
<p>First of all, thank you for the instructable, but i have a question, I made all the physical assembly and the changes to the .ino file, everything OK but I don't know how to make it work with the scr folder :C can you help me please?</p>
<p>Sorry my instructions for that part were so bad. I'm going to re-upload the code to make it easier to run. I'll notify you and give you instructions on how to run it when I've done that.</p>
<p>Oooooohhhh, ok, thanks alot!!!!!</p>
<p>Okay, I uploaded the new code. Check the README.txt for instructions</p>
<p>Okay, all solved, but i have COM3 and COM4 as serial ports and it doesn't work putting any of the ports in the port.txt file :(</p>
<p>Are you sure you have the drivers for the Arduino installed? Make sure that after uploading the code to the arduino it displays &quot;Done Uploading.&quot; If it hangs with &quot;Uploading...&quot; you probably don't have the correct drivers. To which port are you uploading the Arduino Code?</p><p>Also, to make sure the arduino code works, try using the serial monitory (I think it was called something like that) to send one character(try a range of different characters to be certain) to the arduino - this should make all the lights on the rightmost columns light up.</p>
<p>It's finally working!!! thanks a lot! and now, how do I run the Test.java file? </p>
<p>Use &quot;ant run&quot; in the folder where the &quot;build.xml&quot; is</p>
<p>You'll have to use &quot;ant compile&quot; first though - and you also need ant installed</p>
<p>Yes, I have all that but the matrix only displays the time. :/</p>
<p>If you want the change what the matrix displays, go to the Test.java file and at the end you should find something that looks like: &quot;TIME: &quot; + date.getHours() + &quot;:&quot; + date.getMinutes() + &quot; &quot;. You can change that to whatever you want to print out. So, if I want the matrix to print out: Hello There, I would change the part of the line to &quot;Hello There.&quot; </p><p>If you want to get more in-depth than that, I would suggest you learn how to program Java (trust me, programming is a useful skill). There are several good books available online. I would recommend Head First Java.</p>
<p>Thanks a lot man! and yes, I'm studying Mechatronic engineering but I'm in 1st semester, and I know I'll need that so I'm trying to learn all kind of things that will be useful for me in the near future in my career, so yea! I'll take your suggestion :)</p>
<p>Glad I could help :)</p>
<p>great job</p>
<p>Thanks!</p>
<p>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! </p>
I plan on uploading some videos at some point. I'm not sure if or when yet.
<p>Leave me a comment here when that happens. I'd love to see it! </p>
<p>Alright, I uploaded two videos of the LED matrix in action.</p>
<p>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! </p>

About This Instructable

21,752views

319favorites

More by vastsuperking:Arduino LED Matrix 
Add instructable to: