Build Your Own Programmable LED Matrix




Introduction: Build Your Own Programmable LED Matrix

QR codes are addicting. Smartphones are smart enough to read them from virtually any angle or orientation. But imagine taking it a step further. I had dreams of a digital LED array that I could program with QR codes, and I wanted it really big! 

I used 16 matrices to create the QR code that is pictured here. You may purchase the kit to build an 8x8 panel from Jameco.

LEDs are not included to give you the freedom to choose your own size and color.

Step 1: Requires

Required tools and parts:
Soldering iron and solder
LEDcontrol library
LEDs (10mm recommended)
Wire cutters and strippers
Jumper wire

LED Matrix Kit Includes:
LED Matrix PCB
47 Ω resistors
10μF capacitor
Control Board PCB
150k Ω resistor
0.1μF capacitor
IRF9Z34N transistors
IC socket
Pan head screw, 4-40x3/8"L
2N2222A transistors
2x8 female header
Hex spacer, 4-40x7/16"L
1k Ω resistors
2x8 male header
Hex standoff, 4/40x3/8"
1.5k Ω resistors
MAX7219 IC

Step 2: Install Pin Headers

Loosely fit the male and female header together and place the female header onto U1 of the control board and place the matrix board on top so the pins of the male header are visible through U1. The silkscreen should be face-up on for both boards.

Temporarily install a few spacers on the control board and stand the board pair on one side so both boards are square to each other. Tighten the spacers. This has an added benefit if you are building multiple matrices. They will all sit nicely flush next to one another.

Step 3: Install the Resistors

Solder all the resistors according to their value and silkscreen location on the control board.

R1 - R8 = 1k Ω (brown-black-red)
R9 - R16 = 47 Ω (yellow-violet-black)
R17 - R24 = 1.5k Ω (brown-green-red)
R25 = 150k Ω (brown-green-yellow)

Step 4: Install the Capacitors

Install both capacitors and note the markings on the silkscreen. Polarized capacitors must be positioned correctly or it will not work.
C1 = 10μF electrolytic capacitor and is polarized. Note the stripe indicating the negative side. The silkscreen shows a "+" sign for positive. Solder the capacitor with enough space that you can bend the capacitor over to lay flush with the board.

Step 5: Install Transistors

Match the tab on the side of the transistor with the tab of the silkscreen. There are three leads that should also match the orientation.
Q9 - Q16 = 2N2222A. Make sure each transistor says 2N2222A. (If it's something else, it could cause the opposite action to happen once programmed.

Helpful Tip: Solder one lead of each transistor at a time. This holds them in place and allows you to make minor adjustments. It also allows the transistors a brief period to cool before you solder the next lead.

Q1 - Q8 = IRF9Z34N. These transistors must be placed in the correct orientation. The sliver of a rectangle on the silkscreen indicates the backside of the transistor. Bend the leads back 90 degrees so the transistors will lay flat on the PCB when installed. You may also choose to leave a slight gap between the back of the transistor and the PCB for airflow to keep components cool.

Step 6: Install Socket and ICs

Note the notch on the PCB and the notch on one side of the socket. Match these notches up before soldering all of the pins. Install the Max7219 IC also noting the notch on the end near pin 1. You may need to square up the pins to get it to seat into the socket.

Step 7: Install the LEDs

Install one row of LEDs at a time. Solder one leg of each LED at a time so you can make minor adjustments to their position. Take your time. The straighter the rows, the better your display will look. The flat side of the LED on the silkscreen indicated the negative side. The shorter leg of an LED is negative.

Step 8: Install the Spacers and Standoffs

The standoff has threaded male and female ends while the spacers have only female threads. The spacers go between the control board and the matrix board, while the standoffs will thread into the spacers from the underside of the control board.

Step 9: Complete Wiring

Line up the pins of the headers from both boards and also the mounting holes of the PCB and press them together. Use the pan head screws to secure both modules together. It may be helpful to stand the two boards on the even side so they may be tightened when square to each other. Solder test leads to the pads on the underside of the control board, preferably with header pins on one end to connect to the Arduino.

Step 10: Program Your Arduino

I hooked up my matrix to an Arduino Uno, so if you have a different model, you may need to change the pins. Solder jumper wires to the pads on the back of the control board. There are pads for DataIn (DIN), Load, Clock (CLK), 5V (V+), and Ground (GND). Copy the sample code found on the Kit Instructions PDF to test the LEDs. (Also found at the end of this document.)
Connect the jumpers from the control board to the following pins.

DIN = DataIn (pin 12 on Arduino)
DOUT = DataOut (connects to next module's DIN, if applicable)
CLK = Clock (pin 11 on Arduino)
LOAD = Load (pin 10 on Arduino)
V+ = 5V pin if your power supply to the Arduino is greater than 5V, or connect it to VIN if your input power supply to the Arduino is 5V.
GND = Ground

If you are connecting additional panels, you will need to daisy-chain them as follows.
• DOUT from first control board (the one connected to the Arduino) connects to DIN of next control panel
• CLK connects to CLK on the next board
• LOAD connects to LOAD on the next board
• V+ can be connected together, but it is strongly recommended to supply power to each board's V+ independently to limit the amount of current flowing through the board
•GND can also be connected together, but for optimum operation, it is best to run independent ground lines to each board.

Step 11: Additional Programs and Patterns

Programming the LED panel can take a lot of time to figure out what LEDs you want on or off. You will need the LEDcontrol library installed into your Arduino's library folder. The library can be found here: More information on the LEDcontrol library for Arduino can be found here: When you get into strings of panels to program, it may be easier to write some functions into an Excel spreadsheet to automate some of the programming, since the only thing changing are the panel being addressed and the LEDs that are on or off. My spreadsheet tool was designed for 16 LED matrix panels, chained together in two groups of 8. 

The spreadsheet tool (Excel file near the bottom of the page) assumes there are 16 panels arranged 4x4, and the order as the Arduino sees it is left to right from top to bottom.  Just place an "X" or other character in the cell you wish to light up, then click the "Build Code" button and it will create the code for Arduino and copy it to your clipboard. (Note: Your Macro security settings in Excel may need to be lowered to allow the button to run its function of creating the code.)  The best method I found for the QR codes is to create one on another website, import the image and scale correctly so each dot has its own cell.  Using the Picture tools, you can select the white cells as the "transparent color" that way you can see the grid of cells behind it.  Use the keyboard to navigate between cells because the mouse will just click the image.  Place an "X" everywhere you can see the cells and leave the black cells blank (OFF), and there you have it.

//This code below will turn on every dot of the matrix to test that all LEDs work.
#include "LedControl.h"
#include "binary.h"
***** These pin numbers are for the Atmega328P
* with Uno bootloader *****
* LedControl (name)=LedControl(DataIn,CLK,LOAD,number of Max7219) *
* pin 12 is connected to the DataIn to first cluster of 8
* pin 11 is connected to the CLK
* pin 10 is connected to LOAD
* number 1-8 up to 8 matricies
LedControl lc0=LedControl(12,11,10,1);
void setup(){
//we have already set the number of devices when we created the LedControl
int deviceA=lc0.getDeviceCount();
//we have to init all devices in a loop
for(int addressA=0;addressA<deviceA;addressA++)
/*The MAX72XX is in power-saving mode on startup*/
/* Set the brightness to a medium value (1-15) */
/* and clear the display */
/* To determine which LEDs will be on, think of the row as having 8 positions with a specific number attached to each
(128, 64, 32, 16, 8, 4, 2, 1)
If you want every other dot ON in the row starting with the first, add the numbers located in the position you want ON.
(128 + 0 + 32 + 0 + 8 + 0 + 2 + 0) = 170. Use the number 170 in place of 255 below to turn on every other.
All the LEDs on in the row would be (128 + 64 + 32 + 16 + 8 + 4 + 2 + 1) = 255.
void loop(){
lc0.setRow(0,0,255); //255 sets all LEDs in the row to ON

Be the First to Share


    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest
    • Frozen Treats Speed Challenge

      Frozen Treats Speed Challenge
    • Tinkercad to Fusion 360 Challenge

      Tinkercad to Fusion 360 Challenge



    Reply 7 years ago on Introduction
    If the link didn't come through, you can find it under p/n: 2159146 at

    r3d ph0x
    r3d ph0x

    7 years ago on Introduction

    Can you use a single Arduino Uno to control all 16 of the 8x8 LED matrices?

    What are the dimentions of a single 8x8 LED matrix?


    Reply 7 years ago on Introduction

    Yes you can. You will only use 6 digital I/Os from your Arduino for 16 8x8 LED matricies (3 I/Os per array of 8 matricies). A single matrix PCB is 4" x 4". The control board underneath sticks out a little but it shouldn't interfere with another matrix on any side.


    9 years ago on Introduction

    Just one question that 16x16 led matrix that you built in the photo how do you hook up all the leds to the pins on the arduino im kinda new and im having trouble understanding how you get the leds to light up in the correct spots


    Reply 9 years ago on Introduction

    The gigantic matrix in the photo is actually 32x32. Each 8x8 LED panel is controlled by a MAX7219 LED driver IC which can control up to 64 individual LEDs with only 3 pins on the Arduino. Up to 8 ICs can be daisy-chained together to control up to a maximum 512 LEDs with the same 3 pins on that Arduino. So the top 8 panels are using 3 pins on Arduino, and the bottom set of 8 panels are using another 3 pins on the same Arduino.

    The code is what controls what LEDs are on or off. One of the last pages of this Instructable has a spreadsheet I created to make writing the code much easier. If you read up on the LEDcontrol Library from, it will tell you how the code is structured to address the individual LEDs.


    9 years ago on Step 4

    Did I miss Something? As to the part that lets me know where to buy the kit and the part# @ JamecoElectronics ? Thanks for the help.


    Reply 9 years ago on Step 4

    Please use this link to view the part:


    9 years ago on Introduction

    Not wanting to come across as just a mocker, but..
    Is $40 for a 8x8 display really the best Jameco can do? Seems a little affordable compared to other options. Especially by the time you are buying 16 of them.


    9 years ago on Introduction

    What is the smallest resolution that say, an iphone, will reconize the lights from the QR code display? Could you drop it down to one panel, 4 panels square? Things add up quick when the display is scaled up.


    Reply 9 years ago on Introduction

    Try this site:

    Be sure to select Size: Small for the smallest version of the QR Code you want.


    Reply 9 years ago on Introduction

    Printing may be a different story as in this you are using light for the pixels. The brightness of the LEDs might bleed and create interference with the image or focus making it unreadable.


    Reply 9 years ago on Introduction

    The MAX7219 IC used to drive the LEDs can has a brightness setting from 1 to 15. Indoors I used level 3 and that was enough for the sign to be scanned from 15 feet away and had very little image bleed. If it is really bright, you scanning device should hopefully compensate for all the light.


    Reply 9 years ago on Introduction

    Thanks for the info. This board has a lot of potential for the soft circuit/wearables world. Wire the LEDs to longer leads and enable them to just plug back into the board and you have instant advertising grids on clothing. There is somebody out there that wants to wear one, jump into an official photo and the flash triggers off the IR LEDs to imprint someone's photo with their QR code. Maybe you could come up with an RGB version to make bigger displays for Daft Punkness.


    Reply 9 years ago on Introduction

    You can also use use address shorteners with the .ly suffix
    For example, and simple address to needed 21x21 pixels, but adding more to the link after the .com made QR grow to 29x29. Contrast is also necessary for the code to read right, so a border needs to be added. That brings the dots up to 31x31.