DIY LED MATRIX KIT | JAMECO PART NO. 2159146 Experience Level: Intermediate | Time Required: 2 Hours If you have tried using an LED matrix, you know there are a lot to choose from. The problem is that they all seem to have different pin outs. This kit allows you to build your own LED matrix, but the LEDs are not included to give you the option to choose the LED size and color. The PCB is set up as Anode Row/Cathode Column. A 2x8 header on the back connects the matrix to the control board that has the LED driver IC on it. One row of the header is for the rows on the LED matrix, and each pin corresponds to the row it controls (ie. pin 4 is row 4). The other row on the header is for the columns and the same logic applies; pin 6 is column 6 for example. Required tools and parts: Soldering iron and solder Wire cutters and strippers LEDcontrol library Jumper wire LEDs (10mm recommended) Kit Includes: LED Matrix PCB Control Board PCB IRF9Z34N transistors 2N2222A transistors 1k Ω resistors 1.5k Ω resistors 47 Ω resistors 150k Ω resistor IC socket 2x8 female header 2x8 male header MAX7219 IC 10µF capacitor 0.1µF capacitor Pan head screw, 4-40x3/8"L Hex spacer, 4-40x7/16"L Hex standoff, 4/40x3/8" Step 1 - 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. See figure 1 below. Step 2 - Install resistors Solder all the resistors according to their value and silkscreen location on the control board. See figure 2 below. 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 3 - Install 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. See figure 3 below. Step 4 - Install NPN 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. See figure 4 below. Step 5 - Install PFET transistors 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. See figure 5 below. Step 6 - Install socket and IC 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. See figure 6 below. Step 7 - Install 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. See figure 7 below. Step 8 - Install 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. See figure 8 below. 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: http://www.wayoda.org/arduino/downloads/LedControl.zip More information on the LEDcontrol library for Arduino can be found here: http://www.arduino.cc/playground/Main/LedControl 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 order of flow is left to right, top to bottom. Figure 1 Figure 2 Figure 4 Figure 3 Figure 5 Figure 6 Figure 8 Figure 7 SAMPLE CODE FOR ONE 8x8 LED MATRIX //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*/ lc0.shutdown(addressA,false); /* Set the brightness to a medium value (1-15) */ lc0.setIntensity(addressA,15); /* and clear the display */ lc0.clearDisplay(addressA); } } /* 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 lc0.setRow(0,1,255); lc0.setRow(0,2,255); lc0.setRow(0,3,255); lc0.setRow(0,4,255); lc0.setRow(0,5,255); lc0.setRow(0,6,255); lc0.setRow(0,7,255); }