I've searched around for this problem but couldn't find an answer. Sorry if this has been asked before. (I'm sure it has)
I have several LEDs that are each being powered by separate pins( the pwm and analog pins). Right now my code fades each led independently and I have tested it using a resistor for each LED and I have also tested it with one resistor for all LEDs. Both have had success. The LEDs are 100mA so I'm using a 50 ohm resistor.
Of course I'd rather just use one resistor but, I'm worried because I know if all LEDs were arranged in parallel then a single resistor would be a big no no, but if they are in series then its ok.
So, is this arrangement in series or parallel?
Here is a picture of the unfinished project. The resistor is in the heatshrink. I only have one LED installed so you'll have to use your imagination to visualize where the remaining LEDs would go.
This is a test project which is using different LEDs, but is pretty much what I want to do with the nano. It's setup with one resistor. Here is a video of the LEDs fading.
The LEDs are 100mA so I'm using a 50 ohm resistor.
That is not a 50 ohm resistor. It looks like a 150R which is probably what saves your Arduino pin.
and I have tested it using a resistor for each LED and I have also tested it with one resistor for all LEDs. Both have had success.
You are clearly using the word success in a meaning that I have hither to been unaware of. Or you have not tested correctly, or not understood what you have done or are not interpreting the results correctly.
So, is this arrangement in series or parallel?
It is nether each LED is connected to a separate pin so the LEDs are not connected together in either series or parallel.
Can you tell us where you got the LEDs from and how do you know they are 100mA?
IF you are only going to turn/fade each LED one at a time, in other wards you will never have more then one LED working at a time, you can use one resistor.
IF you are going to operate them so more than one at a time is working, then each LED needs its own resistor.
My advice, put a resistor on each LED so you you can do any combination of LED flashing.
TomGeorge - I just ordered some resistors. I'm gonna hook each LED up with one. Thanks for the info!
Grumpy_Mike - The green leds are just for testing which is why it's a 150 ohm resistor. If you watch the video you'll know what I meant by success! haha! Thank you.
I see now 40-50mA is the max recommended current for each pin.
No that is not the maximum recommended current, 40mA is the current that starts to cause damage and the data sheet warns that prolonged use of 40mA will cause damage. The specifications state 20mA and say any higher current will not work inside those specifications.
Note that some people misinterpret the maximum to mean it will supply no more where as it means should not be connected to anything that will draw over this current.
I wonder if the OP is getting confused by the peak current rating of 100mA? Peak current is only for very quick pulses if you try and run an LED at that current for longer than a mS or so it will burn out. Note it says
Peak Forward Current (1/10th duty cycle, 0.1ms pulse width) IFM 100 mA
So that is like a parking sign that says one hour no return for three hours, only it is turn it on at 100mA for 0.1 mS and don’t turn it on again for at least 1mS.