I am new to the forum and new to electronics, so please excuse me if these questions are too simple.
I just did the Arduino Fade example. I was wondering how many LEDs I could safely attach to a single Output Pin. Is there a way to make those calculations? Would it be better to use resistors in series or parallel?
A 5volt Arduino (not all are) outputs 5volt, and can normally deliver 20mA (40mA absolute max) per pin.
(there is also a max for the whole chip)
There are ~2volt "standard" LEDS and ~3.3volt "high-brightness" LEDs.
Two ~2volt LEDs can be connected in series, but ofcourse only one 3.3volt can work on 5volt.
LEDs need a current limiting resistor in series.
This resistor is calculated to drop the remaining voltage at the needed current.
Or current is calculated for a known LED/resistor.
Example: one 3.3volt LED with 220ohm resistor in series.
Current = (5volt pin - 3.3volt LED) / 220 ohm = 1.7/220= 7.7mA
You could connect two of these LED/resistor to one pin.
A 2volt LED would draw (5-2)/220= 13.6mA.
One is ok, but two of these per pin would draw more than 20mA.
Unless you put them in series.
Then: (5volt - (2*2volt) /220 = 1/220= 4.5mA
I could have 20 LEDs on one pin.
As long as the total current is ~ <=20mA.
Leo..