Can you drive multiple leds with a single resistor? - Page 1
Forum section: electronics / general

author: MrOmnos
author_rank: Frequent Contributor
timestamp: January 26, 2018, 04:47:17 pm
content: So, If I my microntroller had 100 pins I could control , and I was multiplexing so that only one led was turned on at any given time and used a single resistor at the GND of all the resistors, would it work? And would I need a power supply for the leds?

author: Brutte
author_rank: Frequent Contributor
timestamp: January 26, 2018, 05:26:04 pm
content: For driving a led from IO you need to apply a certain voltage accross it for the light be intense enough. A blue led is in kind of 3.4V range for normal operation, a red one typically 1.5V etc. An ultraviolet one is 3.5V or higher I think. If you apply 1V accross red led then it won't work bright enough to be satisfactory, you may not notice it at all (although it would still emit some tiny-tiny amount of light at 1V) as it has exponential characteristics of i(u), just as most of the diodes.The intensity is linearly proportional to the current, not voltage.Now, a led does not care where the anode or the cathode lies with respect to uC's GND. It only cares about its A-K difference in voltage. So it might be 101V anode and 100V cathode (w.r.t. uc gnd) and still no dice as the difference is only 1V which is too low for most leds (unless it is IR led).Mind that a regular 0603 led works 100k hours at 20mA currents and ~100us at 20A so I suggest never letting it exceed that rating (unless it is your intention to make one intense blink with it).Quote

author: MrOmnos
author_rank: Frequent Contributor
timestamp: January 26, 2018, 06:00:39 pm
content: Hi! This configuration is what I am taling about.If one pin is turned on at a time, the MC is going put 5v across the led connected to that pin and the single resistor only. So, the resistor is going limit the current. In theory I should be able to drive leds with a single resistor without requiring a separate power supply for the leds porvided that I am turning on only one of them at any given time.

author: rdl
author_rank: Super Contributor
timestamp: January 26, 2018, 06:20:41 pm
content: Yes, that will work.I've done it during development with 7 segment displays for quick testing. The only problem there is that the brightness differs depending on how many segments are lit. Since you will only light one LED at a time that won't be a problem.

author: edavid
author_rank: Super Contributor
timestamp: January 26, 2018, 06:36:29 pm
content: Of course you can. You don't even have to limit it to 1 LED at a time if you PWM the LED drive to keep the brightness constant.

author: Benta
author_rank: Super Contributor
timestamp: January 26, 2018, 06:52:33 pm
content: Of course you can. As you say, you'll only turn on one LED at a time, some there'll be no brightness problem or other issues.

author: Brutte
author_rank: Frequent Contributor
timestamp: January 26, 2018, 06:55:35 pm
content: QuoteWhat you show is a direct drive, not multiplexing. With N = 100 IOs:-Direct drive allows controlling N leds = 100-With multiplexing you would get (N/2)^2 = 2500-With charlieplexing you would get N*(N-1) = 9900

author: MrOmnos
author_rank: Frequent Contributor
timestamp: January 26, 2018, 07:01:40 pm
content: Quote from: Brutte on January 26, 2018, 06:55:35 pmI know what multiplexing is but Someone on another thread said, POV is also called multiplexing so I used the term. I stand corrected. But even if I multiplexed I think it should work. I just wanted to know if it would work. Thanks!!

author: soubitos
author_rank: Frequent Contributor
timestamp: January 26, 2018, 10:45:40 pm
content: It will work just fine with 1 LED lit at a time... it will also work the same way if more than one LEDs are lit at a time provided your resistor can handle the power!

author: Nusa
author_rank: Super Contributor
timestamp: January 26, 2018, 11:20:19 pm
content: Quote from: soubitos on January 26, 2018, 10:45:40 pmIncorrect. Ohms law still applies to the circuit, and parallel LED's will share the available current. Try it on a breadboard if you need to convince yourself. It's a simple experiment.

author: Brumby
author_rank: Unknown
timestamp: January 26, 2018, 11:26:40 pm
content: Quote from: Nusa on January 26, 2018, 11:20:19 pmAnd odds are that theywon'tshare the currentequally.

author: soubitos
author_rank: Frequent Contributor
timestamp: January 26, 2018, 11:47:10 pm
content: What are you talking about? Who said anything about PARALLELED LEDS?I thought we were talking about driving x amount of LEDs from DIFFERENT pins of said uC or any other IC for that matter..... 1 LED drawing 10mA@2V driven from 5V source means you need a 300ohm resistor capable to dissipate 0.03W. 2 LEDs drawing each 10mA@2V driven from two 5V sources means you need a 300Ohm resistor capable to dissipate 0.06W etc... not?

author: Brumby
author_rank: Unknown
timestamp: January 27, 2018, 12:11:54 am
content: You are relying on each of the outputs from the pins having some amount of internal resistance that is going to compensate for the slightly different Vfof each of the LEDs - since the common resistor is going to provide a single voltage drop. It's not quite as bad as directly paralleled LEDs, but it doesn't quite sit well with me.Also, such a design will need to ensure that if you choose a resistor for 2 LEDs being on, then you had better make sure that there are always exactly 2 LEDs on (or none). If not, then you had better have worked out what is a safe number of LEDs to have on for the resistor chosen.

author: soubitos
author_rank: Frequent Contributor
timestamp: January 27, 2018, 12:17:51 am
content: Quote from: Brumby on January 27, 2018, 12:11:54 amI never say DO IT did i? LOLActually, if you parallel LEDs you still need smaller resistor value AND one capable to dissipate more power so.....

author: Brumby
author_rank: Unknown
timestamp: January 27, 2018, 12:24:28 am
content: ... and what happens if you choose a resistor for 5 LEDs - and then only have 1 LED on?But it's all good discussion.

author: Nusa
author_rank: Super Contributor
timestamp: January 27, 2018, 12:30:48 am
content: Quote from: soubitos on January 26, 2018, 11:47:10 pmYou might have a point if you truly had separate sources. However, microprocessor pins are almost always supplied from the SAME source. I agree it's not quite the same as a simple switch, but it's close enough.The flip side of the circuit might be more obvious. What if the pins were used as sinks instead of sources and the resistor were the only path to 5V? Would you assume the sinks were to different grounds or to a common ground?

author: soubitos
author_rank: Frequent Contributor
timestamp: January 27, 2018, 12:59:27 am
content: Quote from: Brumby on January 27, 2018, 12:24:28 ampffffffffsssssszzzzzzttttt and smoked salmon!