Can I ground 3 LEDs through the same current limiting resistor?

Thread Starter

zirconx

Joined Mar 10, 2010
171
I'd like to be able to turn on 3 different LEDs from my raspberry pi. Due to limited space on my perf board, I'd like to ground all 3 of them through the same current limiting resistor. My plan is to use pins 16,20,21 for the anodes and connect the cathodes through a single resistor to the nearby ground pin. Will that work ok? Assuming I'm only passing 5ma on each one, 15ma (.05W) through the single resistor should be fine?

Would one turning on affect the brightness of one that was already on?
 

Attachments

Last edited:

Ylli

Joined Nov 13, 2015
1,086
That will only work if you are turning one and only one on at a time. Otherwise, brightness will vary depending on whether there are one, two or three turned on.
 

WBahn

Joined Mar 31, 2012
29,979
I'd like to be able to turn on 3 different LEDs from my raspberry pi. Due to limited space on my perf board, I'd like to ground all 3 of them through the same current limiting resistor. My plan is to use pins 16,20,21 for the anodes and connect the cathodes through a single resistor to the nearby ground pin. Will that work ok? Assuming I'm only passing 5ma on each one, 15ma (.05W) through the single resistor should be fine?

Would one turning on affect the brightness of one that was already on?
This is pretty suboptimal, but sometimes ya gotta do what ya gotta do.

You will want your LEDs to be as well matched as you can get them. You definitely need to avoid using different colors as that will almost certainly not work at all.

Assuming they are perfectly matched, the current in them will vary by a factor of three depending on how many are on. However, humans are pretty insensitive to changes in brightness of a factor of two or so, hence this might be acceptable. Due to residual mismatch your actual variation in current will likely be somewhat more than a factor of three. You would need to try it to see if it is tolerable.

In theory, another issue you might face is thermal runaway in which one LED would end up hogging all of the current. But at the current level you are talking about it probably would not be a problem. If it were an issue, where you would likely encounter it is when one LED has been on for a long time (long enough to stabilize at a warmer temperature) and then you try to turn on another LED. The cool LED might have a sufficiently higher forward voltage as to not light up or to take a noticeable time to do so.
 

Analog Ground

Joined Apr 24, 2019
460
Software Solution to the One Resistor Question

An off-the-wall idea is to do it with software. Three GPIO outputs go to the three LED anodes. Three cathodes are tied together and go to ground through ONE resistor. Output a high signal to one of the LEDs while grounding the other two outputs. This lights one LED only. The other LEDs do not draw current because they are reversed biased. After about 10 milliseconds, ground that output and go to the next LED which needs to be on and output a high signal on that LED. Sequentially and repeatedly go through all the LEDs which need to be on. Switching every 10 milliseconds. The LEDs are multiplexed in time. Do it fast enough (33 Hz in this example) and the LEDs appear to be on continuously. The current through an LED must be 3 times greater than if the LED was on all the time. However, the total power dissipated is the same since only one LED is on at a time. Don't exceed the maximum output current of the outputs. I told you it was off-the-wall.

Edit: Vary the brightness of each LED by changing the amount of time it is on. 10 msec, 9 msec, 8 msec, etc.
 

Thread Starter

zirconx

Joined Mar 10, 2010
171
How about LEDs with resistors inside the LED itself? https://www.sparkfun.com/products/14563
Yes those would work excellent! Thanks for the suggestion. However I don't want to spend $9 + shipping, I already have several hundred LEDs laying around here.

I might do something similar to those - cut the cathode very short and solder in a resistor in place of that lead. Like this picture I just found.
 

Attachments

ApacheKid

Joined Jan 12, 2015
1,533
I'd like to be able to turn on 3 different LEDs from my raspberry pi. Due to limited space on my perf board, I'd like to ground all 3 of them through the same current limiting resistor. My plan is to use pins 16,20,21 for the anodes and connect the cathodes through a single resistor to the nearby ground pin. Will that work ok? Assuming I'm only passing 5ma on each one, 15ma (.05W) through the single resistor should be fine?

Would one turning on affect the brightness of one that was already on?
Software Solution to the One Resistor Question

An off-the-wall idea is to do it with software. Three GPIO outputs go to the three LED anodes. Three cathodes are tied together and go to ground through ONE resistor. Output a high signal to one of the LEDs while grounding the other two outputs. This lights one LED only. The other LEDs do not draw current because they are reversed biased. After about 10 milliseconds, ground that output and go to the next LED which needs to be on and output a high signal on that LED. Sequentially and repeatedly go through all the LEDs which need to be on. Switching every 10 milliseconds. The LEDs are multiplexed in time. Do it fast enough (33 Hz in this example) and the LEDs appear to be on continuously. The current through an LED must be 3 times greater than if the LED was on all the time. However, the total power dissipated is the same since only one LED is on at a time. Don't exceed the maximum output current of the outputs. I told you it was off-the-wall.

Edit: Vary the brightness of each LED by changing the amount of time it is on. 10 msec, 9 msec, 8 msec, etc.
Yes multiplexing in this way will work well. Early calculators used very small 7-segment LED displays and this is how they did this.

 

Tonyr1084

Joined Sep 24, 2015
7,853
Can you power multiple LED's through a single ground resistor? Yes. But like others have said, they have to have the same forward voltage. The video attached is what happens when you ground through a single resistor. You'll see blue LED's and red LED's. When placed in parallel the red LED will make the blue LED go out. The red is hogging all the current. But with multiple blue LED's you can see over time how they get dimmer. I did this video as a test to see what would happen. Some of the numbers on current are a little off because I didn't subtract forward voltages. Doing LED's in parallel present an odd situation where (for me) calculating the current is confusing. Nevertheless, yes, you can power multiple parallel LED's through a single ground resistor.

 

Thread Starter

zirconx

Joined Mar 10, 2010
171
Done. You may notice from the photo that resistors are different, I used a 330ohm (I think) for the red LED, and a 100ohm resistor for the yellow and red. Those two were older LEDs (maybe made in Japan?) rated for 20ma. I'm passing 12ma through them with the 100ohm resistor.
 

Attachments

Last edited:
Top