Things were wrapping up on the radio clock just as we were heading into the holiday season back in 2010, and my wife bought me a bunch of nice little projects – this little scrolling message board from Hansen Hobbies was in my stocking:
This took all of about 15 minutes to put together, but it’s cute and it works well. In hindsight, the $40 pricetag is a little large, and for what it is (a small toy), I think they’re just a tad overprotective of their source code (i.e. they explicitly say on their website that they won’t give it out.) Oh well. Anyway, as soon as I had it working I realized two things: One, I wanted COLOR! And two, gosh, it’d make a nice clock… so now I had my next project in mind.
The basic architecture was pretty easy to understand, you just need to daisy-chain a bunch of 74xx595 shift registers together and each bit lights up a single pixel, and then you scan through the rows rapidly enough (i.e. 60hz or greater per frame, or > 480 lines per second) to create the whole character using persistence of vision, just like an old CRT TV. The first trick was finding RGB color 8×8 matrixes like Hansen’s little red ones, though. The standard sources (Digikey, Mouser, etc.) simply do not have any of these, primarily because it appears that there aren’t any Large Reputable Electronics Manufacturers building these. Well, maybe Lumex is, but the distributors don’t stock them, and they also don’t sell them onesy-twosy. However, there are Chinese companies churning these out like there’s no tomorrow. I did find some available at Sparkfun, and I also later discovered you can buy them from the nice folks at EvilMadScientist too. (I still want an Eggbot.) They’re kinda pricey, though – Sparkfun’s go for around $30 each, if I remember correctly, and I wanted to daisy chain at least three of them together to have enough real estate to be able to read a message. I didn’t really have much choice, though, other than to abandon the project altogether.
I started really simple and bought a single tri-color LED at Radio Shack. This let me experiment with writing some PWM (“pulse width modulation) code to fade the colors on a single LED. For the non-engineers: PWM just blinks the light on and off at varying durations, but at very high speed, so that it appears to be different brightnesses as desired, but not flickery to the human eye. It was very pretty, I still want to go back and build a little mood lamp out of it. Having knocked that together quickly, my idea was that I would design my own printed circuit board for the first time and I’d design it with connectors so that you could chain an arbitrary number of them together and build it up to be as big as you want. 3 seemed like a good place to start.
It seemed natural to use another Propeller as the microcontroller, since I’d just invested a whole bunch of time learning how to use it, so I attached another RTC chip to drive the clock to a Propeller and then it was time to design the basic circuit. Here’s a pic of the breadboard: It was quite a tangle, because a single 8×8 RGB display has 32 pins, 8 transistors to sink a row of LED current through, each with a base current limiting resistor, and 24 resistors to limit the current to each column, and 4 shift register chips.
It did the job though – it was invaluable to get some software running, lighting up different dots and colors, and scanning through the rows.
Confident that the circuit was working well, it was time to develop a New Big Skill that I had no experience with, namely, PCB design. I spent about 10 minutes looking at Eagle’s UI and just about retched up a lung. I mean, seriously, it’s not 1995 any more. With this many years of graphical app design in the world, you’d think they would have done a major overhaul by now just for usability’s sake. In researching the alternatives, I found Diptrace and I haven’t looked back since. You can download a 300-pin 2-layer version as freeware, and they will provide you with a 500-pin update for non-profit use for free, just by asking. The Diptrace UI follows standard Windows conventions fairly well, the tutorial was good enough to get me off the ground, and the product is of reasonably high quality. I haven’t found any obvious bugs. The word on the street is that their “shape” autorouter, which figures out how to route the wires on the board without overlapping other ones, blows Eagle’s out of the water. My experience to date is that the router does an excellent job, although it does suffer a little bit from poorly documented parameters. You can usually improve a bit on the routing it comes up with after the fact, but I’ve seen it solve some pretty tough situations, and it makes for a good starting position for minor manual tweaks.
Here’s the final revision I designed around the Sparkfun LED module:
OK, it took me about 3 or 4 iterations to get there (and a lot of roundtrips with Sparkfun’s BatchPCB service.), so it was costing me a fair bundle to get “final” boards, but by gum, I was learning! It’s educational, right? 🙂 The revisions allowed me to include a few things I’d forgotten like room for mounting holes, and also to make a reversal of which side was input vs. output on the ribbon cable connectors.
A shoutout to BatchPCB here, by the way: Most printed circuit board companies, of which there are many, are built around a business model where volume discounts can be extremely steep but low volume orders are expensive. There’s a lot of setup and prep involved with making the first board of any particular design, so it’s hard to drive down those manufacturing costs. Where BatchPCB comes in is to aggregate lots of hobbyist single-order boards onto one larger panel, and to work with a Chinese company to get the boards produced at lower cost. The turnaround time is long (typically around 3 weeks from order to receipt of the goods) but the cost savings is worth it. Furthermore, you virtually always get at least one more board than you actually paid for in “overage”, which is a real bonus.
There is an alternative in Oregon that I like too (Sunstone Circuits) who also has a reasonably cheap 2-layer prototyping service with 2-week turnaround (and usually even less, in my experience). They’ll only silkscreen one side of the board compared to both sides for BatchPCB, but on the positive side, Sunstone’s minimum trace/separations for 2-layer boards are slightly smaller at .007″ vs. .008″, and they can do smaller vias as well (.016″ vs .020″). Also, from up here in Seattle even ground shipping amounts to overnight service, so even though the price is a bit more, sometimes it’s worth it to keep from getting stalled on a project.
Routing the traces for this board as my very first PCB project was a little tricky because of a few conflicting constraints:
- The board needed to be the width of the LED module so you could put them next to each other and get a seamless transition from one module to the next in line.
- The LED chews up a pile of board area, and I wasn’t comfortable yet with surface mount parts, so everything had to be through-hole. This meant mounting shift registers and DIP resistor packs on the back of the module under the LED to make use of all that board space. Once the LED is soldered on, you won’t be able to make any changes to the parts soldered underneath it. (On assembly, I realized this also meant screwing down the board standoffs (good and tight!) before soldering on the LED as well.
- Traces were getting a little bit tight side by side, particularly since I wanted to be a bit conservative for traces carrying a lot of current back to ground.
It did all fit in the end, though, and I was pretty pumped when my first boards of my first design worked great, right out of the gate. That was a really fun day. 🙂 Some others that I’ve made since then have not been so lucky – it’s a real drag when you think you’ve triple checked the layout and the schematic and you STILL find some error that’s a pain to fix when they come back in the mail.
Next time I’ll throw in some pictures of the final result and talk some more about the software that drives this RGB panel, because that’s a whole saga of its own.