Let's Make Robots!

serial to parallel or something else to save on pins

I've been tackling a very simple project building a 3x3x3 led cube and running it from a 555 timer and a 4020 binary counter, this provides outputs which essentially switch on and off strings of 3 LEDs in patterns. I thought this was cool for a couple of hours and a £2 investment.....

then I looked at youtube and got jealous !

I now want to build a larger matrix - or at least a 3x3 where each LED is able to be operated independantly of the rest (instead of 3's) . I'd like my BS2 to do this, but the little rascal of course has only 16 pins! .

So here's the question - I'm seeing people building much more complex arrays and wondering - my original thought was to have a series of 3 buffers, each get the same 9 pin outs, but then I use 3 further pins to decide whether the buffer is on or not. Of course this doesn't work well enough to give me all 27 variables - most permutations would not be available. This would allow me to at least have any one single LED illuminated, and have planes and strings though, bu tnot the full 134,217,728 variations from all off to all switched on.

How can I drive any permutation of LEDS (from say 27 for a 3x3) from only 16 pins. Is there a cheap IC that I can, for instance, that would take a serial input and create a parallel 27 bit output ??

I'm looking at LED sceens and thinking these use far more options so there must be a way to crack it ?

C'mon guys - you've never let me down for brilliant solutions in the past - what can be achieved here. I was stunned by some of he 3d renditions on the 100 x 100 x 100 cubes - but that's a bit beyond my budget     

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

how about a simple MAX7219 led driver ic?

lets you drive 16 leds individually per chip.


Thanks guys -


slam- dunked this one !

Multiplesxing looks a good option for ease - shift registers look good too - love Charlieplexing but just too damned tricky for a 3X3 matrix


Cheers A

Cool fox,


Just the little chaps I was looking for - off to order a few now !!

Shift registers my friend, shift registers.

These little wonders can turn a few pins into virtually infinite output pins, but the more outputs you add the longer it takes to update them all. Still, they are probably the easiest way to expand your outputs.

There are even some shift register type ICs out there that are made for driving LEDs, but you probably don't need anything special for your matrix.

You can also look for 'I/O Exapnders' which can also increase your digital inputs.

Edit: also look up the topics of 'multiplexing', 'demultiplexing' and 'charlieplexing'. These are techniques used for effectively controlling a large number of I/O with fewer pins.
A simple example of demultiplexing would be to use 9 outputs for driving the high side of each 3x3 'slice' of the matrix, and then using 3 more outputs to drive the low side of each slice. Rather than control all 27 LEDs at the same time, you just control one slice at a time, and rapidly cycle through the slices, too fast for the human eye to notice that there's only one set of LEDs on at a time.