Tom said:
I have a led that needs 2.3 to 2.6 V max, I want to run it off a 5V
supply at close to its maximum voltage.
What the data sheet tells us is that the LED's absolute forward
current level is 50 mA continuous, or 100 mA if fed a low-duty-cycle
high-speed pulse train. More current than that will damage it.
Running an LED near to its absolute-maximum rating is, I believe,
likely to shorten its lifetime significantly. I usually prefer to
keep them at half-maximum or a bit less. This LED's brightness (which
is considerable) is rated by the manufacturer at a forward current of
20 mA, so that's what I'd suggest using.
At that current level, the LED is going to have a forward voltage of
2.3 to 2.6 volts. Let's use 2.5 volts as a working figure (it won't
matter very much if the particular LED you use is a bit higher or
lower).
So... a 5-volt supply, with 2.5 volts appearing across the diode.
This means that we must choose a resistor which will have (5.0 - 2.5)
= 2.5 volts at a forward current level of 20 mA.
You can solve for this by using Ohm's Law, which states that E=I*R, or
(by solving for R) R=E/I.
R = 2.5 / .02 (if we do it in volts and amps) or
R = 2500 / 20 (if we do it millivolts and milliamps)
In either case, R works out to be 125 ohms.
Let's figure out the power dissipation. P = E*I. We know that E
(across the resistor) is 2.5, and I is .02, so P = .05 watts of heat
dissipated in the resistor. It's generally a good idea to "de-rate"
resistors by 2:1 (that is, don't ask them to dissipate more than half
of their rated capability) to ensure long life. In this particular
case that's no problem, since the smallest standard leaded resistors
are 1/8 watt.
So - choose a resistor value in the neighborhood of 125 ohms (whatever
you have that's closest, plus or minus 10-20%), in whatever size is
convenient (1/8 watt or larger), and you should be fine.