LED resistor calculation - just to confirm before I order

I want to place a LED on my PCB. I will drive it using the ATMEGA328 digital I/O pin.

I found a LED that has a forward voltage of 3.8V and forward current of 20ma (http://il.mouser.com/ProductDetail/Vishay-Semiconductors/VLMB1300-GS08/?qs=sGAEpiMZZMseGfSY3csMkT76%2bv4Lkd3eBAAVFTiygW0%3D)
So (Vs-Vf)/If = ( 5 - 3.8 ) / 0.02 = 60ohm.

So I need to connect a 60ohm resistor to the I/O pin before the LED, correct?

szangvil:
I want to place a LED on my PCB. I will drive it using the ATMEGA328 digital I/O pin.

I found a LED that has a forward voltage of 3.8V and forward current of 20ma (http://il.mouser.com/ProductDetail/Vishay-Semiconductors/VLMB1300-GS08/?qs=sGAEpiMZZMseGfSY3csMkT76%2bv4Lkd3eBAAVFTiygW0%3D)
So (Vs-Vf)/If = (5-3.8)/0.02 = 60ohm.

So I need to connect a 60ohm resistor to the I/O pin before the LED, correct?

60 ohms is correct. However in a simple series circuit it doesn't matter if the wired order is output pin, resistor, led or output pin, led, resistor as there is only one path for current to flow and it's identical at any point in the series circuit. That is one of Kirchoff's laws.

Also most modern led's don't have to be driven at their maximum rated continuous current rating to be useful, they will provide useful light even running at a couple of ma. and one can save some energy doing as such. The arduino on-board led uses a 1,000 ohm series resistor and works fine for it's purpose. So you see you can have a lot of leeway on resistor size once it has at least enough resistance to keep the led at or under it's maximum current rating.
Lefty

How do I know what is the minimum current that will make the LED light up?

You will have a hard time finding a 60 Ohm LED resistor :roll_eyes:.
Probably you’ll only find 56 and 68 Ohms.
In this case, the 68 Ohms would be the best choice.
Your LED would light up, but not at maximum brightness.
Do you need maximum brightness ?

But there are some more things to take in consideration.
Are you sure your 5 volts is 5 volts and not say 4.8 volts (try measuring with a multimeter and be surprised).
The voltage available will vary, for instance in case you’re already powering some LED’s or whatever by your Arduino.
Your 3.8 volts forward power for your (probably white) LED might be too close to do the math and have some spare as well.

I don’t know about the minimum.
Maybe trail and error can be your friend here.
But that would require a stash of resistors to play with.

szangvil:
How do I know what is the minimum current that will make the LED light up?

It will light up at almost any current. It's insufficient voltage that causes LEDs to stay dark.

For "PCB LEDs" (power indicators or whatever) I normally put 1k or 2k resistors. Anything less than that is too bright to look at.

szangvil:
How do I know what is the minimum current that will make the LED light up?

One way is to test it will a pot, say a 0-5K ohm and start at maximum resistance with a DMM in series measuring the current and adjust the pot till you feel it's a useful brightness then disconnect the pot and measure what ohms it is.

As a hint of how little current is needed I have powered a led by wiring it to a input pin (yes not a output pin) with it's internal pull-up resistor enabled and can just barely see it lite up very dimly, and an internal pull-up is like 40,000 ohms or more, so calculate that current to be impressed. Again it was too dim to be useful but you could tell it was lite.

Lefty

ok, got it.

Good link for calculating the resistance for your LEDs:

I personally use it allot you should use it next time for faster calculations.

Your calculation of 60 ohms is correct, however the Arduino outputs have an internal resistance of around 20 ohms typical. So if you want to drive it about 20mA then I suggest you use 47 ohms, which is a standard value. But you will probably find that 10mA is adequate.

In this case, the 68 Ohms would be the best choice.
Your LED would light up, but not at maximum brightness.

I doubt if you will be able to tell the difference between an LED running at 15mA and one running at 20mA. You you will see it if it changes while it is on but turn the LED off between changing the current and you won't notice it.