Programmable Flasher

by Rich Weyand, with Bill Pistello & Bill Reid


Home Site Map
This model railroad electronics article originally appeared in Mainline Modeler magazine in the July 1994 issue. Excerpts of it will also be published in N-Scale magazine sometime in 1995 or 1996. We would like to thank Bob Hundman of Hundman Publishing, publishers of Mainline Modeler and N-Scale, for being so supportive of our projects and encouraging us to make these articles available on-line.

Information on ordering a commercial kit or assembled and tested unit of this circuit is available from the TracTronics Price List.


A Modular Electronic Control System

This is the seventh in our series of articles describing a set of electronic building blocks we have designed to control our model railroad layouts: Rich Weyand's N&W Pocahontas Division, Bill Pistello's Union Pacific, and the Reid brothers' Cumberland Valley System. This article will continue the articles on train detection and signal control with a discussion of MasterFlasher, a programmable rate multiple output flasher circuit. This circuit is a really neat one that you may want to build even if you don't use any other electronics on your layout.

We are presenting these circuits both as circuit diagrams and as circuit layout patterns, allowing readers to breadboard or etch their own circuits. For those who do not wish to breadboard or etch these circuits, both kits and assembled & tested units are available from TracTronics, 1212 South Naper Boulevard, Suite 119, Naperville, IL 60540 (708-527-0000). As before, thanks to our friends Steve and Scott Ackerman of ACS in Sarasota, Florida (813-377-5775) for the excellent layout work on these circuit boards.

Flashing Indicators

We need flashing indicators on our layouts for multiple purposes. The center red occupancy indicator LEDs on our CTC panels flash to indicate a locked block is occupied without permission. We use flashing red signal indications as 'take siding' signals for the entrance signals into our towns. We use flashing red LEDs for cross bucks and crossing gates at grade crossings. We use flashing red LEDs on 'airplane catchers' such as radio antennas, building roofs, and water towers. Finally, we use flashing red, yellow, and blue LEDs for police cars, fire engines, ambulances, and construction barricades.

Using flashing indicators became a lot easier with the advent of self-flashing LEDs, in which the flasher circuit is built into the LED. For many applications these work fine. But many of the applications need LEDs which flash in unison, or which flash alternately. Multiple warning LEDs on a panel take on a Christmas tree appearance and are very distracting when they each flash randomly instead of in unison, while lights on crossing gates and cross bucks, building and tower markers, police and fire light bars have the most realistic appearance when they flash alternately. The self-flashing LEDs are not available yet in the smaller sizes which our three N scale layouts would need. Finally, the self-flashing LEDs flash at a fixed rate of about once per second; some of our applications should flash faster than that, and many need to flash slower.

When we were discussing the problem, Bill Pistello pointed out that for signals on the prototype, which he maintains, flashing signal indications within the yard and on the panels all flash in unison. They are all powered from a master relay which serves as the flasher for all flashing indications required. We thought we would do something similar.

What we wanted in a flasher circuit were the following features: a programmable rate flasher, that we could set to any flash rate we wanted over a wide range of values; multiple outputs which would flash alternately; multiple outputs which could either source or sink current, so that we could control the other lead to the LEDs with train detectors, signal controls and other electronics; and enough voltage and current capacity to drive a lot of LEDs or even bulbs and buzzers.

The Circuit

The circuit we designed, which we call MasterFlasherTM, is shown in Figure 1, with the component values and part numbers given in Table 1. You do not need to understand the operation of the circuit in order to build and use it, but for those who want to know:

The time base signal comes in the CLK input in the lower left of the diagram. This time base signal is the AC voltage from the power supply transformer, and can vary over a wide voltage range, from 5 volts AC to 24 volts AC. The resistors R1 and R5, diodes D1 and D2, and capacitor C4 convert this signal to a 5 volt slow square wave at 60 hertz. This square wave does not have the fast rise and fall times needed to drive logic circuitry, so the square wave is buffered by a 7414 inverter before being used. The 7414 Schmitt-trigger inverter circuit is specially designed to convert slow moving signals to sharp-edged logic-compatible signals.

The resulting 60 hertz square wave clock is used to drive two 74LS161 four-bit counters. The first counter is wired to load its starting count value from the BASE RATE jumpers. If the BASE RATE jumpers are set to 15, the counter will count only one count before producing a carry output and reloading. If the jumpers are set to 0, the counter will count 16 counts before producing a carry output and reloading. The second counter only counts when the carry output of the first counter is high. If the first counter is loading 15, then the second counter will count every clock pulse, at 60 hertz (60 times per second). If the first counter is loading 0, then the second counter will count every sixteenth clock pulse, at 60/16, or 3.75 hertz (3.75 times per second).

Any of the four outputs of the second counter can be selected with the OUTPUT jumpers to drive the output circuits. Each output circuit is composed of an op amp driving an open-collector high-gain Darlington transistor capable of switching 5 amps. Two of the output transistors are NPN open-collector transistors which can sink current to ground when conducting, and two of the transistors are PNP open-collector transistors which can source current from the LED supply voltage VLED when conducting. Two of the op-amps are non-inverting and two are inverting, which makes the two NPN transistors sink alternately, and the two PNP transistors source alternately.

The Circuit Board

The circuit etch pattern and component placement diagram are given in Figure 2 for those who want to etch boards, rather than perfboard the circuit. The component placement diagram includes the hole locations to aid in drilling your board. Note that the etch patterns are always printed as seen from the component side of the board, per electronic industry standards. The solder side image must be reversed on the board you build, so that the text and the image are correct.

Note that this is a double-sided board, which makes alignment of the two sides important if you etch your own. Iron on one side and drill two of the holes at opposite ends of the board, then iron on the other side with the two hole pads lined up on the two holes. Also, if etching your own boards, components mounted on the board need to be soldered on both sides to form the connections from the front to the back sides of the boards; use long-tailed IC sockets so you can solder the IC connections on the top.

Please be very careful to install C1 to match the polarity indication in the component placement diagram; electrolytic capacitors will explode when power is applied if they are wired backwards.

This module, like most of the rest of the modules in the series, includes connectors instead of soldering the lead wires directly to the board. As we explained before, we put quite a bit of thought into what kind of connector we wanted, and settled on the Molex KK156 series. These connectors are durable, and will take quite a bit of abuse without bent pins and the like. We did not use screw terminals because we wanted to be able to remove and repair or modify units without having to disconnect and reconnect all of the wires from the screw terminals. You will need a crimp tool for the KK156 connector pins; this tool is Digi-Key WM9903-ND. Dial 1-800-DIGIKEY.

On this unit, while we use an eight pin male connector on the circuit board, we use 2 four pin female connectors on the cabling. This allows the module outputs to be disconnected from the layout while leaving the module inputs connected to the power supply, making it possible to check the flasher operation separately from the layout wiring.

Installation

The circuit board has been kept very small so that it can be mounted in tight locations under the layout. Individual flashers can be mounted using plastic spacers and nylon washers, with #6-32 x 1" sheet metal screws. Multiple flashers can be bolted together with four #6-32 threaded rods inserted through the mounting holes. Use plastic spacers between each pair of boards, and nylon washers at the ends of the threaded rods between the last board and #6-32 nuts. The stack of boards can be clamped against benchwork under the layout using nylon loop cable clamps (such as Digi-Key 7624K-ND) around the spacers.

The Power Supply

The circuit requires a regulated 5 volt supply, as well as a supply for the LEDs or bulbs you will be flashing. You can use the regulated 5 volt supply for the LED supply voltage VLED, but you can also use any other filtered DC voltage up to 32 volts for the VLED supply voltage, to flash bulbs, buzzers, or other devices. Finally the circuit requires an AC input from the power supply transformer to act as the 60 hertz time base.

Many of you who are installing electronics on your layouts will already have a 5 volt supply to power the circuit. You can also build a separate power supply, such as the one we gave in the November 1993 Mainline Modeler for the SwitchLock circuit, which we repeat here in Figure 3. In this diagram we now show the AC voltage used as the time base for the CLK input of the circuit. Please be very careful when wiring 110 volt connections, and to fuse the power supply you build. If you do not know how to wire 110 volt connections, get someone who knows what he is doing to help you, or buy a commercial supply!

Unfortunately, this circuit cannot be run on batteries alone, because of the need for the 60 hertz time base signal. This is the disadvantage of using counters instead of timer circuits such as the 555 IC, but the advantages of a very wide range of programmable flash rates and a very accurate flash rate were more attractive for our needs.

Setting the Flash Rates

The method of setting the flash rates is as follows. 0, 1, 2, 3, or 4 jumpers can be inserted into the four jumper positions labeled BASE RATE. Each jumper inserted into the BASE RATE jumper pad will slow down the rate of all the outputs, proportionately to the number adjacent to the jumper on the schematic diagram and silkscreen. Only one jumper may be inserted into each of the jumper pads labeled OUTPUT 1 through OUTPUT 4. The higher numbers adjacent to the OUTPUT jumper pads correspond to longer on and off times, and therefore slower flash rates.

The flash rates can be calculated from the jumper settings using the schematic and silkscreen numbers adjacent to the jumpers as follows:

Flash Rate = 60 hertz / ((1+sum of jumpers in BASE RATE) x jumper in OUTPUT)

For example, jumpers in BASE RATE in positions 2, 4, and 8, and a jumper in OUTPUT in position 8 will result in a rate of 60 hertz / ((1+2+4+8) x 8) = 60 hertz / (15 x 8) = 60 hertz / 120, which is 1/2 hertz, or 1/2 cycle per second. This is a flash rate of on and off every two seconds, that is, on for one second, off for one second. Table 2 shows the jumper settings for all possible flash rates.

Note that all four of the outputs are controlled by the same BASE RATE jumper settings. The setting used as an example above, with BASE RATE jumpers in positions 2, 4, and 8, is particularly useful because it results in the second counter running at 60 hertz / (1+2+4+8), or exactly 4 hertz. The four outputs can then be independently set for 2 hertz (1/4 second on, 1/4 second off), 1 hertz (1/2 second on, 1/2 second off), 1/2 hertz (1 second on, 1 second off) and 1/4 hertz (2 seconds on, 2 seconds off) using the 2, 4, 8, and 16 jumper positions in the OUTPUT jumper pads, respectively.

Or you can just mess around with the jumpers to get what you want. The slowest rate you can get is 60/256, or 0.234 hertz (2.13 seconds on and 2.13 seconds off), while the fastest rate you can get is 30 hertz. Just don't put more than one jumper into any given OUTPUT jumper pad. You will short two of the second counter's outputs together and cause unfortunate events.

Wiring the Circuit

The circuit should be wired as shown in Figure 4. LEDs connected to OUT1 and OUT2 should be connected through a dropping resistor to power supply voltage VLED as shown. LEDs connected to OUT3 and OUT4 should also be connected through a dropping resistor to ground. You can determine the value of the LED dropping resistors for different power supply voltages on VLED using the same equation we introduced in the article on the DetectTrain module:

Resistor value in ohms = (LED supply voltage in volts - 2 volts) x 50 ohms/volt

For an LED supply voltage VLED of 5 volts, as shown, use 150 ohms; for an LED supply voltage VLED of 12 volts, use 500 ohms; etc. As before, this results in a LED current of 20 mA. Use a larger resistor to dim the LED, and a smaller resistor to brighten it. Be careful not to make the LED current too high; this circuit has more than enough current capacity to fry your LEDs. Bulbs and buzzers, as shown in Figure 4, need no dropping resistor as long as the power supply voltage VLED is the bulbs' and buzzers' rated voltage. Insertion of a switch in the path, as shown in the diagram, allows turning a flashing indicator on and off, such as for a bulb and buzzer to ring a company phone on the layout.

Cross Bucks and Crossing Gates

Figure 4 is okay for flashing LEDs and bulbs continuously, such as for building and antenna markers, police and fire equipment, and construction barricades, but we need to get a little fancier for some other applications. Figure 5 shows how to wire the MasterFlasher together with a DetectTrain module to flash LEDs on cross bucks and crossing gates at grade crossings. The MasterFlasher source outputs OUT3 and OUT4 will alternately power the two LEDs of each cross buck or crossing gate continuously, and the DetectTrain sink output OCCUP will only ground the other lead when a train is detected in the block. Figure 5 will work if all four wires from the LEDs are brought out of the unit, or if the LEDs are wired in common on the cathode end. Note that only one dropping resistor is required for the two LEDs, as only one LED is on at a time.

Figure 6 shows how to solve the problem of a cross buck in which the two LEDs are instead wired in common on the anode end. In this case the MasterFlasher sink outputs OUT1 and OUT2 alternately ground the two LEDs and the DetectTrain sink output OCCUP grounds the coil of a relay which sources the common anode LEDs. Do not forget the 1N4001 diode to reroute the shut-off surge voltage of the relay away from the DetectTrain module, as mentioned in the DetectTrain article. The relay we like to use here is Radio Shack 275-232.

Occupancy Indicators

In the article on the BlockLock module we mentioned that we like flashing center red occupancy LEDs on the CTC panel to ensure that the operator is aware that a locked block has been occupied. If more than one block is so occupied, for instance if crews have been given time and track in more than one town on the layout, multiple self-flashing LEDs flashing out of sync at slightly different rates are distracting, unsightly, and annoying. We can use a MasterFlasher source output OUT3 or OUT4 to power these LEDs instead, so they all flash in unison. Figure 4 of the BlockLock article in the April 1994 issue of Mainline Modeler can be modified to use the MasterFlasher for flashing center red LEDs as shown in Figure 7.

Entrance Signals

In the article on the BlockLock module we showed what we did to implement signals on Bill and Wayne Reid's Cumberland Valley System. The signals we discussed in that article are called head block signals, or absolute signals, on the prototype. We call them exit signals, as they control the movement of trains exiting towns and sidings and proceeding onto single track main lines. We also wanted to implement entrance signals, to control the movement of trains entering towns and double track segments. The entrance signals allow us to give a signal indication to the train crew to take the auxiliary main track, or siding, through a town or double track segment. Entrance signals also allow us to let a train leave a previous town while the next town is still occupied by a train, as we can hold the second train on the single track outside of town until the lead train moves on.

We looked through all of the signal manuals we had to find a signal indication that would give us the functionality we needed with two-color signals and without getting really complicated, and we found what we wanted. While red indication is stop, and green is proceed on the main track, a flashing red signal indication is a take siding signal. Under this signal indication, the train crew is to align the switch for the siding and proceed into the siding at restricted speed prepared to stop short of obstruction, broken rail, or train ahead. Perfect.

Figure 8 shows how to wire the entrance signals using a MasterFlasher sink output OUT1 or OUT2 to provide the flashing function and a DetectTrain module to protect trains on the main. When the rotary switch (Radio Shack 275-1386) is in the center position, the signals at both ends of the town display red indications. If the main track is vacant, when the rotary switch is turned to the left, leftbound trains get the green (main track) indication and rightbound trains get the flashing red (siding track) indication, and when the rotary switch is turned to the right, rightbound trains get the green (main track) indication and leftbound trains get the flashing red (siding track) indication. If the main track in the town is occupied, the operation is the same, except that any green indication will be knocked down to a red stop indication by the DetectTrain module on the main track. Note that we do not need to provide a DetectTrain module on the siding track, because the flashing red indication only gives permission to proceed at restricted speed prepared to stop short of train ahead.

In Figure 8, the diodes are 1N4001 (Radio Shack 276-1653) and the relay is Radio Shack 275-232. The MasterFlasher output used is set for one second on and one second off, which is about the time for prototype flashing signal indications; the natural tendency among modelers is to flash these signals much too fast. Note that while the drawing shows three supply voltages, +5 volts, VLED for the LEDs, and VCC for the detector, in fact these can all be run off of +5 volts if you prefer.

The resulting CTC panel arrangement on the Cumberland Valley System is shown in the photo. Compare this photo with the ones of the CTC panel before we installed the entrance signals, in the April 1994 Mainline Modeler.

How Many Flashers?

You should note that only one output of the MasterFlasher module need be used for all of the entrance signals on the layout, the same output can be used for all of the center red occupancy indications on the CTC panel, two more outputs can be used for all the cross bucks and crossing gates on the layout, and you still have one output left over for other flashing indications. But a note of warning is in order. Signals and panels can flash in unison, and cross bucks and crossing gates can all flash in unison. Also, building and antenna markers, and police and fire equipment lights often flash either in unison or alternately on the same structure or piece of equipment.

However, building and antenna markers, and police and fire equipment lights do not flash in unison across an entire city! Each piece of equipment flashes on its own. If you are going to flash multiple buildings, radio antennas, police and fire equipment, and construction barricades, you are going to need more than one MasterFlasher module to get a realistic appearance. Each piece of equipment does not need its own module, but several modules will be needed to run all the flashing indications to make sure it doesn't look like your whole layout is going on and off at the same time!

Conclusion

The MasterFlasher unit really solved the problem of flashing just about anything on our layouts. We no longer have to put up with a flash rate that's too fast or too slow for the appearance we want, or multiple flashing indications that ought to flash either in unison or alternately, but don't. We solved the entrance signal problem in a way that wasn't more complicated than our signal maintainers and train crews could handle. Also, since we are putting train detectors on our layouts already, we need just one flasher unit to give us operational cross buck and crossing gate lights across the entire layout. Finally, while we can't easily make the people move and the cars drive around on our layouts, working cross buck and crossing gate lights, building and antenna markers, and emergency equipment lights add a lot to the appearance of the layout and the feel of really being there.

We want to thank our readers for the tremendous support for this series of articles. While we had originally planned to discuss the CoolerCrawler high-performance throttle circuit in the eighth and final article of the series, we are going to expand the series by adding several additional articles. Over the next several months we will run articles which will cover:

A new circuit, SafeTrain, which blocks the reversing function on most memory walkaround throttles whenever the train is moving. This ensures that the accidental bump of a button on the hand control, or a noise glitch in the radio control signal, doesn't result in trains going from 40 mph in one direction to 40 mph in the other direction in the blink of an eye.

Radio Control throttles, using a new circuit, RadioTrain, which connects an available RC unit to most memory walkaround throttles. The transmitter is about the size of an audio cassette tape, with no antenna, and will fit in your shirt pocket while you sort car cards. The receiver connects directly to the existing throttle control lines using the RadioTrain circuit.

A simple method for making really dressy black acrylic control panels which are easy to maintain, easy to change, and keep their good looks for a long time. These are the panels that have been shown on Bill Pistello's Union Pacific in this series of articles and in the photos of his layout in Sept/Oct 1993 N-Scale.

Automatic Block Signaling (ABS) with two new circuits, AutoBlock and AutoSearch. This implementation includes three-color indication for position light signals with either LEDs or bulbs, Pennsy and N&W style position lights with either LEDs or bulbs, and search light signals with bi-color LEDs. It is primarily for multiple track main line layouts without CTC control. Those wiring club layouts won't want to miss this one.

Absolute-Permissive Block Signaling (APB) with a new circuit, the WhichWay direction precedence circuit. Together with the ABS circuits, this new circuit will provide APB signaling for single track main lines without CTC control. Again, all three types of signal will be supported. This implementation is the simplest and least expensive we've seen for APB signaling, while retaining most prototype features.

CTC Block Signaling, with intermediate ABS signals, three-color indication, support for all three signal types, direction precedence, interlocked turnouts and crossings, and more. This implementation uses BlockLock, SwitchLock, WhichWay, AutoBlock and AutoSearch to form the complete solution, and it's easier than you think.

The CoolerCrawler memory walkaround throttle circuit we promised. This unit has excellent low-speed and starting performance, high current capacity for multiple unit and helper operation, and it will not heat up locomotive motors even during hours of slow speed yard switching chores. This throttle circuit will include the SafeTrain and RadioTrain features in its design.

After that, who knows. We've got some more stuff in the works; we'll have to see how they turn out. And, of course, if you have something you'd like to see us tackle, let us know. Otherwise, we'll see you next time.


Copyright 1992 - 2001 by TracTronics, Incorporated.
Last updated: June 25, 2001
These pages maintained by: Richard F. Weyand
Please send all comments/problems to: weyand@rcnchicago.com