I supposed it should work fine...

Always use a current limiting resistor. If you don't, and you're lucky,

you'll just burn out your LED. If you're unlucky, it'll burn out your

power supply and/or other circuitry in the path.

Diodes work differently than other types of loads. They always drop a

pretty consistent voltage, regardless of current. This means that if

nothing else resists the current, then it basically looks like a short.

That's a simplified model of diodes, but for the most part a very useful

one. As others have mentioned, the voltage that LEDs drop depends on the

chemistry. As does the color.

Usually, when you buy LEDs, the spec sheet tells you the important

characteristics:

1. max forward current, If(max).

2. Typical forward current, If(typ)

3. Typical forward voltage drop. Vf

To figure out how much resistance to use, you want to make sure that the

total current is less than the max forward current, and preferably

closer to the typical forward current.

Let's use a concrete example. From the first google result for "Blue LED

spec sheet" <

http://www.lc-led.com/products/500tsb4d.html>

Peak current is necessary to consider if you have capacitor in the

circuit, or some other kind of timing dependent circuitry. Let's ignore

that for now.

Max continuous forward current is 30ma. So we want to keep it below

that. Let's aim for 20ma.

Typical forward voltage drop is 3.6 (already 2.5v is too low).

Take your total supply voltage (5v in your case), and subtract the rated

typical forward voltage drop. 5v - 3.6v = 1.4v

Now we know that the LED drops 3.6v, and the "rest" of the series

circuit needs to drop 1.4v. Using ohm's law V=I*R, we know that we want

R such that 1.4v=20ma*R. 1.4v/20ma = 70ohms. That is the minimum

resistor you need. The next standard size up from 70Î© is 75Î©. You could

also go up to 100Î© and end up with 14ma through the LED, which may be

bright enough.

In professional applications, you'll also need to consider the power

dissipation, but that's another few pages of discussion ;-)

Hopefully this helps,

Daniel.

P.S. I'm not an expert in the field, so I may have forgotten something

or gotten something wrong. Anyone else should feel free to correct me.