LED Lighting for Modelers



Light Emitting Diodes (LEDs) are useful for several functions on a model railroad, including:
- Train headlights and car lighting
- Building and station platform lighting
- Lineside signals

However, LEDs do have some issues to be aware of:
- The are sensitive to damage by static electricity (see the ESD Safety page).
- They can be damaged by too much voltage, and operating near the maximum current will shorten their lives. Usually you should design a LED rated for 20 mA to operate at 15 mA to provide a longer life.
- Although LEDs are more efficient than incandescent bulbs, they do produce heat, and this is another reason to avoid operating at maximum voltage and current, particularly in compact mountings where heat could damage a plastic model.

Varying the light output of a LED is hard, but sometimes desirable. I have a page about different ways to do that.


Rules for Wiring LEDs


Only DC power supplies should be used. LEDs can tolerate reverse voltage (typically 5 volts, more than their normal operating voltage) so AC could be used if the voltage was exact. However, a resistor won’t drop reverse voltage (since no current is drawn), so in most cases AC or reverse voltage is a quick ticket to a dead LED. If AC must be used, a protective resistor should be placed in series with the LED. Note that this will reduce the voltage (usually by around 1.4V) applied to the LED, altering the desired value of series resistor to be used. Also, AC meters typically report RMS voltage, but what matters to LEDs are peak voltage, which is about 41% larger for normal AC.

Corollary: LEDs only work in one direction on DC (except for bi-color LEDs, which change color when the polarity changes); if you hook one up backwards, it will be dark if you’re lucky, and go “pop” if you’re not. The “positive” wire should always connect to the “anode”. On most LEDs, the two leads will be different lengths, with the anode being the longer one. On some LEDs, the LED itself instead of having a circular cross-section will have a flat spot on one side; this marks the “cathode” or negative lead.

LEDs need a resistor wired in series to drop the supply voltage to the VF rating of the LED if your power supply is larger, and it usually is. A larger resistor will drop the voltage further, which causes the LED to draw less current. The exact relationship is complex since the voltage drop depends on the current, but the end result is that if you size the resistor based on the maximum current allowed, then pick a slightly larger resistor (perhaps 1.5x to 2x the ohms) the LED will still be fairly bright, but will draw less current, produce less heat, and last longer. Conversely a smaller resistor would over-drive the LED, and either blow it immediately or drastically shorten its life. Since resistors can vary by up to 10% (depending on the grade), it’s a good idea to pick one at least 10% larger than the minimum value the math says you can use.

LEDs can be wired in series, with one resistor for several LEDs; the sum of their VF should be less than the voltage rating of the power supply (one source suggestion 80%, although the exact reason for choosing that number is unclear; it may simply be arbitrary, to account for variation in actual output).

LEDs can be wired in parallel, but each LED (or string of several LEDs connected in series) must have its own resistor, otherwise one LED may take all the current and overload, burning itself out.

For building lighting on 12 volts using white LEDs (with a typical VF of 3.4 volts as below), this means no more than three LEDs can be wired in series, but that strings of three LEDs plus a resistor can be wired to a power bus in parallel.


Resistors


Resistors come in standard values, and have accuracy ratings. A 100 ohm 5% resistor could be between 95 and 105 ohms, but would be marked as “100 ohms, 5%” (there’s a color code for the markings).

Standard sizes for 10% resistors are:
10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82, 100, 120, 150, 180, 220, 270, 330, 390, 470, 560, 680, 820, and so on (e.g., 1000, 1200...).

Standard sizes for 5% resistors are all of the above, plus:
11, 13, 16, 20, 24, 30, 36, 43, 51, 62, 75, 91, 110, 130, 160, 200, 240, 300, 360, 430, 510, 620, 750, 910,...

Resistors also have a power rating (e.g., 1/4 Watt). You calculate the rating needed based on the voltage dropped by the resistor times the current used by the connected LED. And it’s a good idea to have a large safety margin, so if you’re using more than 60-75% (e.g., more than 150 mW to 188mw on a 1/4 Watt resistor), you should step up to the next higher rating. The applicable formula is P=VI, meaning that power (in Watts) is the voltage dissipated in the resistor times the current (in Amps).

Usually, the way to size resistors is to use a special-purpose online calculator (see below), however it is possible to work this through with a simple desktop calculator, or even a pencil. And it helps to do this at least once to understand what the size means, and to get a feel for what “should be” the right range of sizes. Here’s an example:

Example: on a 12V source, a single white LED with a forward voltage of 3.4 needs to have 8.6 volts (or more) dissipated in the resistor (12 - 3.4 = 8.6). If this is a 30 mA (0.030 Amps) LED, the resistor needs to be at least 287 Ohms (R= V / I = 8.6 / 0.030 = 287). Rounding that up to 330 Ohms (the next 10% rating) suggests that it might drop 9.9 volts (V = IR = 0.030 x 330 = 9.9). It won’t, because the current will reduce slightly, but it probably drops more than 8.6 volts. Let’s assume 9.9 volts at 30 mA to be on the conservative side.

Power dissipated in the resistor follows P = VI, so power (in Watts) lost in the resistor is 8.6 volts (roughly) times 0.030 Amps times 330 Ohms = 0.258 watts (258 milliWatts or mW). This is right on the edge, and you technically need a half-watt resistor. You won’t actually lose that much power, because the resistor was oversized, which reduces the current some. But it’s still going to be safer to use a 1/2 W (500 mW) resistor, which is quite large.

Putting two of those LEDs in sequence you only need to drop 5.2 volts, which requires 173 Ohms. Rounding up to 180 provides less than a 10% safety margin, so round up to 220. This implies that we could actually drop 6.6 volts (again, the reality will be a lower current and less voltage drop). P = VI = 6.6 x 0.030 = 0.198 W or 198 mW, so a 1/4 watt resistor will be safe, but a 1/8 W (125 mW) will not.

You can make the resistors considerably larger and the LED will still work, only dimmer. And because the current will be smaller, the power lost in the resistor will be lower, so you can use low-power resistors. I’m not aware of any simple formulas for this. If you’re going to build a lot of identical circuits, you could measure the current using a high-wattage resistor and an ammeter, and then just use appropriately-sized low-wattage resistors in your circuits. But this isn’t usually practical, particularly since many ammeters won’t measure currents in tens of mA at all.


LED Characteristics


Several numbers characterize the behavior of an LED:
VF = forward voltage (both nominal and maximum are often specified)
VR = maximum safe reverse voltage (almost always 5 volts)
current = current used to light the LED, typically in milliamps
mcd = intensity in millicandelas
color = in nanometers (or Kelvin, see below)

Typical VF:
White=3.4v
Red = 1.7-1.9v (higher voltages for higher intensity)
Green=2.1v
Yellow=2.0v

LED output is measured in mcd (millicandelas), with most LEDs emitting 200-400 mcd. Bright White LEDs emit anywhere from a few thousand to more than 20,000 mcd. Small surface-mount LEDs tend to emit less, but there are still some in the 200+ mcd range. Light is also sometimes measured in lumens. One candela is 12.57 lumens, so 1 lumen is 79.6 mcd.

When measuring light levels for illumination (light shining on things) a third unit is sometimes used. 1 lux is 1 lumen per square meter (about the intensity of the full moon). Typical room lighting is 30 to 300 lux, and a bright desk light can illuminate the desk to 1,000 lux. That would be 79 candelas (79,000 mcd) on a one-meter square desk.

There are several online calculators for selecting resistors or calculating multi-LED circuits:
The LED Center has a very nice one that can design for parallel strings of LEDs.
The LED Light has one that doesn’t handle parallel strings, but is able to calculate power and other numbers.
But here’s one I like even better that can do both and makes fairly conservative recommendations for the power rating of resistors.


LED Color


Originally, LED colors were fairly simple, and “white” wasn’t really very white. Then white LEDs improved some, adding a second frequency to balance the color a bit to what the eye expects. You can sell get LEDs sold this way, and the following list summarizes some typical simple-frequency LED colors.

Color (given as a wavelength in nanometers):
White = 460 - 555 nm (with two or more peaks)
Red = 520 - 530 nm
Green = 565 - 575 nm
Yellow = 580 - 595 nm

The above “colors” tend to be a single frequency, which causes odd color shifts on painted objects. White LEDs may use a couple of frequencies, making the LED look white to the eye, but if used to illuminate other things, odd color shifts can still result. Newer white LEDs do better at this, see below.

Note: “amber” is not yellow; it has a higher wavelength (more of an orange color, I’d guess).

With the adoption of LEDs for house lighting, the number and kind of “white” LEDs has exploded in recent years. New models include high-current / high-voltage ones that can in some cases be used on low-voltage supplies without a resistor. But the real advance has been in colors and color-accuracy. It used to be that “white” meant a blueish white, at a single frequency (which wouldn’t work very well for illumination of colored objects). Then “warm white” was added with a more yellowish white (the other color was often called “cool white”, although it’s not really the same color fluorescents of that description produce).

These newer LEDs are now specified with their color in Kelvin, just like room lighting, rather than in nanometers (as shown above) because they put out a more complex spectra designed to work better with the human eye.

You can even get LEDs with a Color Rendering Index (CRI) rating. This is a zero to 100 percent scale, where 80 and above is “fairly good” and 95 or better is equivalent to incandescent light (in accuracy, not necessarily in color). Older fluorescent lights could be 70 or less, but new ones are usually around 85. Some LEDs now exceed 95.

A recent check of some data sheets turned up the following named colors (names may mean other things from other manufacturers):

Sunrise: 2700K (orange), CRI=80
Warm White: 3000K (yellow/orange), CRI=80
Moonlight: 4000K (yellow), CRI=75
Daylight: 5000K (lt. blue), CRI=70
Cool White: 6000K (blue), CRI=70

This explains why “cool white” LEDs generally look too blue to be good as models of fluorescent lighting. A real fluorescent light is around 4000K, and looks “blue” only in contrast to incandescent light (2700 to 3000K). If your layout room is lit with fluorescents, you might want to use “Daylight” LEDs to suggest “blue” fluorescent light, but “cool white” will likely still look too blue, and “moonlight” may look better.


Building Lighting


Lighting LEDs can be large (5mm) in some applications, although small surface-mount LEDs may be required for most locations (such as room lighting in buildings or station platform lights).

5mm White LEDs tend to have VF=3.0 - 3.6 volts, C=30mA and 120 mW power dissipation.

Surface mount LEDs should be the “high dome” or “lambertian” type, which produces a wide light (140 degrees is typical). VF=3.2 (range of 2.5 - 4.0), current varies, but numbers of 300mA to 1000mA are typical for high-intensity white LEDs.

See the Basic Electronics page for an example of using LEDs with a power supply for lighting buildings. Also see my LED Lighting Strips page.


Lineside Signal LEDs


For Japanese N-scale, 1.5mm LEDs are equivalent to an 8 3/4” lens, which is approximately the correct size for a signal light. These LEDs tend to have VF=1.9 - 2.6 volts (max 2.6), current=20mA, mcd=150-400. This means that to drive one off a 12 volt supply, a 470 Ohm 1/2 watt resistor is needed, and a 510 Ohm (5%) resistor would provide a safety margin. And if the supply could be 14 or 16 volts, this rises to a 680 Ohm resistor (750 with a safety margin).

Note that Digitrax’s SE8C and associated hardware provides a 5 volt supply to connected LEDs, and both the TSMK and SMBK incorporate 100 ohm resistors, which drop a 30 mA LED to 2.0 volts; an additional 50 ohm resistor would be needed for a 2.0 volt 20 mA LED (and more if the voltage is below 2.0 volts). See my DCC Japanese Prototype Signals page for additional information.

However, surface mount LEDs (SMD) may be preferable due to their smaller size.


Car Interior Lighting


If you want to add interior lights to a train, you need a white LED (or LEDs) and a way to turn the track voltage into DC to light the LED. For much older cars, you might want to use a yellow LED to mimic incandescent lighting. White LEDs are sometimes available in Warm White and Cool White, and Warm white is probably a closer analog of incandescent lighting than yellow. Cool white is often too “blue” to make good fluorescent lighting, however mixed with an equal number of warm white LEDs it looks pretty good to me (but that’s a matter of taste).

First you need a LED. If the manufacturer offers an interior lighting kit, buy it. The cost (several dollars per car) will be well worth the amount of hassle it saves. Generally these kits contain everything you need pre-made on a circuit board, just plug them in (and maybe install a reflector or a clear plastic diffuser) and you’re good to go.

But if you have to work in a unique environment, you may need to roll your own. A good choice of LED is a 3mm, round, axial-lead “white” LED, like this one, which has a forward voltage of 3.3V, a typical current of 20mA, and puts out 5000 mcd (fairly bright). I’ve recommended some resistor sizes below, but you can select your own using the calculators noted above (but read the section about rectifiers below first).

It’s probably best to mount these at each end of the car, pointed up, and paint the ceiling a reflective color (like silver) to scatter the light through the car. LEDs can get warm, so don’t have it touching the roof or walls of the car, and if the doors on the ends of the car are open, or can be cut out, to provide some airflow, all the better. You can paint the sides black, or build a styrene wall, so the bright LED won’t be as obvious through any windows.

On DC, wire each up separately so they’ll light at a low throttle setting, with a 820 Ohm 1/2 Watt resistor, which will be safe up to 18Volts (and why would you use more for N-scale?) or a 1kOhm, 1W resistor if for some mad reason you plan to put these on an MRC throttle and turn it up all the way to 23 volts. You’ll also need a rectifier; we’ll come to that. With this approach, each car will use 40 mA, so a train of ten would use 400mA. That’s within the capacity of any DCC power pack, and most DC packs (except for the smallest ones).

On DCC, you can take advantage of the fact that the minimum voltage is the maximum voltage (and thus LEDs will always light regardless of the throttle setting) and wire the two LEDs in series (+ end of one connected via a wire to the - end of the other). With that, and assuming you’d not use a DCC system rated higher than 18 volts, you need a 560 Ohm, 1/2W resistor. For maximum safety an 820 Ohm, 1/2W resistor is recommended. The nice thing about this approach is that wiring two 20mA LEDs in series uses only 20mA, not 40, so ten cars would use just 200mA.

Note: if you’re really good at soldering, you can use surface-mount LEDs that are quite small. Some even have the light coming out of the side, so you can mount them to the roof of the car and have the light shine along it, scattering down to light the interior. This is much more complex to do (and the soldering requires more skill) so I won’t get into that here, but it’s basically the same except that the LEDs use currents around 5-7 mA rather than 20mA.


Power for Car Lighting


Now for power. LEDs use DC that flows in one direction. DC trains use DC that can flow in either direction depending on which way the train is moving. And DCC is alternating between two different directions thousands of times a second. To convert this to DC you need a “bridge rectifier” (a.k.a., a “full wave” rectifier). There are small ones (about 7mm on a side), such as:

Fairchild MB1S, 50V, 500mA, surface mount, $0.29 ea.
Fairchild DF005M, 50V, 1.5A, through-hole, $0.43 ea.

The voltage rating doesn’t matter, except that it needs to be about 30V or more to be safe. The current rating only needs to be larger than your maximum (40mA with two 20mA LEDs in parallel) and they all are.

When calculating your own resistors, keep in mind that the rectifier will drop the track voltage by about 1 volt, so a 14V Zephyr becomes 13V. To be safe, assume maximum voltage is the DCC maximum of 22 volts (or 24 volts if you want to use the standard safety margin used on N-scale decoders). It’s not very likely to be that high, but better a slightly dim LED than a blown one, if you operate off track power.

Note: larger scales can have higher voltages. See NMRA standard S-9.1 for a detailed list.

The surface-mount rectifier is slightly smaller, but harder to wire up (see the photos in those two links, and realize the whole MB1S is about 5mm across). The DF005M has longer leads, which will take up more space (it’s also about 8mm on the long side) but will be easier to solder to.

The rectifier has four leads, two marked “AC” or with wave symbols (often a tilde “~”) and two marked “+” and “-”. Connect one AC lead to each electrical pickup from the track (you may need to make your own pickup if the car didn’t come with one, that’s much harder and I’m not going to get into it here as it’s different for every model of car). Then connect the resistor-LED string with the “anode” end (often marked with a flat spot on the side of the LED or a longer lead) to the “-” output of the rectifier, and the cathode (“+”) end to the “+” output. (note: each string goes minus-resistor-ledcathode-ledanode-plus or minus-ledcathode-ledanode-resistor-plus; don’t forget the resistor). If you have two separately-wired LED strings, you can connect both to the same rectifier, just connect both cathode ends to “-” and both anode ends to “+” (called “wiring in parallel”).

And there you have it, simple, cheap interior lighting at under $1 per car (not counting your time).