Surface-mount RGB 8x8 Matrix board - it works!

Leveraging madworm's software foundations and melka's ideas for using surface-mount parts, I finished my 8x8 driver board.

It is always hard waiting for the PCBs to arrive from SparkFun's BatchPCB service, but it was worth the wait. It was great practice on soldering those microscopic-pitch resistor arrays. I also found that "Goo Gone" and a toothbrush is an excellent way of removing the leftover flux.


It all looks so easy in the video.

I can't stand still having to wait for my pcbs :D

Very nice work! 8-) A godsend to frustrated RGB matrix owners. Thanks!

Looks great indeed! And there is plenty of room for other components as well, including an atmega 328! It may not need to be a shield after all.

I have 2 questions: 1. Is just one decoupling capacitor enough for the whole board? I am asking this because my latest version of the clock, with one RG 8x8 matrix did not work properly (the processor just reset every 3 seconds) with just one capacitor (and my power source was clean, 4 AA batteries). 2. Isn't there a minimum power required for the resistors? What wattage is the SMD resistors you used?

I put a pad for a single decoupling capacitor, but I'm actually not running with any capacitor at all. Seems to run okay without it. I'll attach to a scope to see how noisy it is on the power planes.

As for the resistors, I selected Digikey part number 742C163221JPCT-ND, which has a datasheet that specifies 0.063W per resistor. Since that's a sustained limit, and I'm doing about 120 Hz, less than 10% duty per row, I'm not sure if I'm anywhere near the limit or not. (If you can help me calculate it, I'd be happy to know how.)

I've now completely revamped the software part, it's all object-oriented and split into nice Spi, Image, LedMatrix, program parts. It can handle a screen memory that's bigger than 8x8 and just display the specified offset into it, or swap from one screen memory to another immediately. When I'm happy with it, I'll start putting most of this onto the playground.

The software side sounds very interesting as well. One cannot forget about MFC (and document/view architecture etc), could he :)?

Regarding the resistor wattage, I am not qualified to help here, but I assume that at some point any of those resistors will take a max of 160mA (20mA x 8 LEDs) of current.

Since this is revision 4, does it mean that you already had 3 other batches of PCBs made?

No, at any given time, only one lit LED is in series with one resistor. A whole common anode is pulled high, and eight individual cathodes are pulled low through a resistor.

I didn't order anything for rev02 or rev03. I kept tweaking the design while waiting for rev01 copies to arrive. Found out all the necessary physical issues with the original layout, fixed those and ordered again for rev04. If I were to go to Seeedstudio or SparkFun and offer the design for sale on their sites, I'd change a few minor things yet... rev05a?

For example, when the board is in the middle of reset, I'd like to have a weak pullup on the active-low display enable pins, for example. No more stuck lines during reset. If I did that, it'd probably be safe to lower the resistors even more, making the display even brighter. (It's plenty bright for indoor use now.)

The nice thing about the tiny resistor arrays is the price. The next size up, which we discussed in the original thread, is about 20x the unit price. They did take a long time to hand-solder. I would think I got it right, but an ohmmeter would spot a bridge or a dead line and I'd have to reflow it yet again. At least resistors are easy to check that way.

Now I know what I forgot to put on my layout !

This pullup on the shift register’s enable pin… Right now I’m facing the problem that during flashing the device some leds may turn on permanently. Not a good thing as soon as you deal with increased peak currents, which is what I’m trying right now for outdoor use in daylight.

Another slip of mind on my side! Yes, of course, just one LED is on at a time!

(If you can help me calculate it, I'd be happy to know how.)

20mA through 220R W = I * I * R (0.02 * 0.02 *220) 0.088 watts Your resistor is 0.063 watts. So it would appere you are over driving it.

BUT But with duty cycle of 10% you only dissipate 10% of this so you are burning:- 0.0088 Watts, well within the rating. :)

Thanks, Grumpy_Mike!

I thought that's how it worked, but I'm always nervous when my answers come out in the same ballpark as the spec-sheet. I trust your confirmation a lot more than my googling and pencil-calculations.

So if a pull-up works on my enable line (to guarantee I'm only enabling when I'm supposed to be enabling), I'll be safe and sound within the power rating, maybe even to go a bit hotter.

madworm, the gamma curve on these things is pretty severe. I've already reworked your inner loop once to work with plain old 8-bit values, but I'm considering how to re-do the inner loop again. For example, #FF0080 for bright hot-pink; cutting the values down to 25% #3F0010 should look quite dim but still gives a light that looks like it's more like 75% or more, more like #3F0010.

Where you bought your RGB matrix? It's a really rgb? or just tri color? You can have all the rgb colors?

I got mine from, the cheapest I've seen but it takes half of forever for the parts to arrive from China.

RGB - red green and blue - real tricolor

Not RG - red and green - mix to get yellow and call it tricolor

If you mix full HIGH/LOW combinations, you get seven colors plus off: RED, YELLOW, GREEN, CYAN, BLUE, MAGENTA, "WHITE."

madworm's excellent inner loop supports more steps or shades of each one, so you have 32*32*32 different colors, a 15-bit RGB color scheme. At the end of my video, I use it to produce the "girly pink" color of Pacman's nemesis Pinky.

I've expanded on it so the loop will take 24-bit color data, but it still reduces it down to 15-bits for display. This makes encoding images from existing computer bitmaps much easier, and gives room for improvement if I can make the inner loop any faster.

So now you have a 15-bit RGB color scheme?

Yes, those leds don't show linear behaviour. As expected. Yesterday I tried to do some timing analysis on my old scope. Getting it to trigger was a nightmare. I was trying to get the leds brighter by adding more shift registers. So 3 regs for every 8 leds (now individual leds). So I thought to remove the 1/8 ratio by keeping the one single row on all the time. Didn't work. I guess there is some error of thought in my head.

Currently my ISR runs about 50% of the CPU time and a complete 32 step pwm cycle takes roughly 10ms or so. Don't quite remember now. So the leds are off most of the time.

I think for achieving a perceived linear brightness curve this may not be the way to go (needs more resolution), but it's good enough to have some fun ;D

I tried sending the Eagle and Gerber files for my "Revision 05a" to Seeedstudio today, but got this bounce:

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:

albert.miao {AT} (ultimately generated from PCB {AT} The mail server could not deliver mail to The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.

If someone at Seeedstudio did get the files, let me know.

The Revision Five board is a plain Arduino shield. It has a pullup resistor to keep the display disabled through a board reset, and holes to let the D0-7 and A0-5 headers through. (Though you'll have to use stacking headers bent over, since the matrix itself is overhead.) It also passes the last shift register out, so with some crafty cabling, you could daisy-chain multiple displays. The anodes are routed like madworm's board, so it should be software compatible, but I'll be posting my software later which is all C++ class oriented.

Note that this design works with the RGB matrix parts offered at and Seeedstudio, but does not work with the matrix parts offered at SparkFun. I was disappointed to see that the pinouts are completely different (and kinda disorganized) on the SparkFun part. The software could deal with common-cathode/anode differences, but not pinout differences.

Maybe it is worth mentioning that, someone interested in using the Sparkfun RGB LED matrix with this board could make an adapter, using a piece of PCB, a couple of male headers and some wires.

Okay, finally got the Seeedstudio Propaganda five pieces in. Build quality looks excellent. Slightly less tinning than SparkFun's service but perfectly acceptable. I've got all the parts ready, so I'll start soldering this week.

Once the first board checks out, I'll publish my current C++ object-oriented version of the display routine. The board should be completely compatible with madworm's software, latching the colors in the same order. It sits on the standard Arduino board as a shield, with holes so you can pass the analog and low-numbered digitals through with stacking headers.

Ahhh, finally!

Now that Seeedstudio have finally come up with a final design for the Rainbowduino, we need some more movement with this project. I like the driver chips they've used for it, but couldn't find a source for them.

This explains why none of the boards I ordered there using 'propaganda' have shown up in their shop. No use killing their own product. Too bad that they didn't put in another shift register and use direct port manipulation for the line driver. No shared code with them then.

Maybe your shield will make it into their shop ;)