# Firebox Effect



## rhyman (Apr 19, 2009)

Back in April of 2010, I posted an article called "Auxiliary Lighting Circuit." It was a "how-to" article that described how to build and install the circuit in large-scale steam locomotive models. The circuit provides constant voltage and current for engine LEDs used for classification lamps and interior cab lighting. It also generates a firebox effect with LEDs that mimics a hot fire. I never did post any photos on-line, and few folks (other than those that go to Marty's Thingy every year) have ever seen it in operation. Now that I know how to insert video I thought I would share it with the group.

Here is a short 13 second clip of the firebox in a Bachmann "Annie"



Enjoy,


----------



## williep99 (Sep 19, 2008)

Beautiful and one of the most realistic I've seen.

Bill


----------



## Therios (Sep 28, 2008)

looks like the articles are taken down for security holes... could you repost it here in the forum?


----------



## rhyman (Apr 19, 2009)

There is a copy of the article posted on my web site at: Auxiliary Lighting Circuit. This was the original circuit I used for the Bachmann "Annie." There are no photos in the article, but there is a schematic, a few figures, a parts list, and a circuit board layout drawing.


There are a couple of photos of the circuit card in another article on my web site called: C-19 Battery Conversion. Go down to the Part 2 (draft) section of the article. I made a couple of minor changes to the circuit to handle different LED currents in the C-19.


----------



## Therios (Sep 28, 2008)

I just did not look deep enough on your website. I "did" look, but not in the right places. Thanks for linking them, I really appreciate it. I like your idea. I am thinking of replicating your algorithm in a PIC. I will let you know. Might need a pointer or two.


----------



## wigginsn (Jan 9, 2008)

That looks really good Bob, a lot better than others I've seen. I'm seriously considering building a couple to try out.. 

Cheers 
Neil


----------



## rhyman (Apr 19, 2009)

Therios,



If you decide to use a microcontroller, such as a PIC, there is no need to replicate my algorithm. All you need to do is generate a series of random numbers. Load your random numbers into four different countdown timers. When a timer times out, simply flip the status of an output to one of the four firebox LEDS (either on or off.) Reload the timer with the next random number and continue on as long as power is applied. The four LEDs will cycle on and off with apparent randomness.


There are various methods ranging in complexity for generating random numbers. A simple algorithm is the Linear Congruential Method which has the following form: n+1mnmod (x) is equal to the remainder left when you divide x by m. Conveniently, the result of every operation performed in a PIC program is effectively given modulo 256. There are a number of restrictions on the choice of a and c in the above equation that maximize the randomness of the sequence. For example, you could pick a = 3 and c = 63. You also have to pick a “seed”.



You can set up this model on a spreadsheet and examine its pseudo-random properties. First, you should notice that the randomness of the sequence does not appear to be sensitive to the seed. You should also observe that the sequence repeats itself every 256 numbers. This is an unfortunate consequence of the algorithm, but it does replicate the repeat cycle of my discrete component method. Picking a larger modulus will increase the period accordingly.


There are a lot of sample programs available for things like the simulated rolling of dice. The code in any of these could easily be adapted to suit your needs. Good luck and let me know how it turns out.


----------



## Paulus (May 31, 2008)

Now thats a very realistic effect! Superb!


----------



## gnichols (Jan 9, 2008)

I was gonna say way cool... way hot! It is very nice. Thanx for the video and reposting your link. Gary


----------

