Modern modeling uses Light Emitting Diodes (LEDs) extensively. This is because they offer numerous advantages over older technology, such as incandescent 💡 light bulbs:
- They are small
- They are cheap
- They are long lasting
- They use very little current
- They do not get hot
- They are available in many colors (including 'warm' and 'cool' white)
LED packagesLEDs come in a variety of different forms and sizes (called packages in the electronics industry).
Typically round 2mm, 3mm, 4mm or 5mm. Rectangular and other shapes are also available.
Surface mount (SMT)
These are even smaller than the through-hole packages and are usually soldered directly to circuit boards by machines. One can now also buy them with tiny wires already attached and these are ideal for model building.
The different sizes are expressed using a 4 digit code that is made up from the length and width of the LED in tenths of a millimeter. For example a 2835 is 2.8 mm by 3.5mm. 5050 is 5mm x 5mm. Note however for that some LED sizes are expressed in thousandths of an inch instead, so a 0402 SMD LED is is 1mm x 0.5mm. It is so small, it represents an object 87mm x 43mm in HO scale! - smaller than a lightbulb.
White LEDs are also commonly found in long, flexible strips up to 5m (16') long. These are made using surface mount LEDs. They are pre wired and ready for use with 12V (sometimes 24V). One can cut them to small lengths, typically 5cm long. These are ideal for passenger car and station lighting. They often use 5050 or 3528 sized LEDs. They are available in various colors, including warm, and cool white.
These strips come with a crummy adhesive backing that will not stick for long, and so should be ignored. They need to be attached with a quality double sided tape such as 3M VHB tape.
Multicolor neopixel etc.
There are components that comprise 3 (R,G, B) or 4 (RGB+W) LEDs which allows the color of individual LEDs in a string to be digitally controlled independently. These fall out of scope of these fundamental concepts.
In order to understand how to connect LEDs up we do need some very fundamental understanding of electricity. Specifically we need to know a little bit about voltage, current and resistance. It may aid the understanding of these concepts by thinking of electricity rather like water in a pipe. For this analogy:
- Voltage (V) - think of the Voltage as the pressure/speed of the water in the pipe. Measured in Volts
- Current (I) - think of the Amperage as the diameter of the pipe. Measured in Amperes (Amps, A or mA. 1A = 1000mA)
- Resistance (R) - think of resistance as obstructions to the flow of water in the pipe, such as blockages or mesh grates that slow the water down. Measured in Ohms (Ω)
These three things have a simple relationship between them: V = I x R (Ohm's Law) and this formula is used to calculate things in all circuits, but fear not, most of the calculations have all been done already.
Just like a pipe, where water can travel in both directions, so can electricity flow in either direction along a wire. If the pressure is higher at one end, water will flow to the other end. If the voltage is higher at one end of a wire, electricity will flow to the other end of the wire, so long as it can get out.
Like pipes, larger amounts of current (Amperes) need thicker wires.
Series and parallel
Sources of power for LEDs
Almost all the complexity of using LEDs stems from the various Voltages and types of electrical power available in the modelling environment. Electrical power is typically available in two forms:
- Direct Current (DC). The direction of the electrical flow is one way only. There is a positive and a negative side of the power source, (such as a battery).
- Alternating Current (AC). The direction of the electrical flow keeps flipping. The positive and negative sides of the power source keep alternating.
The voltage of AC current varies from positive to negative very rapidly, and it typically resembles a sine wave shape if one was to plot the voltage over time as shown above. The direction of the flow typically changes 50 or 60 times per second (Hz).
In the model train world we also have a very special variant of AC electricity available: the digital signal that exists in the tracks to power digital trains. This electricity is also AC, but the wave is not a sine wave, it is a square wave and it oscillates at a much higher frequency.
Electricity for LEDs
- LEDs only use DC current
- LEDs can only handle very small currents
- LEDs only use very small voltages
- LEDs cannot handle current flowing in the 'wrong' direction.
Imagine we take an old style circuit that uses an incandescent light bulb.
and we substitute an LED for the light bulb:
almost right away we get.... nothing more than a puff of smoke....
Using a 460Ω resistor, the LED will use: (9V-2V)/460Ω = 0.015 A = 15mA
In addition to too much current, LEDs can handle even less current going the wrong way. Wrong way current could happen if you connected the two wires to the power source (battery) the other way around. If we do that, the LED will burn out right away. So just as we do with water in a pipe, we add a valve. An electrical valve is called a diode.
Note #2, the diode (such as a 1N4001) uses about 0.6 Volts, so now the LED is getting:
Note #3 The order of the components in the circuit does not matter at all. The resistor and diode can be anywhere.
Note #4 The polarity (direction) of all the diodes is critical. All diodes (including LEDs) have a mark on one side to indicate the negative end. The LEDs have a flat side and the silicon diode has a stripe on the negative side. SMT LEDs have some tiny mark such as a green dot.
Let's throw out the battery and hook things up to a 12V DC power supply.
White LEDs are special
How many LEDs can we add?
How should I power the LEDs in my buildings, etc.?
I have some 16V AC power supplies, can I use those?Yes, but let us look at what AC current looks like again:
The diode prevents the electricity from flowing in one of the directions, so we would be using only some of the power, like this:
- If the illuminated object is moving, we will see the LEDs flickering because each time they go on they are in a new place, and we lose the effect of persistence of vision. If one moves one's head swiftly one can also perceive the lights flickering.
- If you attempt to make a video of the models, you will most likely get a nasty stroboscopic effect as the frame rate of the video interacts with the flashing LEDs
The four diodes force the positive voltage to always go one way and the negative the other way so the LEDs are off for almost none of time. This is called full wave rectified power. The 'bumps' in the voltage is called 'ripple' and may still produce visible flicker.
There is a solution to this ripple also... we add what is called an electrolytic capacitor, which is like a very fast battery, it charges up very fast and then lets that charge out when the external voltage is below its charged voltage. Let's add the capacitor:
The capacitor has the effect of smoothing the ripples in the current, so the graph looks like this:
There are still a few bumps, but they are negligible for the purpose of lighting the LEDs.
The electrolytic capacitor is a 470 uF rated for 35 Volts.
Important note: The polarity of the capacitor is also critical. One side of the capacitor is marked with a stripe showing the side that must be connected to the negative. If you connect it the wrong way it will explode. (The metal tops of the capacitors are even scored so the explosion is less violent!)
So yes, using a 16VAC power supply can very much be used, but you should rectify and smooth the output and then use 22.4V as your input voltage in the calculations of resistors. Since the 22.4 Volt is so close to the common 25V rating of capacitors, it is suggested to use a 35V capacitor if you have enough space for it or a 25V capacitor if space is tight.
What about those cheap LED light strips?
How about lights inside passenger cars?
- D1, D2, D3, D4, D5, D6: 1N4001 silicon diodes.
- R1: 1000 Ohm 1/4 Watt resistor
- R2: <see below>
- C1: 2200uF 35 Volt capacitor (or 25V if pushed for space)
- Converter advantage
- It will maintain the brightness of the LEDs when there is a power interruption since it will take the reduced input voltage and still maintain its output voltage until the input drops too low.
- The ability to vary the voltage with an adjustment screw lets one alter the brightness or even adjust for a different length of LED strips without rewiring the circuit. Identical circuits can be made up for any length of LED strips.
- The DROK converters have the ability to switch the output on and off. I have not tried this, but I think a digital decoder output could be used to switch the lights on and off without any load on the decoder.
- Resistor advantage
- Cheaper (by $1.75 per train)
- Does not have the (very small) overhead of about 0.85mA.
- The lights will slowly dim and will stay lit even after the capacitor drops below the minimum voltage that the DC converter would need to keep the lights at normal brightness. This means they will stay on longer, but start dimming right away.
Lighting approachWhen lighting passenger coaches, you have to decide if you are going to add the circuitry to every coach, with each coach providing its own power from the track, or if you are going to have one circuit rectifying the current and preventing flicker, and then run wires down the train to each coach. Those decisions are governed by how you run your trains and if you have to separate the coaches from each other. You may also elect to run wires but have them pluggable. Having each coach have its own circuitry also adds the additional cost of the current pickup from the track and increased drag that that produces. You also have to find space to hide the capacitor.
I do not separate my passenger trains and they live on my layout permanently so I am going for one circuit per train.
Another approach used with 12V LED strips is to feed the power through two lengths of LED strip in series, feeding the negative of the first strip into the positive of the second strip. This approach will only work well if you have an even number of segments. If lighting a single coach, you have to have connections in the middle of the coach. If you split the two halves over two coaches, you cannot carry the current through to the next pair without an additional pair of wires, so I think there is little advantage over having a simple pair of wires running the length of the train, with a single strip in each coach.
Cost of passenger train lighting
Summary steps for train lighting
- Decide how many segments of LED strip will be in the train/coach
- Cut a length of that many segments
- Connect a bridge rectifier (or 4 diodes) to track power. (off)
- Connect 8 x 1k Ω resistors in series with the LED strip
- Make very sure that the positive output of the rectifier is connected to the 12+ side of the LED strip.
- Switch the track power on
- If the LEDS are too bright, add more resistors. If they are too dark, bridge over some resistors with a wire until they are the right brightness. (Don't make them too bright)
- Count the resistors that were in effect = how much resistance you want.
- Decide where you are going to hide the circuitry inside the train
- Wire up a capacitor, inrush resistor and diode as shown above and connect to the rectifier
- Connect wires from the track power pickups to the input of the rectifier
- If lighting more than one passenger coach, cut the strip to length for each car
- Connect strip to resistor calculated in step 8 to rectifier+capacitor circuit, attach wires at other end of strip to go to next coach.
- Install light strip in roof, run wires out past couplers to next car. (Cross the wires over the coupler to keep them from hanging too low.) Add plugs if you like.
- For subsequent passenger cars simply run the wires in, through the strip and out to the next car.
Room Lighting with LEDsSometimes you may want to use LED strips to light the room, not simulating scale lights in the actual models. In this case, you may want to aim for maximum brightness and maybe also the ability to dim the lights to simulate dusk or dawn etc.
For this application you can feed the full 12V from a DC power supply into the LED strips.
DimmingSome strips also come with a small cheap remote controller that lets you switch the lights on and off or dim the strip.
You can also add a pulse width dimmer to the power supply side of a plain LED strip. The pulse width dimmer does not vary the voltage, rather it switches the power on and off very rapidly and it varies the time that the power is on versus off to produce different intensities.
These dimmers cost about $3 and can handle up to 8 Amps!
I used such dimmers for controlling the lights in the ceiling of my layout room. Later I decided I wanted to control them from my layout software so that lighting effects could be synchronized with sounds etc, so I replaced them with a small processor that does something similar.
Where to order components
DisclaimerI am not an electronics expert nor professional engineer. I present this information based on my understanding of the concepts and cannot make any warranties or guarantees as to the suitability, completeness or accuracy of any of it. Use this information at your own risk. I am not responsible for any injuries, damages or losses of material, time, and tempers 😤 that may result from reading this content.
Soldering involves using a hot soldering iron and you may burn your fingers. I do not suggest you do so (or any other body parts) by publishing this content. Switch the iron off when leaving the workbench.
Connecting circuits, especially when including capacitors, may result in electrical shocks. Don't touch any circuit with any part of your body that you would not like to conduct electricity. ⭍
V= I * R also applies to mammalian tissue💀.
I hope it is illuminating 💡
Ross Stewart corrected the 0402 size.
Some of the images were created using TINKERCAD