RGB LED Matrix Controller

RGB LED Matrix Controller

Abstract

RGB MatrixThe goal of this project was to design, manufacture, and assemble a printed circuit board (PCB) that would be used to implement an 8x8 RGB LED Matrix Controller.  The controller was loosely based-off of SparkFun’s LED Matrix Serial Interface with modifications to the power circuitry and microcontroller unit (MCU). The controller has an on-board 8x8 RGB LED matrix to output a multitude of display functions using the two on-board buttons as input controls. The matrix controller drives the LED matrix to either display a color visualizer or a scrolling text viewer. These functions and animations will be pre-programmed to the on-board ATmega328P MCU.

Project Description

RGB BoardSince the goal was to control an 8x8 RGB LED matrix, first a little research was done to see what else was currently on the market. A quick search landed me on SparkFun’s website, a well-known site for do-it-your-self projects. One of their members had designed a serial interface (shown to the right) for the 8x8 RGB LED matrices which was available for purchase on their web site. Luckily everything on SparkFun is open-source, so they had the original schematic (PDF) on their website.

I wanted to do something very similar and create a controller that would be able to display scrolling text to the LED matrix display as well as be a color visualizer for your room when it’s dark. There are many of other applications for a project such as this one, for example, it could also be used as a learning tool for younger computer/electrical engineering students to develop code on and test it out to see how LED matrix displays work. To stay on schedule and make sure deadlines were met, a Gantt chart was developed and the table with timeline values can be observed in Table 1.

Since the schematic was available, I was able to see what components were used to create the serial interface. Instead of having the data come in via serial peripheral interface (SPI), I wanted to have an on-board MCU that could come up with the animations and control functionality instead of just having it pass SPI data through to the LEDs. In order to do this, I needed to use a different MCU. Instead of using the ATtiny, I used an ATmega 328p which had about 5 times the amount of functionality as the original ATtiny chip did. By using the ATmega328p, I was able to integrate function buttons along with an activity LED that could be used for debugging. I wanted the board to be stand-alone, so I needed to integrate some power circuitry for my board to run off of, since SparkFun’s board just ran off the SPI pins that were driving it. The added power circuitry was very simple, a single L7805 5V regulator with a couple of filtering capacitors and headers would allow for a 9V battery pack to supply the necessary 5V to the MCU and the matrix itself. All of the rest of the components were similar to the ones used on the SparkFun board (RGB LED Matrix, shift registers and amplifiers). The final bill of materials (BOM) can be seen in Table 2.

A simple functional block-diagram of the preliminary design can be seen in Figure 1 below. The on-board MCU sends a serialized output to 3 separate 8-bit shift registers which will output the RGB (Red, Green and Blue) control signals. An 8-channel Darlington pair amplifier was used to drive the common cathode of the LEDs. A 6-pin ISP header is used to program new functions or animations to the MCU. The board is powered by 6 AA batteries (~9V) and stepped down to 5V using a voltage regulator.

Functional block diagram

Figure 1 – Preliminary Functional Block Diagram of the RGB LED Matrix Controller

The modified schematic can be seen on the following pages in Figure3, the original SparkFun schematic can be seen in Figure 2. In order to create the schematic, a component library needed to be made because there were a few custom components that were not in the DipTrace standard library files. For example, the 2x16 pin LED matrix header, 2x3 ISP header and polarized capacitor were among the few components that needed to be created and added to a custom library.

Once the schematic was created, all of the components were ordered and the circuit was implemented on a breadboard for testing to make sure that the circuit performed how it should. Programming was tweaked to make a modified version of source code work on the new circuit and was then optimized for outputting color values. The circuit on a breadboard worked perfect and was ready to implement on a PCB.

Now that the circuit was proved working, all of the components needed to be measured with a caliper. This was definitely something new for me; the pitch, width, length and lead diameter of every component needed to be precisely measured to create footprints to be used in the layout. The annular ring needed to be calculated and pitch properly accounted for. Almost all of the components were the standard 100 mil pitch. To make IC removal and modular, IC sockets were used instead of just soldering the ICs directly into the board and possibly having a problem with one later on. Now they can easily be swapped out if needed.

The next step was to design the PCB layout itself. DipTrace made this process fairly easy. The schematic was taken directly from the schematic editor and dropped into layout mode where you were able to move around all of the components and place them where you liked to achieve the tightest and most efficient layout. After this, design rules were specified for the trace spacing and trace/via width. The auto-router was then used which came in very handy as it optimized and automatically routed traces for the PCB. The auto-router did a decent job, however, I did need to go back in and re-route some of the traces that were routed unnecessarily. At this point, a silkscreen layer was added with all of the necessary PCB information on it.

Before the circuit was fabricated, a thought had crossed my mind. What about current capabilities? The RGB LED matrix is capable of pulling up to 2A peak if all of them are on. Some of the original trace widths were unable to handle this amount of current. So to be safe, the main power traces were increased in width to accommodate for the current capabilities. The final board layout can be seen in Figure 4.

When my board went off for fabrication, there was a little snag. Apparently one of the DRC checks had failed. A via ended up being too close to one of the traces that I had increased to accommodate for current, it must have been a last minute slip. The via was slightly moved and new Gerber files were sent off to allow the fabricator to produce the board. The board was fabricated and came back roughly 3 weeks later.

Five PCBs were made for the 8x8 RGB LED matrix controller; however only two of them would be assembled—one for the IME department to showcase and one for myself. All of the components were soldered on both of the boards in less than a couple hours and a power-on test was performed on each of them. The power-on test succeeded, so the other ICs were put into their sockets. The MCU was then programmed and the board powered-on again. It was a success! The 8x8 RGB LED matrix lit up instantly and started flashing patterns. Everything was working as expected. Pictures of the soldered boards can be seen in Figures 5-10.

Some future improvements are to make the source code better, more responsive and easier to make designs in. Also, the voltage regulator gets pretty hot if left on for long periods of time, so a heat sink should be added to prevent damage to the components. An interesting project would be to recreate this project in all surface-mount components to decrease the form-factor dramatically.

 

Conclusion

In the end the project consisted of nearly 64 discrete components on a 6.1” x 3.4” dual-sided PCB. All of the packaged ICs were dual-inline packages (DIPs) to keep the PCB simple and the components cost-effective. The scope of the project was to formulate and create a schematic to represent all of the electrical interconnections and parts needed to complete the project as well as to design a PCB layout in DipTrace. This was successfullly completed and overall a very positive learning experience with a very nice end result.

Downloads

Related Content