I am new to this world of the arduino (and electronics in general to be more precise) and have spent some time trying to wrap my head around many of the concepts. After much reading I've decided to jump into building a 3x3x3 cube (wanted to do a 4x4x4 but think a 3x3 is more prudent for a first project).
I've gone ahead a purchased a number of blue LED's from eBay which have the following specs - 3.0-3.4v, 3.22v typical, 24mA max, 13000 mcd. In trying to calculate the resistors I need I've both used an online "calculator" and more importantly tried to apply Ohm's law as I understand it... And, this is where I need my understanding to be checked.
I understand that the Arduino Uno works at 5V. So, if I am applying Ohm's law correctly, I need to calculate the "voltage drop" (which I am equating to the remaining voltage after the LED), and divide by the current I want the circuit to draw (in this case based on what the LED can handle):
R=V/I
R=(5 - 3.2)/.02A == 90ohm resistor required (this uses an avg voltage of the LED and assumes a chosen 20mA current)
So, I think I should be rounding up to a 100ohm resistor to prevent more than 20mA going through the LED. This is consistent with what the calculators are returning. I assume rounding up to a higher resistor will simply limit the current available for use by LED resulting in an imperceptibly dimmer LED.
What I am not 100% on is how the the arduino's output current plays into this (or if it does at all). I understand that the max input or output the pins can handle is 40mA. I assume that it is the resistor that limits the current from the pin, hence an additional reason for choosing 20mA in the above equation. So, hypothetically if I used a smaller resistor more current would flow through the LED potentially damaging it and the in/output pin.
Eg. - using an imaginary 10ohm resistor
I=V/R
I=1.8/10 = .18 amps or 180mA == damage to the LED and i/o pin
Does all of this sound right?