24 RGB LED's with PWM, to use Multiplexers or Shift Registers?

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Hey guys! Been awhile, how's it going?

I'm working on a project, making a watch, and looking to use 24 RGB LEDs and a MCU, probably MSP430

Usually I would jump on some shift registers, but I'm looking for the highest viewing pleasure per energy consumption bang for my buck, so I'm trying to decide which is better, multiplexing or shift registers or some other scheme, and not finding a lot of help online. Viewing pleasure concerns would be things like errant flickers, nice high refresh rate, PWM for adjustable brightness, etcetera. Easy to code is a bonus.

Any ideas?

Thanks!
 

GopherT

Joined Nov 23, 2012
8,012
Hey guys! Been awhile, how's it going?

I'm working on a project, making a watch, and looking to use 24 RGB LEDs and a MCU, probably MSP430

Usually I would jump on some shift registers, but I'm looking for the highest viewing pleasure per energy consumption bang for my buck, so I'm trying to decide which is better, multiplexing or shift registers or some other scheme, and not finding a lot of help online. Viewing pleasure concerns would be things like errant flickers, nice high refresh rate, PWM for adjustable brightness, etcetera. Easy to code is a bonus.

Any ideas?

Thanks!
Welcome back.

It all depends on the chips you plan to use. Anything over 100 Hz is flicker free. LEDs can pulse very fast and over-driven to get a good persistence of vision with very low duty cycle (depending on how many LEDs are multiplexed) Pwm is best done with creative timing on the multiplex timing so you can use the same pin for multiplexing as dimming/brightness control. If you overlay an PWM scheme on your multiplexing scheme, there are possible issues with aliasing and additional circuitry.

Maybe a bit more info on LEDs and power requirements (current draw and battery amp hours and expected battery lifetime).
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Thanks Gopher
I haven't chosen any chips yet, the only thing i have in mind is an MSP430 running the show, because they're nice and low power

LED's i was just thinking surface mount RGB, battery my hope was for a standard watch coin cell, like a CR2032, which average about 200mah.
For lifetime, i was hoping, via MSP430, low power Bluetooth chip, and only having the LEDs on for a few seconds when needed, i could get at least a few months on a battery
 

John P

Joined Oct 14, 2008
1,839
Hold on there--you say, "making a watch"? I don't think the techniques you'd need to assemble something that small are usable by a hobbyist. Not without some specialized stuff and experience in using it. A clock would be an easier thing to build.
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
I run the advanced instrumentation lab in the EE department at Purdue, i regularly use the pick n place, infrared rework, reflow oven, xray inspection, etcetera

Also, not sure what you mean, I've done more than a few QFN uCs and 0402 parts by hand with just paste and a hotplate, it's not that hard with some practice (and a microscope)
 

John P

Joined Oct 14, 2008
1,839
You say "pick n place, infrared rework, reflow oven, xray inspection, etcetera", plus "some practice (and a microscope)".

Like I said, "specialized stuff and experience in using it". Some people do have it.
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Yes, Sorry, the 2 points I had in my post were
1, Thanks for the advice, but I have the stuff and skills :)
2, I wish hobbyists in general were less scared of surface mount, it opens a lot of neat doors.

In any case, Gopher recommended multiplexing, does anyone have any recommendations for where to research using multiplexer chips for this type of application? My searches keep leading me to instructables about arduinos and shift registers. :p

If I was going with shift registers, I'm thinking I'd grab something from this family to make use of the constant current drive - http://www.ti.com/product/TLC5916

Also just noticed the terrible typo in the thread title, changing that now :p
 

AnalogKid

Joined Aug 1, 2013
8,608
In round numbers. shift registers have outputs that are active all the time (assuming no tri-state for individual outputs, while multiplexing is, well, multiplexing. So without more detail, a mux wins the power budget battle, at the cost of more complex code, possible visual artifacts, etc.

Are the 24 LEDs segments of 7-bar displays? If not, why 24?

ak
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
24 because it's 2 per hour, or 1 per hour on a 24hr clock, and actually probably 28 or more including notification LEDs

attached is a hastily drawn schematic/timing diagram of what I'm thinking for a plan that uses shift registers. The ones I'm looking at have an Output Enable pin, so they are not on all the time http://www.ti.com/lit/ds/symlink/tlc5917.pdf

I've never worked out a display scheme using demuxes, but I would think something similar, except probably with the multiplexers on the high side and color switches on the low side (from what I've seen of demux datasheets so far they usually don't sink much current?).
I haven't seen any constant current demuxes though, so they would require external resistors, unless anyone knows of any good chips?

I think I can see how the demultiplexers may have an advantage, because they should need ~32x less clock cycles to output each color, but I can't tell how much more complicated they will make the code.

What problems do you more experienced guys see? IMG_20160320_163310[1].jpg
 

GopherT

Joined Nov 23, 2012
8,012
24 because it's 2 per hour, or 1 per hour on a 24hr clock, and actually probably 28 or more including notification LEDs

attached is a hastily drawn schematic/timing diagram of what I'm thinking for a plan that uses shift registers. The ones I'm looking at have an Output Enable pin, so they are not on all the time http://www.ti.com/lit/ds/symlink/tlc5917.pdf

I've never worked out a display scheme using demuxes, but I would think something similar, except probably with the multiplexers on the high side and color switches on the low side (from what I've seen of demux datasheets so far they usually don't sink much current?).
I haven't seen any constant current demuxes though, so they would require external resistors, unless anyone knows of any good chips?

I think I can see how the demultiplexers may have an advantage, because they should need ~32x less clock cycles to output each color, but I can't tell how much more complicated they will make the code.

What problems do you more experienced guys see? View attachment 102771

I don't mean to completely change your project but, have you considered a 4-character of 5x7 LED with SPI interface. The camera doesn't do it justice. The camera adds a bunch of glare.
image.jpg
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
That's neat, not what I'm looking for though
Where'd you get it?

My inspiration for this project is my binary watch, but add bluetooth so it can display smartphone notifications.IMG_20160320_173613[1].jpg
 

dannyf

Joined Sep 13, 2015
2,197
Both approaches will work.

You will need 1 shift register + 3 io pins, or 2 shift registers (configured as a matrix) to do this. In the first case, you will need a total of 6 io pins (3 to drive the shift register and 3 to drive the lines), and in the 2nd approach, just 3 io pins.

The use of a shift register allows the mcu to be a small one, but your shift registers will take up additional real estate.
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
I uploaded a couple schematics of what I'm thinking, one for demultiplexers, and one for shift registers
(excluding minutiae, and with 16 led's for simplicity, but I would like to have the ability to expand to 24 or 32 or more if necessary)

I think I could make either work, but my primary concern is power consumption and ease of making efficient code
Number of pins isn't really a concern (I say with far too much confidence :p)

Any advice on which is the better design decision to make at this point?

Thanks
demux.PNG shift.PNG
 

GopherT

Joined Nov 23, 2012
8,012
I would use a 74HC154 (16-bit rather than 8-bit per chip) if you are trying to minimize current draw. Even less might be possible if you find a Microcontroller with enough pins.
 

Sensacell

Joined Jun 19, 2012
2,598
That's 72 channels of LED Drivers. (RGB * 24)

Using simple shift registers would be too slow to do individual PWM at any reasonable rate.

Use 6 X 16 channel LED sign driver chips- like the MBI5031 these do everything for you:
1) Constant current
2) 12 bit PWM (set and forget)
3) simplified wiring- run the whole thing from one SPI port.
4) less parts- no dropping resistors, etc.
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
That's 72 channels of LED Drivers. (RGB * 24)

Using simple shift registers would be too slow to do individual PWM at any reasonable rate.

Use 6 X 16 channel LED sign driver chips- like the MBI5031 these do everything for you:
1) Constant current
2) 12 bit PWM (set and forget)
3) simplified wiring- run the whole thing from one SPI port.
4) less parts- no dropping resistors, etc.
I agree about it being too slow, I was looking at the timing and thinking I would be pushing it.
I like the chip, but power consumption and size seems a bit big for the desired application. (2W!) Definitely remembering that one for future projects though.

I would use a 74HC154 (16-bit rather than 8-bit per chip) if you are trying to minimize current draw.
Thanks!
I think I've decided I'm definitely leaning demuxes, they look much easier to get a higher refresh rate, less time per PWM cycle, translating to more efficiency since pins isn't the issue.
Even less might be possible if you find a Microcontroller with enough pins.
Less current draw? Do you mean like a 6 to 32 demux or something?

[EDIT]
I've also been thinking, is there a good way to do PWM of each LED individually, rather than the entire array? Just brute force add cycles?
 

GopherT

Joined Nov 23, 2012
8,012
I agree about it being too slow, I was looking at the timing and thinking I would be pushing it.
I like the chip, but power consumption and size seems a bit big for the desired application. (2W!) Definitely remembering that one for future projects though.


Thanks!
I think I've decided I'm definitely leaning demuxes, they look much easier to get a higher refresh rate, less time per PWM cycle, translating to more efficiency since pins isn't the issue.

Less current draw? Do you mean like a 6 to 32 demux or something?

[EDIT]
I've also been thinking, is there a good way to do PWM of each LED individually, rather than the entire array? Just brute force add cycles?
I would change the PWM to the various enable pins depending on the address value.
 

GopherT

Joined Nov 23, 2012
8,012
So you're thinking one cycle for each LED then? Lighting them up one at a time? (as far as the code is concerned)
The 74HC138 and the '154 are decoders/demultiplexer that are addressable with only one pins at a time. I am not clear if you are lighting LEDs or characters. You could multiplex for each character and PWM the brightness if each character with a pass transistor if you have a common anode display (or wire individual LEDs as a common anode). All options are possible.
 
Top