Go Down

Topic: Where to start with multiplexing? or bit addressing? (Read 7879 times) previous topic - next topic

xl97

Oct 24, 2011, 09:33 pm Last Edit: Oct 25, 2011, 06:51 pm by xl97 Reason: 1
I believe in order to control large amounts of LEDS...

you need to 'multiplex'?  or use shift registers (or something?)

Is there any BASIC tutorials or articles on getting into this?

I am 'not' looking for advanced articles.. where they throw out chip acronyms used..etc..  (as that would mean nothing to me)

simple parts lists.. and an overview of the topic and implementation wold be great!

questions:

Is there a limit of the number of LEDS you can individually control/address?  (is this based on the shift register chip of choice?)

is multiplexing the 'word/verb' of this action? (driving multiple leds)  and shift register is a physical component to be used 'in' multiplexing?

Thanks

if I had say 3 leds I wanted to control with ONE pin.. where does one start?  (I know you can use 3 separate pins....but wanted to use 3 leds to keep confusion low when talking about multiplexing on one pin)


also Im assuming that if one wanted to 'multiplex' with RGB leds..you would use 3 pwm pins..

thanks

funkyguy4000

http://igen.eetimes.com/multiplexing-leds-tutorial.html

WHOO!

Edit: Okay that may be a little more advanced then you may be looking for.  I"ll keep looking
Accelerate to 88 miles per hour.

Grumpy_Mike

To understand the principals try this:-
http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html

For a 4 by 4 example of an RGB Matrix look at this:-
http://www.thebox.myzen.co.uk/Hardware/Mini_Monome.html

Finally for an 8 by 8 matrix try this:-
http://www.thebox.myzen.co.uk/Hardware/Hexome.html
It will also give you an indication of the amount of wiring involved.

CrossRoads

#3
Oct 24, 2011, 10:08 pm Last Edit: Oct 24, 2011, 11:25 pm by CrossRoads Reason: 1
I've described the process several times.

Say you have 16 LEDs, arranged as 4 rows and 4 columns.
You wire your matrix with 4 anodes in each column connected, and 4 cathodes in each row connected.
4 arduino outputs go to current limit resistors to the 4 anodes. Values selected so that 8mA can flow.
4 arduino outputs go to the cathodes.
Your data to be displayed is stored in a 4x4 array

Write a loop that does this:
start with all 4 anode outputs low, and all 4 cathode outputs high.
output the anode pattern for row 1, high will be On, data is from array row 1.
output a 0 for cathode output 1 for some number of mS, this will light up the LEDs. If 4 LEDs were on, the arduino would sink 32mA.
output a 1 for cathode output 1 to turn off the LEDs.

repeat for rows 2, 3, 4

check if the array needs updating

repeat the updates.

You can be smart about it, do a blink-without-delay loop, each pass thru loop see if your on time has elapsed, and if not check for other stuff that may have occurred and update the data array.

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.

xl97

tanks for the replies..

before I started reading the links..

coupdl questions to make sure Im on the same/correct path..

1.) this would be more STRIP related than 'MATRIX/CUBE'.... (for the project/demo).. does that matter? same principle applies?
2.) I didnt see any mention of shift registers?  and the comments mentioned using 8 x I/O pins from the Arduino? How do you save I/O pins and run.drive more leds from less/one pin?

1 I/O pin per 2 leds doesnt seem very 'convenient??

3.) what if the LEDS used need/require more than only 8mA?  more like to the normal 15-25 range?


the project/demo I had in mind is to play with an animated LED strip.. (well plain led strip..I want to animate it) LOL

same info above applies...yes?

Thanks again.. I'll check out links.. (and re-read what crossroads posted.. a few times!....lol)



Grumpy_Mike

Quote
1.) this would be more STRIP related than 'MATRIX/CUBE'.... (for the project/demo).. does that matter? same principle applies?

No, it is the same it dosn't matter how you physically arrange the LEDs.

Quote
I didnt see any mention of shift registers?

They are just one way of getting extra outputs, they are not essential.

Quote
1 I/O pin per 2 leds doesnt seem very 'convenient??

Sorry don't know what you are on about here.

Quote
what if the LEDS used need/require more than only 8mA?

You use LED drivers, direct connection to a shift register is a bit babyish.

xl97

Hello Grumpy_Mike-

thanks for the reply..


re: shift registers-

not essential..  ifyou wanted to drive/have more leds that you have I/O pins available.. then needed yes? or are you saying you can add more leds on 1 i?o pin of the Arduino?

In CorssRoads post..

he mentions using 4 pins (each) for Anode and cathode

Quote

4 arduino outputs go to current limit resistors to the 4 anodes. Values selected so that 8mA can flow.
4 arduino outputs go to the cathodes.


which essentially takes up 8 pins of the Arduino.. yes?
giving me a total of only 16 leds though.. yes?

ie: 2 leds per Arduino I/O pin?

for each row or column.. there needs to be another I/O pin on the Arduino used.. correct?

if you were using only 2 Arduino PWM output pins (1 for resistor >> anode) and (1 or cathode)..  you could only have 2 leds...correct?

So in this project/theory.. you would need to use a shift register chip....yes?  (which Im not against... except now I read you called it babyish!)  LOL..

which by that I think your saying not the best/most professional approach?  (for actually driving/powering the leds?..how would you otherwise do it? with that many leds?)   space IS a concern... would these drivers be needed for each led? or segment of led array?

sorry totally clueless about how one would go about wiring this all up?

my project will involve ALOT of LEDS..  IMHO..if I had to guess.. Id say 2 x separate strings of 40 leds each.. (80 total?)

these would be HB SMD leds.. (1206 footprint/package)....
not sure yet though.. might just be an odd 4mm HB oval leds I have laying around too)

Im assuming this is way to much for the Arduino to handle by itself....and would require an 'shift register'...?


thanks

Are there other (small) shift register chips out there besides the: 74HC595 that only gives (I think) 8 outputs for leds?



Grumpy_Mike

It is connecting LEDs directly to a logic shift register which is a bit babyish.

A shift register is only one way of getting more output lines from an arduino. There are lots of others. A TLC5940 is another good chip for driving LEDs and there are plenty of similar ones.

CrossRoads

Please explain what you mean by "animated LED strip"

This kind of thing?


Or this kind of thing?

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.

xl97

#9
Oct 25, 2011, 04:03 am Last Edit: Oct 25, 2011, 04:28 am by xl97 Reason: 1
it would be option A


just a 'plain strip' of leds...  that "I" animate myself through Arduino/code.

I suppose I would have to solder them myself...(make my own 'strip')

since Im currently un-sure of the space/length I'll need.. (either 1 long strip..or two separate strips)



*Im not sure if just doing one long 'string' of leds would be the best... (since I need to basically make a 'circle')..



if I can target any led at any time..  shouldnt matter if I kept it all 1 long string/array?  would it?

I dont have a clue on how to drive that many (external driver) but thats new to me more or less..(Grumpy Mike suggested something to look at I believe)

space is an issue as I'll be cramming this stuff into a mod'd toy more or less.. (in theory this is what Id be doing..  just talking about the stuff Id need to learn first!)  lol

thanks


CrossRoads

So you've got 18 LEDs, 20 I/O pins, space is tight: add 18 current limit resistors and drive them all directly.
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.

xl97

HI..

Im hoping to NOT use all/most of my I/O pins..

so it leaves room to do extra 'activities'...etc..

(which is why I was asking about shift registers..or adding the support to individually control/target leds using only a few pins.. or daisy chaining these 'shift registers')

Im thinking I'll need some sort os mess..more pins that just 2.. (to keep the amount of shift registers used as well)

reading some of the links provided..  Im actually looking forward to trying to play with the 0001010110 style of turning on/off leds..

is that referred to as 'matrix style'?


Grumpy_Mike

Quote
is that referred to as 'matrix style'?

No.
A matrix controls LEDs by columns and rows. This is just bit addressing.

xl97

ahh.. ok, so bit addressing is what I need to look into more..yes?

Also..(just for note]..  the 18 leds in the image above is just for visual..

there would be alot more I believe..  somewhere around 40-80 I believe..  (if two strips.. 40 each..if one lone strip 80 total I believe)

Anyone recommend or know of a good link to start reading up on this bit addressing?



Go Up