Board layout help: 64-output Mux! (for possible use in 8x8x8 LED Cube)

So just for practice I decided to design a 64-output mux in Eagle, I figured if its good it could be useful in the future. I did not use auto-router.

Here is the PCB: (Click to zoom in)

To the lower left are the interface pins: power, gnd, selectors.
It consists of 2 levels of 8-output muxes (9 total).
Datasheet for analog muxes used (CD4051): http://www.datasheetcatalog.org/datasheets/120/109150_DS.pdf

Here is the schematic it's based on: (Click to zoom in)

The size of the layout is 4.4" x 2.4" which would get really expensive to get printed for an amateur. I kind of get the feeling this whole idea is impractical, but I don't know what to think. Does it even make sense to do this?

Is this a good design?
I'm planning on using this to make an 8x8x8 LED Cube. Would this design cause too much propagation delay since the traces weave in out through vias a lot?
Is there any way I can make this even more compact or efficient? Or just any general improvement?

Any input is appreciated! Thanks!

• The first link to see the PCB Layout full size doesn't work.
– Dean
Aug 4 '11 at 7:29
• Nor the second one. You need to give the public viewing permissions to the images by the looks of it.
– Dean
Aug 4 '11 at 7:30
• links fixed, should work now! Aug 4 '11 at 16:26
• @Shubham: Thanks for fixing the links, but we prefer to have the images hosted on the SE account. Use [CTRL]-[G] or the picture button to link them there. Aug 5 '11 at 2:49
• I don't see a single bypass capacitor in that circuit. You need them! Jun 14 '13 at 5:09

No, it's not a good idea. First you're using analog multiplexers which have a rather high $R_{ON}$, like 125$\Omega$. You're passing two levels of them, so that will be 250$\Omega$. Nothing to worry about, you could say, I'll need a series resistor for the LED anyway. Right, but you'll also have to drive a high current through it. You're multiplexing 64 LEDs one by one, so that's a 1.6% duty cycle. You'll have to pulse them with high currents to get some light out of them, possibly even high enough to seriously shorten the LED's life.

A better solution would be a matrix. The columns could be driven by a ULN2803, which can sink high currents. You could switch columns on one at a time, and for the rows set the row outputs high for the LEDs you want to light in the current column. So a row will only drive 1 LED at a time, a column 8 LEDs at a time. Your duty cycle has increased to 12.5%, so you won't need that excessively high peak current anymore. Yet it will still be more than your microcontroller can deliver, so you'll need a PNP transistor for each row.

Since you'll be driving only 1 column at a time you can use a demultiplexer like a 74HC238, so you'll need only 3 lines for that. Together with 8 row lines that's a total of 11. That would be OK for 64 LEDs, but you'll need 8 of them for the 8x8x8 cube, and that would be costly in microcontroller output.
Solution: use SIPO (Serial In-Parallel Out) shift registers like the 74HC595 for the row data. Cascade them for the 8 matrices, so that you can shift 64 values through them. When the last bit has been shifted in you latch the data and select the column. While the LEDs for this column are on you can already shift in the data for the next column. At the time cue latch the data, and again select the next column.
Alternatively place the 74HC595s in parallel and shift 8 bits simultaneously in them. This will need 8 bits of your microcontroller's I/O instead of just 1, but you won't need 64 shift operations, only 8.

Note: you'll need a ULN2803 per 64 LED matrix; it can't drive 8x8 rows.

• Isn't brightness detected by the human eye on a logarithmic scale? So even at 1% duty cycle, the LED would still appear 1/log(100) = 1/2 as bright? If this is correct, that's fine with with me. Aug 4 '11 at 16:53
• And it looks like I have a lot of research to do. I've seen many instructables on 8x cubes using Shift Registers, but I've never used them so I was trying to avoid using them, but they appear to the most practical solution so I will learn! Aug 4 '11 at 16:54
• @Shubham - about the apparent brightness: if that were the case most LEDs could do with 0.2mA instead of the usual 20mA. Either 0.2mA, or 20mA at 1% duty cycle, you'll find that it's way too faint. Aug 4 '11 at 17:03
• @Shubham, something that emits half the light will appear half as bright. LED brightness is fairly linear with current, and obviously with duty cycle (averaged over some time-span that an eye's sensitive to). Aug 5 '11 at 0:53
• For more info on LED brightness vs. duty cycle, see Does pulsing an LED at higher current yield greater apparent brightness?. Aug 5 '11 at 2:58

(A) This looks like a good time to make the jump to surface mount. Try it, you'll like it !!!.

(B) Display driver alternatives.

35 LEDs driven from a single package, driven by a single output pin.

If you want to spoil all the fun and get a compact solution that works (but may not challenge your board layout skills so much, consider solutions such as:

• MM5450 35 LED driver. Datasheet This is my favorite from way way way back. Once you use one of these you'll be spoiled. 35 LEDs from one output pin ! :-). In terms of cost effectiveness and simplicity of drive little else compares. In stock at Digikey for $US4.39/1 in DIP40, and also in stock in PLCC 44$3.78/1. Chainable with a little work. Notionally requires 3 lines to control it but the excessively enthused can do it with 1 line and a few RC delays. It works :-). They say: Data is transferred serially via 2 signals; clock and serial data. Data transfer without the added inconvenience of an external load signal is accomplished by using a format of a leading “1”followed by the allowed 35 data bits. These 35 data bits are latched after the 36th has been transferred. This scheme provides non multiplexed, direct drive to the LED display. Characters currently displayed (thus, data output) changes only if the serial data bits differ from those previously transferred. Note the cut and paste typo on page 5 of the data sheet. How to drive with one output pin - see at end.

• TLC59282 16-Channel, Constant-Current LED Driver Texas Instruments' TLC59282 is a 16-channel, constant-current sink driver. Datasheet here. Each channel can be individually controlled via a simple serial communications protocol that is compatible with 3.3 V or 5 V CMOS logic levels, depending on the operating VCC. Once the serial data buffer is loaded, a rising edge on LATCH transfers the data to the LEDx outputs. The BLANK pin can be used to turn off all OUTn outputs during power-on and output data latching to prevent unwanted image displays during these times. The constant-current value of all 16 channels is set by a single external resistor. Multiple TLC59282s can be cascaded together to control additional LEDs from the same processor.

• TLC59281 . Similar.

• Allegro 6276 Suspiciously similar functionally. The A6276EA and A6276ELW are specifically designed for LEDdisplay applications. Each BiCMOS device includes a 16-bit CMOS shift register, accompanying data latches, and 16 npn constant-current sink drivers. The CMOS shift register and latches allow direct interfacing with microprocessor-based systems. With a 5 V logic supply, typical serial data-input rates are up to 20 MHz. The LED drive current is determined by the user’s selection of a single resistor. A CMOS serial data output permits cascade connections in applications requiring additional drive lines. For inter-digit blanking, all output drivers can be disabled with an ENABLE input high. Similar 8-bit devices are available as the A6275EA and A6275ELW

One pin drive

Some IC's with clock / latch / data / reset control lines often seem to have been obligingly arranged so that the polarity of the control signals allows time delays and a single input line to control the IC. Worst case with less obliging IC's a few inverters may be needed.

Clocking on an MM5450 occurs on the rising edge. Data is fed from the input line via an RC delay, with t delay several times greater than the achievable clocking rate. If the input line is held high for Td data goes high. If input is now lowered and raised a high is clocked in. If, instead, the clock line is lowered as soon as possible after the last clock edge and held low for Td and then raised a low is clocked in. A reset or frame load or whatever signal can be achieved by a longer delay of say Treset. Holding the input at the reset level (whether high or low) for > Treset will activate the reset or frame load or whatever function. Reset delay can be restarted by using a diode across the charging resistor so that reseting action is reinitiated every time an o[[osite condition appears on the input line. If copious processor pins are available and the distance to the display IC is small then using multiple drive lines may be preferred. However the above scheme can be used to operate a display IC via a single pair at a distance. For extra points the same pair can be used for power supply. Powering and full control of 35 LEDs on one pair is a good trick if you can do it. With an MM5450 you can. Long ago this was an attractive solution in some cases. Now, in the age of 50 cent (or less) microcontrollers, placing a controller at the "far end" may be preferred.

Brighhtness & current:

LEDS get approximately linearly brighter with increasing current. A current of 15 mA per segment is quoted (which is a minimum value, max being 25 mA+). Many modern LEDs are specified at 20 MA max continuous. A ratio of 3:4 (= 15mA : 20 mA) is virtually indiscernible to the eye, and the efficiency of the LEDs is a far larger factor than small changes in current.

At say 10 mA there are many modern red LEDs that would be as bright as you'd want - and far brighter than LEDs from previous generations. Look at what people like Nichia & Cree are offering at the top end and you'll be duly impressed.

That said, the IC is limited in output if you need all 35 segments on at once. With 15 segments lit you can get 20+ mA (fig 7).

• 35 LEDs with one pin! thats just insane man! I read through the datasheet for MM5450 and unfortunately it's output current is on the lower end at 15mA, and LEDs require 20mA, if im not mistaken. But I'm looking into other LED drivers and shift registers Aug 4 '11 at 17:16
• @Shubham: Re 20 mA. No. LEDS get approximately linearly brighter with increasing current, a ratio of 15:20 is virtually indiscernible to the eye, and the efficiency of the LEDs is a far larger factor than small changes in current. At say 10 mA there are many modern red LEDs that would be as bright as you'd want - and far brighter than LEDs from previous generations. Look at what people like Nichia & Cree are offering at the top end and you'll be duly impressed. That said, the IC is limited in output if you need all 35 segments on at once. With15 segments lit you can get 20+ mA (fig 7). Aug 4 '11 at 22:23

Aside from the issue that this is not the way to drive LEDs, when designing a PCB for large channel counts, you need to use a bottom-up approach, starting from the layout, not a schematic with nice, logical or arbitary pin assignmants. Channel mapping can be done easily in software, so lay out the PCB in whatever way makes the tracking neatest and easiest, then back-annotate to the schematic and use a lookup table to map it.

This 5x5x5 LED cube for an XMOS device uses two STP16CPS05 chips and five BD140 BJTs. It's driven by SPI. Here is my version of the schematic, I was thinking of designing a PCB for it. It could easily be extended to an 8x8x8 cube.

This XMOS XK-1 board that he used costs \$59, including the XTAG-2 interface required for programming and debugging. I've got two of them.

• Your schematic just seems to drive a 5x25 matrix. Is there anything particular to XMOS to this? It looks like any microcontroller can do this. Just curious. Aug 4 '11 at 9:35
• Of course, any device with an SPI port would do. The XMOS chip gives a lot of performance at low-cost (400 MIPS), which is ideal for this sort of thing. It will drive the STP16CPS05 devices at the maximum 30 MHz without any problems. Aug 4 '11 at 10:01

If you use a shift register whose high-side and low-side drive currents are both sufficient to drive an LED at 1/4 duty cycle, my suggestion would be to wire each 8-light string using four wires. Two wires should be wired to dedicated shift-register outputs (using current-limiting resistors if needed), and the other two wires should be in common for all 8-light strings, with very strong independently-controlled high- and low-side drivers. Such an approach would minimize the number of wires needed for each vertical light string (four vertical wires could drive up to twelve lights, but the circuitry for that would be more complex).

Even using 8-output shifter chips, one would only need 16 chips to drive the whole cube (plus a few discrete outputs to control the large high- and low-side drivers).