Introduction: 48 X 8 Scrolling LED Matrix Display Using Arduino and Shift Registers.
This is my first Instructable and it's all about making a 48 x 8 Programmable Scrolling LED Matrix using an Arduino Uno and 74HC595 shift registers. This was my first project with an Arduino development board. It was a challenge given to me by my teacher. At that time of accepting this challenge, i didn't even knew how to blink an LED using an arduino. So, i think even a beginner can do this with a little bit of patience and understanding. I started off with a little research about shift registers and multiplexing in arduino. If you're new to shift registers, i recommend learning the basics of multiplexing and daisy-chaining shift registers before starting with the matrices. That will help you a lot to understand the code and the working of the scrolling display.
Step 1: Gathering the Tools & Components.
- 1. Arduino Uno R3 - 1
- 2. 74HC595 8 bit Serial to Parallel Shift Registers. - 7
- 3. BC 548/2N4401 Transistors - 8
- 4. 470 Ohms Resistors - number of columns + 8
- 5. Pref Board 6x4 inches - 4
- 6. Color coded wires - As required
- 7. IC holders - 7
- 8. 5 mm or 3 mm 8x8 common cathode mono color LED Matrix - 6
- 9. Male and Female Headers - As required.
- 1. Soldering kit
- 2. Multimeter
- 3. Glue gun
- 4. De-soldering pump
- 5. 5V Power Supply
Step 2: Building the Circuit on Breadboard.
The first thing you must do before building the prototype is to get a pin diagram of your 8x8 matrix and mark a reference point for identifying the pins in all your matrices. This might help you while assembling the circuit.
I've attached a pin diagram of the matrix module which I've used here. In my module the rows were the negative pins. This pin diagram stays the same for most of the modules in the market.
It's shown in the circuit that a single shift register is used to control the 8 rows and for controlling the columns, we use one shift register for each 8 columns.
Let's build a simple 8 x 8 scrolling display on the breadboard.
The circuit is split in to two parts - row control and column control. Let's build the column control first.
- Pin 4 from arduino is connected to Pin 14 (SER) of the shift register. (This is the serial data input pin of the shift register. The logic levels required to turn on the LEDs are fed through this pin.
- Pin 3 from arduino is connected to Pin 12 (RCLK) of the shift register. (Let's name this pin as the output clock pin. The data in the memory of the shift registers are pushed to the output when this clock is triggered.)
- Pin 2 from arduino is connected to Pin 11 (SRCLK) of the shift register. (This is the input clock pin which shifts data in to the memory.)
- VCC +5V is given to the shift register through it's Pin 16 and the same is connected to the Pin 10. (Why? Pin 10 is the SRCLR Pin, which clears the data in the shift register when triggered. It is an active low pin, so in-order to maintain the data in the memory of the shift register, this pin needs to be supplied with +5V all the time.)
- The ground is connected to both the GND Pin (Pin 8 of the shift register) and OE Pin (Pin 13 of the shift register). (Why? The output enable pin needs to be triggered in-order to give outputs according to the clock signal. It's an active low pin just like the SRCLR Pin, so it needs to be maintained in the ground state all the time to enable the outputs.)
- The column pins of the matrix are connected to the shift register as shown in the circuit diagram with a 470 ohms resistor in between the matrix and the shift register.
Now, for the row control circuit.
- Pin 7 from arduino is connected to Pin 14 (SER) of the shift register.
- Pin 5 from arduino is connected to Pin 11 (SRCLK) of the shift register.
- Pin 6 from arduino is connected to Pin 12 (RCLK) of the shift register.
- VCC +5V is given to Pin 16 and Pin 10 as described above.
- Ground is connected to Pin 8 and Pin 13.
- As I've mentioned above, the rows were the negative pins in my case. It's better to consider the negative pins of your matrix as the rows of your display. The ground connection needs to be switched to these negative pins using BC548/2N4401 transistors which are controlled by the output logic levels of the shift register. So the more negative pins, the more transistors we need.
- Give the row connections as shown in the circuit diagram.
If you've succeeded in making the 8 x 8 matrix display prototype, you can simply replicate the portion of the circuit for the column control and extend the matrix to any number of columns. You just need to add one 74HC595 for every 8 columns ( one 8 x 8 module) and daisy chain it with the previous one.
Daisy chaining the shift registers for adding more columns.
Daisy chain in electrical engineering is a wiring scheme in which multiple devices are wired together in a sequence.
The mechanism is simple:the SRCLK (input clock. Pin 11) and the RCLK (output clock. Pin 12) pins are shared between all the daisy-chained shift registers while every QH PIN (Pin 9) of the previous shift register in the chain is used as serial input for the following shift register through the SER PIN (Pin 14) .
In simple words, by daisy chaining the shift registers, they can be controlled as a single shift register with a larger memory. For example, if you daisy chain two 8 bit shift registers, they will operate like a single 16 bit shift registers.
In the code we feed the columns with the respective logic levels according to the input while we scan along the rows. The characters from A to Z are defined in the code as logic levels in a byte array. Each character is 5 pixels wide and 7 pixels high. I've given a more detailed explanation about the working of the code as comments in the code itself.
The Arduino code is attached here.
Step 3: Soldering.
To make the soldered circuit easier to understand, I've made it as large as possible and gave separate boards for the row and column controllers and connected them together using headers and wires. You can make it much smaller by soldering the components closer to one another or if you are good at PCB designing, you can make a smaller custom PCB as well.
Be sure to put a 470 ohms resistor to every pin leading to the matrix. Always use headers to connect the LED Matrices to the board. It's better not to solder them directly to the board as prolonged exposure to heat may damage them permanently.
As I've made separate boards for the row and column controls, I extended wires from one board to the other to connect the columns. Here, the board on the top is for controlling the rows and the board at the bottom is for controlling the columns.
it just needs only a single 74HC595 to drive all the 8 rows. But based on the number of columns, more shift registers should be added, there is no theoretical limit for the number of columns you can add in to this matrix. How big can you make it? Let me know when you get there! ;)
Step 4: Testing the Finished First Half of the Circuit.
Always test it halfway to find possible errors like loose connections, wrong pin connection etc: Many people who asked me for help in finding the error in their matrix had made their mistake with the row-column pin-out of the matrix module. Check it twice before soldering and use color coded wires to distinguish the pins easily.
Step 5: Building the Second Half.
Extend the same column control circuit. The rows are connected in series to the previous one.
The SRCLK and RCLK pins are taken in parallel and the QH (Serial data out. Pin 9) of the last shift register of the finished circuit is connected to the SER (Serial Data in. Pin 14) of the next shift register. The VCC and GND power are also shared between all the ICs.
Step 6: The Result
After you've finished with soldering, the next step is to make a case for your display. It's always better to design a custom case using Fusion 360 or any other 3D design tool and 3D print the case. As i didn't had access to 3D printing at that time, i made a wooden case with the help of a friend who's good at woodworking.
Hope you enjoyed reading this instructable. If you would like to help me create more cool projects, click here to send a donation through PayPal. Post the pictures of your version of this project in the comments section below and If you've any questions, feel free to ask it here or send a mail to email@example.com. I'll be happy to help you out.
Thank you! :)