Go Down

Topic: flip flop it or 4051 it? (Read 3181 times) previous topic - next topic

Paranemertes

Mar 20, 2012, 04:51 am Last Edit: Mar 20, 2012, 06:56 am by Paranemertes Reason: 1
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!
"It's Dr. Evil. I didn't spend six years in Evil Medical School to be called 'mister,' thank you very much."

CrossRoads

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.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Grumpy_Mike

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

Paranemertes

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?
"It's Dr. Evil. I didn't spend six years in Evil Medical School to be called 'mister,' thank you very much."

CrossRoads

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.
http://www.ti.com/lit/ds/symlink/sn74ac574.pdf

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
http://www.ti.com/lit/ds/symlink/tpic6b595.pdf

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%.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Grumpy_Mike

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.

Paranemertes

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.
"It's Dr. Evil. I didn't spend six years in Evil Medical School to be called 'mister,' thank you very much."

Grumpy_Mike

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.

Paranemertes

Interesting, do you have a diagram of something like this?
"It's Dr. Evil. I didn't spend six years in Evil Medical School to be called 'mister,' thank you very much."

radfly

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

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

Paranemertes

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?
http://download.siliconexpert.com/pdfs/2005/03/06/semi_ap/2/phi/shift%20registers/74hc_hct595.pdf

Thoughts?
oh i found a pretty good how to for this shift register on the main site:
http://www.arduino.cc/en/Tutorial/ShiftOut
"It's Dr. Evil. I didn't spend six years in Evil Medical School to be called 'mister,' thank you very much."

CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

NI$HANT

What MM of LED are you using?
"Real Men can Accomplish  Anything"

- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੁਂ!

Paranemertes

@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?
"It's Dr. Evil. I didn't spend six years in Evil Medical School to be called 'mister,' thank you very much."

CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up