This article describes a lighting circuit that generates a glowing firebox effect and provides constant illumination for classification lamps and an interior cab light. It contains all information needed to build the circuit including a detailed schematic, circuit board layout diagram, and component parts list. Recommended sources for components are provided. Instructions for typical installations are included.
- 08/17/2011 – Minor editing and addition of photos and video.
I like the effect of glowing fireboxes in my large-scale locomotives. Some locomotives come with a firebox glow circuit already installed; most usually do not. There are several commercially available “fire flicker” or “electronic candle flame” circuits that can be used to drive incandescent bulbs or LEDs in the firebox, but none of these look realistic to me. I wanted the effect to look like the shimmering, red-orange glow of a roaring fire in a coal-fired locomotive. I decided to make my own.
I figured while I was at it, I might as well add the capability to provide constant voltage for classification lamps and locomotive cab interior lighting. I intentionally left out any capability to power the headlight since my locomotive headlights and reverse lights are powered directly from DCC controllers in my locomotives. If you need to power a headlight, you can simply tap into the constant voltage provided by the circuit.
This article will describe the circuit in sufficient detail to allow you to build identical copies or to modify it to meet your needs. The circuit uses inexpensive discrete components that are available from a wide variety of sources. Potential suppliers are included with the components parts list. I bought enough parts to build five identical circuits and the total cost was under forty dollars – less than eight dollars per locomotive. No special electronics skills are needed other than the ability to use a soldering iron.
I operate all of my locomotives with onboard battery power. I use 14.8 volt Li-ion batteries, QSI Sound/Power DCC controllers, and G-Wire radio receivers. This gives me a readily available source of constant DC power for the circuit from the onboard battery. The circuit operates whenever the battery switch is in the ON position, regardless whether the locomotive is moving or not. It is totally independent of all throttle and sound functions from the QSI controller.
If you run on analog power (straight DC track power), you can add a rectifier between your track pickups and the circuit to provide constant polarity DC power. The downside of using track power is that the circuit will not begin operating until the track voltage reaches 7 volts. If you run digital power (DCC track power), then you will always have the needed voltage available from the track pickups. However, you would still need a bridge rectifier to maintain constant polarity.
To eliminate the hassle of adding a bridge rectifier or dealing with other track power issues, an onboard battery is the best solution, even if you are operating from track power. The circuit can be powered from any small rechargeable battery pack between 7 and 35 volts. As a test, I ran the circuit continuously for over a week from a small 14.8 volt, 2200mAh Li-ion battery pack on a single charge. The pack was the size of four AA penlight batteries. You could even run the circuit with a disposable 9-volt battery but the run time would drop to approximately 15 hours between battery changes.
Theory of Operation
Note: This section of the article explains how the circuit operates. You can skip on to the Circuit Description section unless you are curious or you want to make modifications. Refer to the schematic diagram in Figure 1 as you read this section.
Input DC power is applied to connector J1. The input power can come from either an onboard battery, or from a bridge rectifier connected to the track inputs. Connector J1 is keyed to prevent accidental polarity reversal. Capacitor C1 filters any transients on the input DC voltage. Voltage regulator (IC1) converts the input DC power into regulated +5 volts. Capacitor C2 filters the +5 volt output of the regulator. Diode D1 protects the regulator from reverse current when input power is removed – not likely, but cheap insurance!The remaining circuitry including the LEDs operates from the regulated +5 volts.
As soon as +5 volt power is available from the voltage regulator, capacitor C3 begins to charge through resistor R1. While C3 is charging, transistor Q1 is turned on and provides a ground signal (logic 0) which is used as a “Power-On Reset” signal. When C3 is approximately 60% charged, Q1 turns off and the Power-On Reset signal is pulled to +5 volts (logic 1) by resistor R2. When +5 volt power is removed, C3 discharges through diode D2. The values chosen for C3 and R1 create a Power-On Reset signal that lasts approximately 0.3 seconds.
A timer (IC2) is configured as an astable oscillator to produce clock pulses. Resistors R3 and R4, along with capacitor C4, establish the clock frequency of the oscillator at approximately 52 Hertz with a duty cycle of 56%. The clock pulses are produced continuously as long as +5 volts is present.
The clock pulses cycle an eight-bit parallel-out serial shift register (IC3) through a pseudo-random sequence of 8-bit values. Four of the register outputs are combined in a quad 2-Input exclusive-or gate (IC4) using the following algorithm:
Result = ((QE XOR QF) XOR (QG XOR QH)) XOR 1
The result of the exclusive-or logic is fed back into the 1st register. This produces a continuous cycling of the shift register so that different combinations of logic ones and zeroes are generated in the eight register outputs. The sequence of output logic states is not repeated until 255 “ticks” of the clock have occurred. Sampling the output of any register will yield an apparently random length of on-off cycles.
The Power-On Reset signal holds the shift register cleared for approximately 0.3 seconds after power is first applied to the circuit. This delay gives the oscillator sufficient time to stabilize and begin producing clock pulses. During this delay period, all eight register outputs are held at logic zero, thus insuring that the initial output of the exclusive-or logic is a logic one. This logic one is fed back into the 1st register and furnishes the initial “seed” value that begins cycling through the pseudo-random combinations. Current is provided by each register when it is at logic zero. Each firebox LED is driven by the combined currents from two output registers. To further enhance the random glow effect, the two registers used to drive each LED produce binary-weighted currents using different size resistors. This gives four possible states for each LED. The LEDs turn on and off at pseudo-random intervals and illuminate at 1/3, 2/3 or full brightness when turned-on.
Connector J2 connects the circuit board to the firebox LEDs. The connector is keyed to prevent accidental reversal. J2-Pin1 provides a single +5VDC output which goes to the positive leads on all four LEDs. J2-Pins 2, 3, 4, and 5 provide the LED driver outputs for the negative leads on each LED.
Connector J3 provides independent +5VDC and AUX lighting outputs for the classification lamps and the cab light. The connector is keyed to prevent accidental reversal. Resistors R13 and R14 are sized to provide 20 milliamps of current for both AUX lighting circuits. J3-Pin 1 provides +5VDC to the positive leads of the classification lamp LEDs. J3-Pin2 provides the AUX1 lighting signal to the negative lead of the classification lamp LEDs. The classification lamp LEDs are wired in parallel. J3-Pin 3 provides the AUX2 lighting signal to the negative lead of the cab light LED. J3-Pin4 provides +5VDC to the positive lead of the cab light LED.
This circuit generates a glowing firebox effect for a steam locomotive with four orange LEDs. Outputs are also provided for two warm white classification lamp LEDs and one warm white cab interior lighting LED. The entire circuit (except for the LEDs) is contained on a single 1 7/8″ x 2 7/8″ x 1/16″ printed circuit board. The printed circuit board can be located at any available position within the locomotive boiler.
The orange LEDs are located behind the firebox door in the locomotive cab. The fire effect is created by turning the four LEDs on and off at random intervals, and by varying the intensity of the LEDs while they are illuminated.
The two white classification lamp LEDs are located on the front of the smokebox (inside of cored marker lamp detail castings from Ozark Miniatures.) The white cab LED is located on the underside of the cab roof. All three white LEDs are illuminated at steady brilliance whenever input DC power is applied to the circuit.
The circuit will operate on any DC input voltage between 7 and 35 volts and consumes approximately 0.45 Watts of power (90 milliamps maximum @ 5 VDC.) The circuit contains a 5 volt regulator rated at 1 Amp. The heat dissipated by the regulator is a function of the current used by the circuit and the difference between the input voltage and 5 volts. An optional heat sink is listed in the component parts list. The heat sink is not required if the circuit is not modified and you operate it on input voltages between 7 and 18 volts. However, if you modify the circuit to utilize more than 150 milliamps of 5 volt power, or power the circuit with input voltage greater than 18 volts, the heat sink should be attached to the voltage regulator.
Photos and Video
Here are a few photos taken during fabrication and a short video of the firebox in operation.
Click on the following link to view a high definition 14 second video of the firebox in operation.
Table 2 provides a detailed listing of the required components with part numbers and sources. One of the components will require simple modification before installation. The instructions for modifying this component are contained in the Modification Section of this article.
|ITEM||DESCRIPTION||SOURCE & P/N|
|PCB1||Multi-purpose Printed Circuit Board||Radio Shack 276-150|
|J1/P1||2-Pin Connector w/ Mating Header||All Electronics CON-242|
|J2/P2 SEE NOTE 1||5 Conductor Jumper w/Mating Headers||All Electronics CON-55|
|J3/P3||4-Pin Connector w/Mating Header||All Electronics CON-244|
|IC1||Integrated Circuit, 7805T, 5V Pos. Reg., LM340T-5, TO-220||Unicorn Electronics 18-1360|
|IC2||Integrated Circuit, NE555V, Timer, MC1455P, Single Timer||Unicorn Electronics 18-1360|
|IC3||Integrated Circuit, 74LS164, 8-Bit Serial Shift Register||Unicorn Electronics 18-0390|
|IC4||Integrated Circuit. 74LS86, Quad 2-Input Exclusive-OR Gate||Unicorn Electronics 18-0315|
|R1||Resistor, 100K ohm, 1/4W, Carbon Film, 5%||Radio Shack 271-1347 (or Assortment*)|
|R2||Resistor, 10K ohm, 1/4W, Carbon Film, 5%||Radio Shack 271-1335 (or Assortment*)|
|R3||Resistor, 1.5K ohm, 1/4W, Carbon Film, 5%||(included in either Assortment*)|
|R4||Resistor, 5.6K ohm, 1/4W, Carbon Film, 5%||(included in either Assortment*)|
|R5, 7, 9, & 11||Resistor, 1K ohm, 1/4W, Carbon Film, 5%||Radio Shack 271-1321 (or Assortment*)|
|R6, 8, 10, & 12||Resistor, 2.2 K ohm, 1/4W, Carbon Film, 5%||Radio Shack 271-1325 (or Assortment*)|
|R13||Resistor, 56 ohm, 1/4W, Carbon Film, 5%||(included in either Assortment*)|
|R14||Resistor, 150 ohm, 1/4W, Carbon Film, 5%||(included in either Assortment*)|
|Assortment*||Resistor Asst., 610 piece, 1/4W, Carbon Film, 5%||All Electronics RES-61|
|Assortment*||Resistor Asst., 450 piece, 1/4W, Carbon Film, 5%||Jameco Electronics 10720|
|C1||Capacitor, Tantalum, 0.1uf, 35VDC, 10%||Jameco Electronics 33486|
|C2||Capacitor, Tantalum, 1uf, 35VDC, 10%||Jameco Electronics 33662|
|C3||Capacitor, Radial, 1uf, 50VDC||Jameco Electronics 94161|
|C4||Capacitor, Radial, 2.2uf, 50VDC||Jameco Electronics 93731|
|Q1||Transistor, 2N3904, NPN, General Purpose||Jameco Electronics 38359|
|D1||Diode, 1N4002, Rectifier, 100V, 1A||Jameco Electronics 76961|
|D2||Diode, 1N914/1N4148, Signal, Silicon||Radio Shack 276-1620|
|D3*, 4*, 5*, & 6*||Diode, 1N4002, Rectifier, 100V, 1A||Jameco Electronics 76961|
|LED1, 2, 3, & 4||Orange LED, OT5N15N, 15 Deg., 5mm.||The Led Light LED5-15DG-OR|
|LED5, 6, & 7||Warm White LED, YZ-WS3D60, 60 Deg., 3mm.||The Led Light LED3-60DG-WWY|
|ICS2||Socket, IC, 8-Pin, High Reliability||Jameco Electronics 51626|
|ICS3 & 4||Socket, IC, 14-Pin, High Reliability||Jameco Electronics 37197|
|HS1*||Heat Sink, TO-220, Black Anodized Aluminum||Jameco Electronics 158051|
|NOTE 1 – modify jumper per instructions in Modifications Section|
|* denotes optional components|
Table 2 – COMPONENT PARTS LIST
Some of the components listed are available at discounted prices when purchased in quantity. For example, resistors are only a few cents each when purchased in larger quantities. You can buy them individually or in small quantities from many suppliers, but expect to pay more for each resistor. Radio Shack sells packages of five resistors for $0.99, although they do not carry all of the needed values. I find it more economical to buy a resistor assortment which typically includes five to ten of every common value. Two resistor assortments are identified in the component parts list as optional items. Either of these assortments will provide all of the needed resistor values
In addition, you will need approximately one foot of solid 22AWG or 24AWG hook-up wire to make short jumper wires. These jumper wires will be soldered between various pads on the circuit board to interconnect the components. You may also need to extend the length of the wires from the circuit board to the individual LEDs with short lengths of 26AWG or 30AWG hook-up wire depending on where you mount the circuit board inside of the locomotive boiler
Here are the Internet addresses for the sources I used to obtain the circuit components. Many of the components are available from more than one source.
All Electronics Corp. Van Nuys, CA. www.allectronics.com
Jameco Electronics Belmont, CA. www.jameco.com
Radio Shack Fort Worth, TX. www.radioshack.com
The Led Light Carson City, NV. www.theledlight.com
Unicorn Electronics Johnson City, NY. www.unicornelex.com
Preventing Electrostatic Discharge (ESD) Damage
None of the active components (ICs, LEDs, diodes, and transistor) used in this circuit are critically susceptible to ESD. The passive components (resistors and capacitors) are – for the most part – “bullet-proof” with regards to ESD. However, any electronics device can be damaged or destroyed by static electricity. Use common sense and avoid unnecessary handling of the components. Keep them in their original packaging or in ESD protective bags until you are ready to install them on the circuit board. Touch a metal object to discharge static from your body before handling components. Use a grounded soldering iron. Don’t assemble the circuit on the day you create sparks just by walking across the carpet (a little relative humidity makes a big difference!)
Component Polarity and Markings
The negative lead on an axial diode (D1 – D6) is marked with a line. The positive lead on a tantalum capacitor (C1, C2) is longer than the negative lead. The negative lead on a radial capacitor (C3, C4) is marked with a line. The positive lead on a light emitting diode (LED 1- LED7) is longer than the negative lead. If you look through a LED, the anode or positive side will be smaller than the cathode or negative side. Some LEDs have a flat spot on the lens on the side with the cathode or negative lead. Resistors have no polarity. Resistor values are indicated by colored bands. Here are the color codes for the resistors used in the circuit.
|RESISTOR||VALUE||1ST BAND||2ND BAND||3RD BAND||4TH BAND|
|R5, R7, R9, R11||1K||BROWN||BLACK||RED||GOLD|
|R6, R8, R10, R12||2.2K||RED||RED||RED||GOLD|
Table 1 – RESISTOR COLOR CODES
Assembling the Circuit
Figure 2 shows where the various components are located on the printed circuit board. The gray areas represent the various discrete components and the black circles indicate pads on the circuit board that are soldered. This is the component (topside) view of the board – the actual copper traces and pads are on the circuit (underside) side of the board.
The blue lines represent the leads from the discrete components. Several of these component leads are used as short jumpers to bridge to adjacent solder pads. These jumpers may be on the on the topside of the board (solid blue line), underside of the board (dashed blue line), or both.
The other various colored lines represent the jumpers made from pieces of hook-up wire needed to interconnect the components on the topside of the board. All of these jumpers are on the topside of the circuit board. The color of the jumpers has no special significance – I just used different colors on the figure to make it easier to read.
Before you start assembling the circuit board, clean the copper pads on the underside with a “bright-boy” track cleaner or a “Scotch-brite” scrub pad. This will make soldering much easier. Wash the circuit board in warm soapy water, rinse in hot water, and let it dry thoroughly. Begin by soldering on the wires that run under the sockets for IC2, IC3 and IC4. Then add the sockets, jacks, and remaining components (IC1, resistors, diodes, capacitors, and transistor.) When you solder the jacks J1, J2 and J3 to the board, leave the mating plugs attached to the jacks. This will keep the pins aligned properly while the jack is hot from the molten solder.
After all soldering is completed, clean any rosin flux residue from the board (I use an old toothbrush and warm soapy water.) Rinse and let it dry thoroughly. Inspect the board to insure you haven’t accidentally made any solder bridges between the various pads on the circuit board. Check for continuity between various points on the circuit board with an ohmmeter, using the schematic as a reference.
Insert IC2, IC3, and IC4 into their respective sockets, being careful not to bend any pins on the ICs. Cover the bottom (solder side) of the circuit board with insulating material such as vinyl electrical tape. This will help prevent accidental shorts after the circuit board is installed into the boiler.
J2/P2 jumper modifications:
The J2/P2 jumper identified in the component parts list consists of a 3-inch long, 5-conductor, 22AWG cable assembly with a plug and mating jack on each end. You only need one of the plugs and jacks. Cut-off all five wires flush near the edge of one of the plugs as shown in Figure 3. The jacks are identical, but the pins are numbered differently on the two plugs. Keep the plug that has the black wire connected to Pin 1. Note: Pins 1 and 5 are labeled on the plugs.
Installation of Firebox LEDs
Here is how to install the firebox LEDs in a large-scale locomotive, such as a Bachmann “Annie.” Steps for disassembly and reassembly of the locomotive are not included and should be performed in accordance with the manufacturer’s instructions.
- Cut a ¾” long section from the bottom of a 1” diameter clear plastic medicine vial with a razor saw to make a housing for the firebox LEDs.
- Drill eight small holes in the bottom of the vial to mount the LEDs as shown in Figure 4. The holes need to be large enough for the LED leads to pass through. The exact position of the holes is not critical.
- Insert the four orange LEDs into the housing with the leads extending out through the holes in the bottom. You want the four positive leads in the holes toward the center of the housing and the four negative leads in the holes toward the outside edge.
- Secure the LEDs in the housing with a hot glue gun or clear silicone caulk. Don’t worry about being neat with the glue – it actually helps diffuse the light even more.
- Bend the positive leads toward each other so that they can easily be soldered together.
- Verify that the 3-inch long wires on connector P2 (the component you modified) will reach from the back of the firebox door to the intended location for the circuit board in the boiler. If you need to extend the length of the wires due to the positioning of the circuit board in the boiler, just solder extensions onto each of the five wires. The extension wires can be smaller gauge than the 22AWG wires in the cable; you can drop all the way down to 30AWG without a problem.
- Solder the four positive leads from the LEDS together and attach to the black wire that goes to connector P2, Pin 1.
- Solder the negative lead from each of the LEDs to one of the four remaining wires that go to plug P2, Pins 2, 3, 4, & 5. It is not critical which LED goes to which wire.
- Ensure all four negative leads are insulated from each other and from the common positive lead – heat shrink tubing works well for this.
- Crumple a small piece of aluminum foil sized to fit the inside wall of the vial. Straighten it out and glue it inside of the vial. The foil reflects light emitted from the sides of the LEDs back into the housing.
- Wad up a small 2” square piece of clear plastic kitchen wrap (“Saran-wrap”) and stuff into the vial around the LEDs. Secure the plastic wrap to the vial and LEDs with a dab of clear nail polish. The plastic wrap serves as a light diffuser.
- Paint the bottom of the vial black. The black paint keeps light from escaping behind the housing into the boiler.
- Attach the completed firebox LED housing to the back of the boiler backhead, behind the firebox door. I used Ailene’s “Tacky-glue” so it could be easily removed later if necessary.
Installation of Classification Lamps
Here is how to install the classification lamp LEDs in a large-scale locomotive, such as a Bachmann “Annie.” Steps for disassembly and reassembly of the locomotive are not included and should be performed in accordance with the manufacturer’s instructions.
- Verify that the wires from connector P3, Pins 1 and 2 will reach from the desired position of the classification lamps to the intended location for the circuit board in the boiler. If you need to extend the length of the wires due to the positioning of the circuit board, just solder extensions onto the two wires. The extension wires can be smaller gauge than the 22AWG wires in the cable; you can drop all the way down to 30AWG without a problem.
- Route the two wires through the interior of the boiler and bring out through the front of the boiler.
- Prepare and paint the classification lamp metal castings per your preferred method. I clean any flash with an X-acto knife and a small file, then wash and rinse them thoroughly before painting.
- Ensure positive and negative leads on LED5and LED6 are insulated from each other. Heat shrink tubing works well for this.
- Glue a LED into each casting.
- Mount the classification lamps onto the front of the smokebox and route the wires from the two LEDs through the smokebox.
- Splice the positive leads from the two LEDs to the wire that goes to Plug P3, Pin 1.
- Splice the negative leads from the two LEDs to the wire that goes to plug P3, Pin 2.
Installation of Interior Cab Light
Here is how to install the interior cab light LED in a large-scale locomotive, such as a Bachmann “Annie.” Steps for disassembly and reassembly of the locomotive are not included and should be performed in accordance with the manufacturer’s instructions.
- Verify that the wires from connector P3, Pins 3 and 4 will reach from the underside of the cab roof to the intended location for the circuit board in the boiler. If you need to extend the length of the wires due to the positioning of the circuit board, just solder extensions onto the two wires. The extension wires can be smaller gauge than the 22AWG wires in the cable; you can drop all the way down to 30AWG without a problem. (Note: I prefer to use 26AWG or 30AWG wire for the exposed portion of this installation as it is much easier to work with and hide.)
- Route the two wires from the circuit board in the boiler into the cab and secure to the cab walls and ceiling with CAA super-glue.
- Solder the negative lead from LED7 (cab light LED) to the wire that goes to plug P3, Pin3.
- Solder the positive lead from LED7 (cab light LED) to the wire that goes to plug P3, Pin 4.
Tools and Additional Materials Needed
Here is a list of the tools and other materials I used in completing this project.
- Soldering Iron
- Solder (Rosin-core, tin/lead, 60/40 or 63/37)
- Diagonal Cutting Pliers – for cutting wires and component leads
- Needle-Nose Pliers – for bending wires and component leads
- Wire Stripper – for stripping insulation from wires
- Razor Saw – for cutting plastic medicine vial
- Pin vice with small drill bit – for drilling holes in the medicine vial to mount LEDs
- Multimeter – for checking circuit continuity
- Scotch-Brite Scrub Pad (or Bright Boy) – for cleaning circuit board before soldering
- Small Plastic Medicine Vial – to make housing for firebox LEDs
- Cear Silicone Caulk (or hot glue) – to secure LEDs in housing
- Vinyl Electrical Tape – for circuit board insulation
- Heat Shrink Tubing – for wiring insulation
- Hot Air Gun – for shrinking the heat shrink tubing
- Aluminum Foil – for light reflector on inside wall of housing
- Back Paint – for light block at rear of housing
- Plastic Kitchen Wrap (Saran-Wrap or equivalent) – for diffusing light in housing
- Ailene’s Tacky Glue (or equivalent) – for mounting housing
- Cyanoacrylate Adhesive (CAA Super-glue) – for mounting marker lamps and cab light
- Old Toothbrush – for cleaning circuit board
- Dish-washing Detergent – for cleaning circuit board
- Clear Nail Polish (or equivalent) – for securing plastic kitchen wrap in housing
- Double-sided Adhesive Tape – for mounting circuit board in boiler