LEDs don't really have a voltage, the way incandescent lamps do. They have a rated current. 20 mA is the do-not-exceed current, and 10 mA will make them glow brightly enough for most model railroad uses. Exceeding 20 mA will convert a LED into a Darkness Emitting Diode (DED). These current ratings are good for all LEDs regardless of maker or cases style.
Ohm's Law (R = V/I) is what you use to figure resistance. Ordinary people need to put all the units into Volts. Ohms and Amperes, so 10 mA becomes 0.01A. (There are some short cuts for those skilled in the art, but lets just keep things simple). V is the voltage out of the wall wart. To a good approximation, the voltage across the LED is zip, so the resistor sees the full wall wart output voltage.
In actual fact, forward biased LED's show a small voltage across them, 1.5 to 2.5 volts, perhaps a tad more for blue or white LEDs. So the current limiting resistor sees wall wart voltage LESS the LED forward voltage drop. For a better approximation, use the wall wart voltage MINUS the LED voltage in the Ohm's Law equation. If you neglect the LED voltage, your LED current will be a little lower than computed but that won't hurt anything.
Some wall warts are AC. AC isn't good for LEDs so I would put a rectifier on the AC wall warts.
David Starr www.newsnorthwoods.blogspot.com
I tend to go by rule of thumb. Protect with the resistor first, then anything else is optional depending on what you want to achieve. Here's a calculator that gives you what those minimum resistances to act as a protective function: http://ledcalc.com/
Unless you're modeling one of those rare super-bright light sources, you'll almost always want to add considerably MORE resistance than the protective resistance. Helps to calcualte the first few, but after that you get familiar with what's needed to get the effect you want out of a LED and you just pick one that you know will get you in the ballpark in most cases.
Another trick for getting the light brightness about right is to build-in the resistance you know is protective and about right -- based on your experience or the calculater -- install on the layout. Most of the time you're good, but generally the problem will be not enough, rather than too much. Since resistors are additive when wired in series, you can install added resistance underneath the layout where the leads to a structure connect to power. This saves having to reset a structure.
Some folks will say, calculate and it will be right from the beginning. Well, maybe, as most of the calculators for resistance tend to be about the minimum resistance needed fro protecting the LED and have nothing to do with figuring out what the proper resistance is to look right on the layout, where dimmer is usually better. That's part of lighting that is more art than craft.
Mike Lehman
Urbana, IL
Here's one of many online calculators for resistor values ....
http://www.hobby-hour.com/electronics/ledcalc.php
Mark.
¡ uʍop ǝpısdn sı ǝɹnʇɐuƃıs ʎɯ 'dlǝɥ