User avatar
ameador1
Posts: 89
Joined: Fri Feb 22, 2019 5:43 pm
Location: Eastern - USA

Multiple LEDs - series, parallel, both?

Thu May 02, 2019 4:32 pm

Ok. so I have gotten to the point where I'm trying to do my overall design with LEDs. I am happy with the LEDs I'm using right now with 3.3KΩ resistors - they are bright enough like that and are using less than 1mA like that. My project will in total now have 22 LEDs. But I have ran into a case where I want some of them running in series - but I think in overall design effect - they are also running in parallel - which from my testing so far and from what I've read is a bad idea (parallel). So I need help understanding what is doable and what isn't.

Here's a sketch that I think will help:
Image

I have seen similar designes to the left circuit for powering LEDs from another PSU so the power draw is not comming from the Pi to run the LEDs. In my particular case - I assed the second LEDs in series on the 3 GPIOs. I have a scenario that really needs to have 2 LEDs in series as they will be at opposite ends of a cable and are inidcators of an active link and of activity on the line (in fact they are LEDs built into RJ45 sockets I'm putting on a main board and daughter board). So, I have done testing with series LEDs like this. My concern is - with a single 3.3KΩ resistor/LED pair - I am getting the current down to less than 1mA on the 3.3V GPIOs - which leaves plenty of mA on the GPIO to run multiple LEDs - BUT - when I put 2 LEDs in series - even with no resistor - they are very dim. Too much Vd on the LEDs? So, then I think - use parallel - feed them the same voltage going in, but then the issue with them pulling power more than one another and that doesn't work. Am I missing something here on how to do this when I have plenty of mA od current left on a GPIO?

Also, based on the sketch - if you take out all the components on the left - GPIO, optocoupler, etc... and simplyfy the net circuit after the GPIOs are turned on - do you not end up with the circuit on the right? And, if so, that is a parallel circuit. What's going on here? Why is it that in one case parallel is bad - but then these circuits are effecivly still a parallel circuit? Is it that the LED pairs have their own resistor connected to the +5V so this balances it - or this this overall still wrong?

This is what I would like to do:
Image
"When money ceases to be the tool by which men deal with one another, then men become the tools of men. Blood, whips and guns–or dollars. Take your choice–there is no other..."
- Ayn Rand - Atlas Shrugged

User avatar
ameador1
Posts: 89
Joined: Fri Feb 22, 2019 5:43 pm
Location: Eastern - USA

Re: Multiple LEDs - series, parallel, both?

Thu May 02, 2019 4:39 pm

Oh - and the resistors in the schematic at the bottom - are just random values - I would still be interested in keeping resistance as high as possible - so long as the LEDs are bright enough. In reality the LEDs on the left (in the pair) are on an RJ45 socket and the LEDs on the right are on another RJ45 socket with up to 25' of CAT5e cable between these LEDs.
"When money ceases to be the tool by which men deal with one another, then men become the tools of men. Blood, whips and guns–or dollars. Take your choice–there is no other..."
- Ayn Rand - Atlas Shrugged

Brandon92
Posts: 775
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Multiple LEDs - series, parallel, both?

Thu May 02, 2019 4:59 pm

First of all, why are you not using a i2c isolator (for example iso1540*). Then you can use the MCP on 5V and connect the leds direcly to the MCP without all the optocoulers.

When you connect all the LED's in parallel with one resistor. Lets say you have 10 leds in parallel and each led is designed to get 1mA. This means that there is 10mA in that single resistor and that is not the problem in this case. The problem is the LED itself. Because some leds have a Vf of 1.7V and another 1.6V and another has... This means that there are leds that will see more than 1mA. So, one led could be brighter than the others.

And when you connect them in parallel with each string with a resistor. The current is more or less the designed current and it is saver for the leds itself. And how much stings you can connect to one power supply, it will depants om what that power supply can deliver safely.

*first one I found on google

User avatar
ameador1
Posts: 89
Joined: Fri Feb 22, 2019 5:43 pm
Location: Eastern - USA

Re: Multiple LEDs - series, parallel, both?

Thu May 02, 2019 6:13 pm

Brandon92 wrote:
Thu May 02, 2019 4:59 pm
First of all, why are you not using a i2c isolator (for example iso1540*). Then you can use the MCP on 5V and connect the leds direcly to the MCP without all the optocoulers.
Ahh. hadn't noticed that the MCP23017 could fully run on 5V. So here's the modification:
Image

So, to the LED issue - I understand the reason why the LEDs in parallel is a problem - BUT maybe what I'm trying to clarify is - if each chain in the parallel circuit has a current limiting resistor - does that make using the LEDs in parallel ok? Is it only when trying to use a single resistor before all the parallel chains that it is an issue? Or is it always an issue?

Assuming I use the proper sizes resistor in this circuit - is this ok? If I cannot get enough power to the LEDs to run them all - what would be my other options. Can I stay with 5V and get a higher amp PSU, or would I need to go to a higher voltage?

If parallel with a resistor per chain is Ok, then could I do this and work:
Image

This 3.3KΩ/LED combo is drawing less than 1mA - so this would only be using <4mA and would drive the LEDs evenly? I mean I know there will always be slight variation between LEDs - but this will not cause catastrophic LED failure - right?
"When money ceases to be the tool by which men deal with one another, then men become the tools of men. Blood, whips and guns–or dollars. Take your choice–there is no other..."
- Ayn Rand - Atlas Shrugged

User avatar
ptimlin
Posts: 88
Joined: Tue Jan 08, 2019 7:44 pm

Re: Multiple LEDs - series, parallel, both?

Thu May 02, 2019 7:36 pm

Just a few random observations that might answer some of your questions (I didn't carefully read everything you wrote so sorry if I am "answering" something you didn't ask.

With the very first photo you are using PC817 opto couplers. The first mistake most of us make when we started to use these types of devices is we assume you just turned on one side and the other side turned on as well. Well kind of. Opto couplers have a specification called "current transfer ratio" where the output's current ability is directly linked to the input current you drive the LED with. In the case of the PC817...
"Current transfer ratio (CTR : MIN. 50% at IF=5 mA, VCE=5V)"
which essentially means they only guarantee a minimum of half the current on the output as you put into the input for a test current of 5mA in. Or put another way, they are saying if you put in 5mA then they promise you will be able to get at least 2.5mA out the other side.

In your drawing you are inputting 3.3V/1k = 3.3mA. While you designed the other side to draw (supply voltage minus the two diode drops divided by the 220 resistor; let's call the Vf of each LED 2V to make the math easy) 1/220 = 4.5mA. But your opto coupler is only promising you 1.65mA out.You might get more but you are probably not getting near the 4.5mA you thought.

As to the parallel LEDs, if you parallel LEDs directly (cathodes tied together and anodes tied together) then what happens is the ones with the lowest Vf wins and the others do not turn on. LEDs essentially clamp the voltage across the whole parallel bunch at the lowest Vf. So if you have 3 LEDs with Vf of 1.8V, 2.0V, and 2.1V, then the one at 1.8V starts to conduct first and now the voltage is clamped there. The other two never see enough voltage for them to turn on (you have to get above 2.0 and 2.1 for the other two to turn on).

Your suggestion of in parallel but with a resistor on each leg is the correct way to do it.

boyoh
Posts: 1342
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Multiple LEDs - series, parallel, both?

Sun May 05, 2019 9:29 am

ameador1 wrote:
Thu May 02, 2019 4:39 pm
Oh - and the resistors in the schematic at the bottom - are just random values - I would still be interested in keeping resistance as high as possible - so long as the LEDs are bright enough. In reality the LEDs on the left (in the pair) are on an RJ45 socket and the LEDs on the right are on another RJ45 socket with up to 25' of CAT5e cable between these LEDs.
I appreciate your dedication to your project, But I think there
Are more easier ways to proving your project working ability
First some test bench work is needed to find some working
Paramiters of the components you will be using Voltage and
Current, The testing of LEDs in series And parallel to select
The correct resistance for it to work within in its correct working
Load...So some breadboard work is needed using a multemeter
And a very stable power supply

Regards BoyOh
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

User avatar
ameador1
Posts: 89
Joined: Fri Feb 22, 2019 5:43 pm
Location: Eastern - USA

Re: Multiple LEDs - series, parallel, both?

Sun May 05, 2019 1:46 pm

ptimlin wrote:
Thu May 02, 2019 7:36 pm
Just a few random observations that might answer some of your questions (I didn't carefully read everything you wrote so sorry if I am "answering" something you didn't ask.
Sorry for not replying earlier... I wrote up a nice reply - and the page failed to submit and lost it! I hate when that happens!

So, in short - thank you for your time and constructive comments. Some of it I was aware of but some was helpful :)

The project is progressing!

Thanks again!
"When money ceases to be the tool by which men deal with one another, then men become the tools of men. Blood, whips and guns–or dollars. Take your choice–there is no other..."
- Ayn Rand - Atlas Shrugged

Return to “Beginners”