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

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
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.
:facepalm:
Yep. duh. of course they are. brain fart.
:p:rolleyes:

And individual LEDs, not characters.

OK, so I think I have a plan here.
Now I just need to decide on a MCU and bluetooth chipset :p
 

hp1729

Joined Nov 23, 2015
2,304
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).
Maybe a CD4724 8-bit addressable latch. Each LED can be addressed directly.
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Maybe a CD4724 8-bit addressable latch. Each LED can be addressed directly.
If I read (skimmed) the datasheet right, it's like a demux, but it won't set an outback to zero until cleared? So over the course of a few cycles you can turn on more than one LED?
 

GopherT

Joined Nov 23, 2012
8,012
If I read (skimmed) the datasheet right, it's like a demux, but it won't set an outback to zero until cleared? So over the course of a few cycles you can turn on more than one LED?
That is how I read it, set the address, set the value, latch that address (pin), move on to another address. Could be used to set a character on a seven segment display. Although a bit tedious.

No chance to PwM the individual segments - as we were discussing earlier.
 

Sensacell

Joined Jun 19, 2012
2,774
Minimizing power consumption:

LED's are current fed devices- cannot get around needing lots of current to drive them brightly.
You can however minimize the power loss in the circuit by using the lowest possible LED supply voltage.

Low supply voltage makes using current limiting resistors difficult, slight changes in LED Vf make for big changes in LED current- crappy brightness matching.

Another win for the constant current driver chip, the on-chip current sink can operate with a few hundred mV of overhead, you can use the lowest possible voltage and still achieve great brightness matching.

The MBI5031 can DISSIPATE 2 W, but it's inherent power requirement is minuscule.
The dissipation is the total of the current per channel X the overhead voltage.

An entire industry has fought hard to develop an optimal solution to this problem, why not leverage it?
 
Last edited:

hp1729

Joined Nov 23, 2015
2,304
Minimizing power consumption:

LED's are current fed devices- cannot get around needing lots of current to drive them brightly.
You can however minimize the power loss in the circuit by using the lowest possible LED supply voltage.

Low supply voltage makes using current limiting resistors difficult, slight changes in LED Vf make for big changes in LED current- crappy brightness matching.

Another win for the constant current driver chip, the on-chip current sink can operate with a few hundred mV of overhead, you can use the lowest possible voltage and still achieve great brightness matching.

The MBI5031 can DISSIPATE 2 W, but it's inherent power requirement is minuscule.
The dissipation is the total of the current per channel X the overhead voltage.

An entire industry has fought hard to develop an optimal solution to this problem, why not leverage it?
Re: LED current
You don't have to drive the LED at full rated current if you don't need full brightness. 2 or 3 mA might be all you need to light the LED. Pulsed, PWM, maybe 10 mA depending on ambient light.
 

hp1729

Joined Nov 23, 2015
2,304
That is how I read it, set the address, set the value, latch that address (pin), move on to another address. Could be used to set a character on a seven segment display. Although a bit tedious.

No chance to PwM the individual segments - as we were discussing earlier.
Yes, PWM would require a lot of overhead. From his description of 24 LEDs I envisioned two sets of 12 LEDs for hours and 5-minute intervals (hour hand and minute hand). Using a shift register means shifting all 24 bits out every time. With the 4724 you only need to address the LEDs that indicate the current time.
I should have posted a data sheet.

(edited to add ...)
Example of a 24 LED clock, as described above, with single LEDs. Examples of PM dimming included.
 

Attachments

Last edited:

dannyf

Joined Sep 13, 2015
2,197
If I were you, I would budget the current consumption to see how feasible your plan is.

You may find a watch implementation isn't so realistic.
 

GopherT

Joined Nov 23, 2012
8,012
Minimizing power consumption:

LED's are current fed devices- cannot get around needing lots of current to drive them brightly.
You can however minimize the power loss in the circuit by using the lowest possible LED supply voltage.

Low supply voltage makes using current limiting resistors difficult, slight changes in LED Vf make for big changes in LED current- crappy brightness matching.

Another win for the constant current

You may find a watch implementation isn't so realistic.

I think an activation button to light the LEDs or a low power accelerometer that causes the LEDs to turn on when the wrist is tilted would allow a decent battery life when coupled with a few chips consuming micro amps in non-display times (when wrist is not at proper angle).
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
I think an activation button to light the LEDs or a low power accelerometer that causes the LEDs to turn on when the wrist is tilted would allow a decent battery life when coupled with a few chips consuming micro amps in non-display times (when wrist is not at proper angle).
My current watch has a 2 year battery life with 10LEDs, if i can get 20% of that I'll be very happy, i could live with 10% since I plan on making the battery easy to switch

It uses a button to wake up for 5 seconds

Later today I'll try to post some diagrams with sample LED patterns of what I'm thinking
 

GopherT

Joined Nov 23, 2012
8,012
My current watch has a 2 year battery life with 10LEDs, if i can get 20% of that I'll be very happy, i could live with 10% since I plan on making the battery easy to switch

It uses a button to wake up for 5 seconds

Later today I'll try to post some diagrams with sample LED patterns of what I'm thinking

I'm really hoping it looks like this....

 
https://www.adafruit.com/products/815?gclid=CLXyxO_D0ssCFZeEaQodwmUAog

Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface - PCA9685

"Using only two pins, control 16 free-running PWM outputs! You can even chain up 62 breakouts to control up to 992 PWM outputs (which we would really like to see since it would be glorious)" (330 RGB LED's!)

$14.95

I've used this in several projects, it's documented well and works great!

:) joe
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
I like the chip!
Didn't fully digest the datasheet, does it easily allow fade on/out? Or is it more set brightness and forget?

Attached the picture of what I'm thinking for the binary one
I like being able to do fade in/out patterns, especially the notification LEDs, but if it makes it a lot easier/more efficient to set brightness values very infrequently and just turn LEDs on and off I'm considering it

I already posted a picture of the other design, ring of rgb leds for time and sone in the center for notifications
 

Attachments

RichardO

Joined May 4, 2013
2,271
I think an activation button to light the LEDs or a low power accelerometer that causes the LEDs to turn on when the wrist is tilted would allow a decent battery life when coupled with a few chips consuming micro amps in non-display times (when wrist is not at proper angle).
A friend has a Nixie tube watch that does just that.
 

RichardO

Joined May 4, 2013
2,271
I am a minimalist. I would do it all with just a microcontroller. You do not need any shift register or latches.

The LED's are are going to be very small and the apparent brightness will be quite large so the drive current will be surprisingly small. I am guessing _way_ less than 1ma average per LED. To save more power, I would only have a maximum of 3 LED's on at any given time -- no fancy patterns. Maybe show the full pattern when the display first turns on and then quickly switch to fewer LED's.

If you choose a microcontroller with enough pins then you can directly drive the LED's from the port pins. I would do 3:1 multplexing. That is, 3 select lines -- one for each color -- and 28 shared lines -- 3 colors per line. I think a 48 pin part is probably enough. As much as an 80 pin part may be needed for the extra features such as an accelerometer. Don't forget to include pins to control power management of the power supply, sensors and the like.
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
I am a minimalist. I would do it all with just a microcontroller. You do not need any shift register or latches.

The LED's are are going to be very small and the apparent brightness will be quite large so the drive current will be surprisingly small. I am guessing _way_ less than 1ma average per LED. To save more power, I would only have a maximum of 3 LED's on at any given time -- no fancy patterns. Maybe show the full pattern when the display first turns on and then quickly switch to fewer LED's.

If you choose a microcontroller with enough pins then you can directly drive the LED's from the port pins. I would do 3:1 multplexing. That is, 3 select lines -- one for each color -- and 28 shared lines -- 3 colors per line. I think a 48 pin part is probably enough. As much as an 80 pin part may be needed for the extra features such as an accelerometer. Don't forget to include pins to control power management of the power supply, sensors and the like.
Hmm, actually never occurred to me, MSP430 pins can handle ~6mA so I always I assume I need a buffer. Worth a shot, it would indeed be the simplest and lowest power option since I'll probably have enough pins anyway.

For context...

Huh, I've actually never seen that movie. Would be a cool timepiece though :)
Always funny when super advanced aliens just use red LEDs :p
 

RichardO

Joined May 4, 2013
2,271
Top