If you need long life...the Arduino Uno is very wasteful. Over half the power goes into the other chips on the board. Something like this will last MUCH longer on batteries and it can run off 3xAA: Diavolino
R = U / I
R = 5V - 3.2V / 0.02A (Each led is 3.2V and takes 20mA)
R = 90 Ohm --> Is 100 Ohm resistor before each LED right?
Will it work, or will I damage my Arduino?
zzzajda:
R = U / I
R = 5V - 3.2V / 0.02A (Each led is 3.2V and takes 20mA)
R = 90 Ohm --> Is 100 Ohm resistor before each LED right?
Will it work, or will I damage my Arduino?
No...that calculation is for a 1.8V LED. The voltage isn't 5.0-3.2, it's 3.2.
R = 3.2V / 0.02A (Each led is 3.2V and takes 20mA)
R = 160 Ohm, minimum.
nb. That resistor value is the minimum. In practice you should use something a little bit higher than that in case one of your LEDs is only 3.1V (the datasheet will tell you the tolerances).
Your circuit doesn't need a resistor on the GND wire. Apart from that it's fine.