Resistance value for hook LED?

I am setting my first arduino card for the very first time. I am following the Windows guide tutorial and then I bumped to the 'blink example'.

My question may sound silly but... what's the resistor value I should use to hook the LED in the RX/TX ports?


Never mind... I never noticed that there were mini-nano-micro LEDs soldered to the card!


One of the things you'll need to watch out for is "old" tutorials that apply to hardware that no longer exists (or has been significantly updated.)

There are numerous articles on the web how to calculate the value of the current limiting resistor.

In a nutshell, a LED has a specified forward voltage (e.g. 1.7V); you need to find that in the datasheet of the LED (which can be tricky). A LED also has a maximum current (e.g. 20mA); the current defines how bright the LED is.

Because the LED and the resistor are in series, part of that power supply voltage (e.g 5V) will be over the LED and part of it is over the resistor.

The part over the LED is its forward voltage, so 1.7V. This leaves 3.3V over the resistor (5 - 1.7). Ohm's law (V = I x R) rewritten a bit

R = V / I

and from that (at max current)

R = 3.3 / 0.020 = 165 Ohm

Rounded to the next value (in the E12 series), 180 Ohm. You should always round to the next higher number, else the current will be higher than the maximum allowed. In general one should also not use the absolute limit for the current (use e.g 15mA to play it safe).

10mA can often be enough, certainly with modern LEDs; in that case the resistor value becomes 330 Ohm.

You also need to take care of the power dissipated in the resistor

P = V x I = 3.3 x 0.02 = 66 mW

From the above, you can use a 1/8W (125mW) resistor.

Forward voltage for different color LEDs is different; I think around 2V for blue and 1.5V for other colors; as said, consult datasheet :wink: