flip flop it or 4051 it?

I am doing a multiplexing project, big 12 by 24 table with rgb leds. I need 50 outputs and was thinking about using the 74HC574, i even already made a protoboard with the circuit (i would love to provide pics, but, no camera) I am now having second thoughts. I saw the 4051 a while back on the playground and i think it would be a better solution. Now, the 6.3 million dollar question, which is better*?

*by better i mean ease of programming, circuit design, all that nonsense. (the other circuit i already built is an absolute monster and a bitch to debug, i was very meticulous about design and layout and not getting any shorts, tested as i went along and such, but still who knows?) Im just trying to make life simpler for myself as i dont think i am at the level of anything this complex.

Questions? Comments? thanks for your time!

Just 50 outputs? Sounds light.
Say you had 24 rows, with 12 RGB LEDs in each row (or equivalently, 36 standard LEDs) that would work out to 60 outputs.
Or 12 rows, with 24 RGB LEDs ((or equivalently, 72 standard LEDs), that would work out to 84 outputs.

Neither one provides the current sink or source capability needed.
With 24 rows and 36 LEDs drawing 20mA each, thats 720mA of current if each RGB LED was on.
You're going to need discrete transistors. P-channel MOSFET for current source, and N-channel MOSFET for current sink.
You could have 8 shift registers to drive them, a string of 3 for the 24 anodes and a string of 5 for the 36 cathodes.
Use SPI.transfer on both for fast updates.

Never ever, ever use a 4051 to drive LEDs, it is the wrong thing to do. It's multiplexing for no reason at all.

sorry typo and math error on my part, 60 outputs, 36 for leds and 24 for grounding each column. you are correct CrossRoads. I was going to use a npn transistor like the 2222 for the grounding, but i am open if you think there is something better out there.

@Grumpy_Mike, could you possible elaborate on why one should NEVER use the 4051 to drive leds? Do you have another solution that is easy to program and would be good for a beginner/novice to work with?

I would go with 74AC574, can source 24mA to drive the anode, use 5 of them daisy chained, wrap Q0 output to Q1 input, 1 to 2,2 to 3, etc so it acts like a shift register for you.

Then a hefty enough transistor to sink 24 * 20mA of current (480mA) on the outputs of a shift register, or arduino pins assuming a bigger chip like '1284 or a '2560.
http://www.fairchildsemi.com/ds/PN/PN2222A.pdf
2N2222 needs lot of base current to pass 500mA of collector current
IC = 500mA, IB = 50mA
I'd find a better part, like an N-channel MOSFET, will also run cooler and last longer.

Could also look into 3 high current shift registers such as tpic6b595

if you can follow these limitations so you don't burn it up:

Pulsed source-to-drain diode anode current (see Note 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 A
Pulsed drain current, each output, all outputs on, ID, TC = 25°C (see Note 3) . . . . . . . . . . . . . . . . . . . 500 mA
Continuous drain current, each output, all outputs on, ID, TC = 25°C . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 mA
Peak drain current single output, IDM,TC = 25°C (see Note 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500 mA

Note 3. Pulse duration ? 100 ?s and duty cycle ? 2%.

I did say
It's multiplexing for no reason at all.
Only an electronic moron would do this. You require constant CPU cycles just to keep things lit. The on / off ratio makes the LEDs dimmer and the cross talk of the device is appalling. How many other reasons do you need?
Just use shift registers.

Well mr. not-enough-fiber I see your point, I think shift registers are a good alternative.

@CrossRoads, I looked at your website and what not, what's your opinion of shift registers? How would I hook up enough of these for my purpose, from my few minutes of research I am guessing I need 8 8 bit registers, 5 for driving the LEDs, then 3 for grounding. Would it take only 8 pins in the arduino to run this? Thanks for the help.

You only need three arduino pins no matter how many shift registers you use. They are simply chained together with the output of one going into the input of the next.

Interesting, do you have a diagram of something like this?

I want to move to Seattle... if single.

Would be nice to see a simple how to on shift registers...

lol that was a tad bit non sequitur.

I am thinking about the 74HC595. but i think it can only provide 20mA of current, so if i want to use all three leds at one time... can someone confirm that?

Thoughts?
oh i found a pretty good how to for this shift register on the main site:

Here's the start of the matrix. The anodes would be driven by a '574 wired as I discussed, the cathode by transistors.
This diagram used '374s (had them on hand) and the SPI pins to drive them.

What MM of LED are you using?

@NI$HANT, they are 5mm rgb common ground LEDs.

@CrossRoads, those pics are helpful, never would have thought to use a flip flop like that. What are your thoughts on the 595 for my purposes?

My thoughts are: they are rated as 6mA output. LEDs typically require a current of 20mA to achieve rated brightness.
Use a part that is rated to provide 20mA, vs one that has a protection circuit that may allow 20mA.
74AC574 will do that that.

That's great, but don't I need 60 mA for each output? If all three LEDs in one rbg are on? I'm also trying to minimulize the wiring, using the flip flop as a shifter looks like a lot of unnecessary wiring. How about a transistor to drive the LEDs with each pin using the 595?

Each of R,G,B needs its own driver, 20mA for each. Individually. Otherwise, all 3 are on.
If you wirewrap the board, it will take very little time to wire the 8 signals across the chip for a couple of chips:

Output Drive (mA) -24/24
(vs 74HC595 Output Drive (mA) -4/4)

Connect straight across the 574:
2:19
3:18
4:17
5:16
6:15
7:14
8:13
9:12

The '574 is also certainly less wiring than adding a transistor.
Here's the start of what I am envisioning.
'574 shift registers to source current into a column of anodes, and a transistor sinking current from that column (or a row, if you turn the whole thing sideways).
Another set of shift registers controls the transistors. Those can be 74HC595, are not as critical if mated with the right transistor.
Pick an NPN transistor that the shift register can drive into saturation, or use a logic level N-Channel MOSFET.
The OEs don't need to be wired to ground, they can be controlled by an Arduino output as well.

OHHHH! i get it now, for some reason i had the idea in my head that D0 would be going to Q7, i see what you mean. Whoops, brain fart. forgot that each individual led in the RGB was controlled with an individual pin...

So it will act just like a shift register, like this tutorial?

except in that tutorial it shows the 595 driving leds....hmmmm.

So what does it mean about the OE bringing the chip into a high impedance state? It will still work with that connected to ground?

( nice diagram by the way, your pretty pro.)

"your pretty pro"
Well, yes & no - you just made me realize that Q1 needs to go to D1, Q1 to D2, Q2, to D2, Q3 to D4, Q4 to D5, Q5 to D6, Q6 to D7, and Q7 to the next chip as drawn.
So not quite straight across the chip, but 1 pin over.
All the Qs go to LEDs.
If the OE is grounded, then you will see some flicker as the data is shifted out.
If you take OE high while the data is shifted in, you will not see that flicker.

The you can write a loop that updates the anodes & cathodes to refresh the display

// code for an 24 x 16 array (8 RGB LEDs, 16 columns) as an example
// not all code parts shown, just the highlights
// set up an array for the cathode drives
byte cathodeslower[ ] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20,  0x40, 0x80, 0,0,0,0,0,0,0,0};  // walking 1 for lower 8 NPNs 
byte cathodeshigher[ ] = {0,0,0,0,0,0,0,0,0x01, 0x02, 0x04, 0x08, 0x10, 0x20,  0x40, 0x80};  // walking 1 for upper 8 NPNs
byte anodes1 [16]; // array to hold 1st 3rd of RGB info
byte anodes2 [16]; // array to hold 2nd 3rd of RGB info
byte anodes3 [16]; // array to hold 3rd 3rd of RGB info
byte columncount;
byte oe = 2; 
unsigned long updateTime=0;

void setup(){
pinMode (oe/, OUTPUT);
digitalWrite (oe/, HIGH);
SPI.begin;
}
void loop(){
// set up for blink without delay operation
if (millis() >=updateTime){
// yes, set up for next update
updateTime = updateTime +2; // update a column every 2 milliseconds, 16 columns at ~24 Hz rate
digitalWrite (oe, HIGH);  // turn off display
SPI.transfer (anodes1[columncount]); // update anodes
SPI.transfer (anodes2[columncount]); // update anodes
SPI.transfer (anodes3[columncount]); // update anodes
SPI.transfer (cathodeslower[columncount]); // turn on a cathode
SPI.transfer (cathodesupper[columncount]); // turn on a cathode
digitalWrite (oe, LOW); / turn display back on
columncount = columncount+1; // update for next column
if (columncount == 16){columncount = 0;} // reset if reach the end
} //end display refresh

// now the fun part, for you!
// read buttons, or whatever processing you plan to do for patterns, etc., 
// and update anodes1, anodes2, anode3 as needed
// 
} // end void loop