Help Needed_ Interfacing 5 RGB Leds using minimum microcontroller Pins

Thread Starter

mishra87

Joined Jan 17, 2016
536
Hello All,

I want to interface 5-RGB using minimum MCU pins. Means I have total 15 leds to interface.

So could anybody suggest me any solutions or approach to do this.

Thanks in Advance !!!
 

djsfantasi

Joined Apr 11, 2010
5,600
What MCU are you using and what else is it doing?

Brute force multiplexing could reduce the needed pins almost in half. 8 pins instead of 15.

With additional circuitry, you could cut 5 of those pins to 3 bit it hardly seems worth it.

With an external shift register, you could get it down to two or three pins.

There are many options. But we need to know what these five RGB LEDs are used for, what the MCU is doing and what other resources and/or restrictions you have.
 

be80be

Joined Jul 5, 2008
1,930
kind of hard to Charlieplex RGB leds seeing they have common anode or cathode.
Now if its 3 leds then it's doable
 

jpanhalt

Joined Jan 18, 2008
7,894
For common cathode: https://forum.43oh.com/topic/1718-controlling-4-rgb-leds-with-minimal-components/?page=2

I think the bigger problem will be to have them all on at the same time. Rapid on/off cycles could give that appearance. My comment was not meant so much as a solution but to round out djsfantasi's list, and most important, to give the TS some background reading. If the TS is pin limited, then he/she may want to consider other solutions or redefine the criteria.
 

djsfantasi

Joined Apr 11, 2010
5,600
For common cathode: https://forum.43oh.com/topic/1718-controlling-4-rgb-leds-with-minimal-components/?page=2

I think the bigger problem will be to have them all on at the same time. Rapid on/off cycles could give that appearance. My comment was not meant so much as a solution but to round out djsfantasi's list, and most important, to give the TS some background reading. If the TS is pin limited, then he/she may want to consider other solutions or redefine the criteria.
Depends on what the LEDs are being used for. Without that information. I’m leaning towards the shift register solution. One clock pin and one data pin may be all that is required. Depending on the particular shift register, you may need a latch pin.

Using shift registers, the LEDs will always be on except for a brief period when an LED changes state. That period won’t make a perceptible change in the output.

Using shift registers, at a small cost in processing time, the solution can be expanded to many LEDs. For this application, you only need two 8-bit registers, like the 74HC595
 

BobTPH

Joined Jun 5, 2013
2,024
I am talking about 5 RGB Leds .
1 RGB means - 1 Red , 1 - Green , 1 - blue

So total 15 Leds

And 5 Leds can be turned ON at a time.
I understand that. The WS2812 is an RGB LED that contains a chip to control it on the same die.

You can control 1 or 5 or 500 of them with a single signal.

You asked how you can control 5 RGB LEDs with a minimum of pins. And I gave you the answer. Unless someone comes up with a solution that uses no pins, this is the best answer.

Bob
 

dendad

Joined Feb 20, 2016
3,006
I too add a vote for the WS2812 solution.
Nothing else to add, and full colour and brightness control, all on one pin.
Plenty of example on the Internet showing how to drive them.
 

djsfantasi

Joined Apr 11, 2010
5,600
Sometimes we get caught up in the question (with its concomitant assumptions) rather than an appropriate answer.

I also vote for the WS2812 solution.
 

danadak

Joined Mar 10, 2018
3,577
Are you concerned about package size, eg. # I/O available in smallest
package ? If so what technology packages can you handle ? Can you
handle BGA, WLCSP .....?

How many GPIO do you need besides the LED drive GPIO ?


Regards, Dana.
 
Top