Go Down

Topic: How can I effectively drive multiple LEDs with multiplexing? (Read 359 times) previous topic - next topic

saftysign

I am interfacing my microcontroller (AVRmega32U4) to a 4x4 LED array. There are 2 control lines to operate columns (passed to a 2 to 4 demultiplexer) and 4 control lines to operate rows. I bring a column high and a row low to illuminate a specific LED. I pull either the column low or the row high to turn off an LED.

This design works fine for around up to 4 LEDs at once. However, when I try to light all 16 at once with this strategy, the LEDs are noticeably less brighter (they're on a 1/16 duty cycle after all!).

What are some ways to more effectively light larger numbers of LEDs in this array? Say, 10+?

I am considering writing a lot of code to handle the different situations, but that will consume more space on my microcontroller than I am comfortable with. I was considering adding another micro with 16 control lines to manage these LEDs, one at a time, but this seems like a lot of overhead to introduce.

I could not upload the image


Grumpy_Mike

Quote
I am considering writing a lot of code to handle the different situations,
Don't do that. Use the method everyone else does and have a memory buffer and just display that. Then all you need to do is to write the appropriate numbers into the memory to get any display.
See http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html

bos1714

This design works fine for around up to 4 LEDs at once. However, when I try to light all 16 at once with this strategy, the LEDs are noticeably less brighter (they're on a 1/16 duty cycle after all!).
Could it be possible that there isn't enough power for all 16 at once?
Time line? Time isn't made out of lines. It is made out of circles. That is why clocks are round.

Grumpy_Mike

Yes but you never have all 16 on at once. That is what multiplexing is all about, you have a maximum of four LEDs on at any instant.

Shuzz

There are 2 control lines to operate columns (passed to a 2 to 4 demultiplexer) and 4 control lines to operate rows.
Then you should have a 4:1 multiplex, which should actually be bright enough, even with crappy LEDs.
You really should follow Grumpy_Mike's advice and reserve a memory buffer to control which LEDs are on, then offload the display to some timer interrupt and be done with it.

Also, read the link that Mike posted carefully and try to understand how a LED matrix actually works.

Alternatively, if this all proves too hard for you to implement, you could consider using dedicated drivers like the TLC5916 or some such. No shame in that, and it would definitely solve your brightness "problem"... ;-)

Go Up