Current Sense Train Detector

by Rich Weyand, with Bill Pistello & Bill Reid


Home
This model railroad electronics article originally appeared in Mainline Modeler magazine in the February 1994 issue. Excerpts of it will also be published in N-Scale magazine sometime in 1995. 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 fourth in our series of articles describing a set of electronic building blocks we have designed to control our model railroad layouts: my N&W Pocahontas Division, Bill Pistello's Union Pacific, and the Reid brothers' Cumberland Valley System. In the first three articles we discussed SwitchWitch, SwitchLock, and SwitchMap, three electronic modules for switch machine control. This article will begin a group of articles on signal control with a discussion of DetectTrain, a current sensing train detector.

As I was preparing this fourth article in the series, which was to discuss BlockLock, the CTC panel block signal control circuit, I realized that the logical continuity would work better if we discussed the current sensing train detector first, so we have switched the order of these two articles.

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.

Importance of Train Detection

Train detection is central to the operation of signal systems both on the prototype and the model. In fact, train detection is the only requirement for certain types of signal systems. Among other things, the signal system indicates to train crews if it is safe to proceed according to the train orders and schedule. The primary concern with regard to safety is simple: Is the track clear of trains and equipment? This primary concern is so central that it is not left open to human error. Signal systems are connected to train detectors to guarantee that permission to proceed cannot be indicated by the signal system unless the track is clear.

Signal systems indicate many other things as well, including: which track to take at a siding or auxiliary main, which track is aligned, operator permission to proceed, distance to the next train in front, existence of broken rails, derail positions, and electric lock switch positions. But train detection is central.

On the prototype, trains are detected by placing a voltage across each block, or insulated section of the rails. This voltage can be used to pull up relays in relay boxes and relay houses along the main line to drive signals. When a train or piece of equipment is in the block, the voltage across the rails is shorted (shunted, in railroad language) by the steel axles of the equipment, and the relays fall to the position which indicates the block is occupied. Note that the relays must be pulled up into the unoccupied position; this ensures that if power goes out, a wire breaks, or other failure occurs, the relays fall to the occupied position, preventing train movements over track which may not be clear.

For the model railroad, several different types of train detector are available. One is the optical, or infrared train detector, which uses a light beam to detect equipment. When equipment breaks the beam, the detector detects. This type of detector is very good for sensing the exact position of a piece of equipment, and we like this type for sensing the proper stopping position for trains on hidden staging yards and engine house tracks. We will discuss an optical train detector later in this series.

The other type of detector most often used on model railroads is the current sensing type. This type of detector senses current across the rails over an insulated section of track, and is therefore most like the system used on the prototype. We strongly prefer this type of detector for block signal systems, because prototype situations and operation are easier to model with this type.

The Circuit

The circuit we designed, which we call DetectTrainTM, 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 this circuit in order to build and use it, but for those who want to know:

Follow the circuit from the input COMMON. COMMON is the common rail lead from the block in which trains are to be detected by the circuit. The current through the engine or lighted car passes through the common rail, into the DetectTrain circuit, and through diodes D2 and D5 to ground. If this current is positive, COMMON will be at 0.6 Volt above ground. If this current is negative, because the throttle is reversed, COMMON will be at 0.6 Volts below ground. If no train is in this isolated block of track, COMMON will be at 0 Volts.

The first two sections of the LM324 IC sense the voltage on COMMON. The minus input of each of these op amps is held slightly above ground by resistors R9 & R12 and R11 & R15. This ensures that if there is no train in the block and the voltage at COMMON is 0 Volts, the output of both of these op amps will be at GND. If the voltage at COMMON is 0.6 Volts, the upper op amp's plus input will be at a higher voltage than the minus input, and it's output will go to VCC, the supply voltage. If the voltage at COMMON is -0.6 Volts, the lower op amp's minus input will be at a lower voltage than the plus input, and it's output will go to VCC. The minus input on the lower op amp will actually go to a voltage slightly lower than GND, but this is within the operating specifications of the LM324.

Diodes D3 and D4 select the higher of the two outputs from the first two op amps: if either op amp output is at VCC, that is, there is a train in the block so that either positive or negative current is flowing through COMMON, the minus input to the third op amp will be VCC. R6 and R7 divide VCC to provide a voltage of 1/2 VCC for the plus inputs of the last two op amps.

Resistors R1 and R2, capacitor C1, and diode D1 form a time delay which has a different time constant rising than it does falling. When a train enters the block, the third op amp output goes to GND, and R1 and C1 provide a delay of about 0.1 second before the fourth op amp output goes to VCC and drives the open-collector output Q1, pulling the output OCCUP to ground. When a train exits the block, the third op amp goes to VCC, and R2 and C1 provide a delay of about 1 second before the fourth op amp output goes to GND, turning off Q1, and allowing the OCCUP output to rise.

Note that C1 must be charged to allow the OCCUP output to rise, indicating unoccupied. This ensures that, when layout power is first turned on, the detectors will hold their OCCUP outputs low for one second, knocking all the signals on the railroad down to red indications.

The LED before the third op amp is to allow the user to adjust the R4 sensitivity control without needing to wait for the delay feature on the output.

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 and C3 to match the polarity indication in the component placement diagram; electrolytic and tantalum 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 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.

The Power Supply

The design of the circuit allows the power supply voltage provided to the unit to be anywhere in the range of +5 Volts to +15 Volts. This very wide acceptable power supply range makes it easier to power the circuit with an existing supply, or you can build a separate power supply as shown in Figure 3. The use of the AC tickle voltage shown will be explained a bit later. 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!

If you are using the circuit on a modular layout, the power supply voltage can easily be provided by a lantern battery or batteries. To make battery operation easier, the circuit has been very carefully designed to use very little current when not detecting, and even when detecting, the supply current required is under 25 mA for a 12 Volt supply voltage, and under 10 mA for a 5 Volt supply voltage. The low current draw of the circuit makes it possible to run a modular layout detection system for a whole weekend on a lantern battery or two.

Using the Circuit with Cab Control

When used in a block control, or cab control, system, the circuit should be wired as shown in Figure 4. Pin 1 of the connector is the leftmost pin when looking at the component side of the board with the connector at the top; this pin has a square solder pad.

The COMMON input is connected to the common rail, the rail to which the throttle grounds are normally connected. The grounds of the power supply, the detector circuits, and the throttles are connected together as shown. Note that the block boundaries of the throttle selection blocks and the block boundaries of the train detection blocks, or signal blocks, need not correspond. Insulated gaps in the hot rail will define the limits of throttle selection blocks, and insulated gaps in the common rail will define the limits of signal blocks, but these block boundaries need not be in the same place, and there need not be the same number of throttle selection blocks and signal blocks.

The AC tickle voltage is to ensure that trains can be detected in a block even if the throttle is turned off, or the block selector switch shown is set to an off position. Use a 3.3 KOhm 1/4 Watt resistor to connect the block selector to the AC tickle of the power supply. Without this small AC current, turning off the throttle or the block selector switch will result in no voltage on the tracks, no current through the train and detector, and no detection of the train. The AC current is just enough to trigger the detector, and falls far short of the value required to heat up engine motors, even can and instrument motors. If you are running your layout on batteries, the DC supply voltage for the circuit can be used instead of AC; as with AC, use a 3.3 KOhm 1/4 Watt resistor. An AC current is preferred so that when a train is stopped, but the throttle is not quite at zero, the throttle current and the tickle current cannot cancel and result in the train being undetected.

Using the Circuit with Command Control

When used in a command control system, the circuit should be wired as shown in Figure 5. Pin 1 of the connector is the leftmost pin when looking at the component side of the board with the connector at the top; this pin has a square solder pad.

The COMMON input is connected to the common rail, the rail to which the base unit grounds are normally connected. The grounds of the power supply, the detector circuits, and the base units are connected together as shown. Note that the block boundaries of the base unit blocks and the block boundaries of the train detection blocks, or signal blocks, need not correspond. Insulated gaps in the hot rail will define the limits of base unit blocks, and insulated gaps in the common rail will define the limits of signal blocks, but these block boundaries need not be in the same place, and there need not be the same number of base unit blocks and signal blocks.

No AC tickle current is required when using the detector with command control systems as the track voltage is never shut off. The track voltage from the base unit will ensure detection of trains even if they are stopped.

Installation

The circuit board has been kept very small so that it can be mounted in tight locations under the layout. Individual detectors can be mounted using plastic spacers and nylon washers, with #6-32 x 1" sheet metal screws. Multiple detectors 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.

Adjusting the Detection Sensitivity

The circuit should reliably detect, and light the on-board LED, whenever a resistance of 10 KOhms or less is placed across the rails, but should not detect for a resistance of 50 KOhms or more. To adjust the sensitivity, place a 30 KOhm 1/4 Watt resistor across the rails and adjust R4 so that the LED on the detector circuit board goes out. Now turn R4 the other way until the LED lights. Removing the 30 KOhm resistor should result in the LED going out again. Do not try to adjust the sensitivity by watching the LED occupancy signals on your CTC panel; the one second delay for the detector circuit to clear after detecting makes it virtually impossible to properly adjust the sensitivity this way.

Be aware that damp scenery materials conduct electricity better than dry scenery materials. After ballasting track, or applying other scenery materials, the unit may detect, based on the lowered resistance across the rails. The unit then needs to be readjusted for proper operation until everything is completely dry.

Detecting Unpowered Equipment

The detector will detect any equipment which produces a resistance across the rails of 10 KOhms or less. The unit will therefore detect locomotives, lighted cars, sound-equipped cars, and so on, but it will not detect unmodified cars which draw no power from the rails. To detect this equipment, a 10 KOhm 1/4 Watt resistor should be installed on one axle of each car to be detected, between the metal treads of the wheels on that axle. For layouts which operate with cabooses on the end of trains, it may be sufficient to simply equip the caboose with an axle resistors so that both ends of the train detect. We put two resistor-equipped axles on each caboose, one on each truck, to ensure that a dirty wheel or stopping on a dirty piece of track or plastic frog will not result in the end of the train being undetected.

A simple technique for equipping cars with axle resistors is to use conductive paint. Using ACC, glue the body of a 10 KOhm resistor to an axle equipped with metal wheel treads. Bend the leads to contact the inside surface of the metal wheel tread, and connect the leads to the wheel treads with conductive paint. Test the resistance across the wheels with an ohmmeter to make sure that the leads are connected to the wheels.

A new product from Jay-Bee makes installing axle resistors even easier for HO modelers. They now offer replacement metal wheel sets which have molded resistors in place of the axle insulators. We are talking to Jay-Bee about making a similar replacement wheel set for our N scale layouts.

Undetected Blocks

Track blocks which are not equipped with detectors will need to have 1N5400 diodes inserted into the track power lead from the common rail to the throttle or base unit ground as shown in Figure 6. These diodes are necessary to ensure that detected and undetected blocks see the same voltage across the rails at a given throttle setting. Without these diodes in the ground lead of the undetected blocks, locomotives crossing the boundary from a detected to an undetected block will see an additional 0.6V across the rails and will very noticeably speed up as they cross the detection block gaps.

Using the Circuit to Drive Occupancy Indicator LEDs

The circuit has an open-collector output capable of sinking 200 mA to ground, sufficient to drive a dozen LEDs. Be sure to use a series resistor with each LED to limit the current through the LEDs to 20 mA each, shown in Figure 7, as the circuit has more than enough capacity to burn out your LEDs if you neglect to include the resistors. Note that the voltage used to supply the units and the LEDs need not be the same. The resistor value can be calculated using this equation:

Resistor value in Ohms = (LED supply voltage in Volts - 2 Volts) x 50 Ohms/Volt

For an LED supply voltage of 5 Volts, use 150 Ohms; for an LED supply voltage of 12 Volts, use 500 Ohms; etc.

Detector Locations at Block Signals

One way to locate your detectors and signals is to gap the common rail between detected sections right at the location of the signal mast or bridge. In no case should the gap be before the signal from either direction. On the prototype, current law requires that the insulated gaps not be before the signal, and that they be no more than six feet after the signal, from either direction. In the fifties, the law also required that the insulated gaps not be before the signal, but they could be as much as two rail lengths, or 78 feet, after the signal, from either direction. In operation, the time delay from the time the locomotive moves across the insulated gap until the signal goes to red can be several seconds, allowing the train to move well past the signal before it changes. One way to simulate this time delay on the model is to put the detector gaps for both directions after the signal by a hundred or two hundred scale feet, with an undetected section between.

Figure 8 shows how to set up such a situation, using 1N5400 diodes in the undetected section as previously discussed. An undetected section of 150 feet on either side of the signal will provide a time delay between the locomotive passing the signal and the signal falling to red of about two seconds for a 60 mph train, and about four seconds for a 30 mph train.

You can achieve the same time delay if you stagger the signals by a hundred or two hundred scale feet on either side of a single gap. On the prototype, the signals for opposing directions are not always mounted on the same mast or lined up directly across from each other. You may not have convenient locations to mount the signals this far apart, and in operation, this arrangement can be confusing for model operators who are more familiar with opposing signals being located together.

Driving Automatic Signals

In order to operate block signals in a truly prototype manner, with Automatic Block Signaling (ABS) or Centralized Train Control (CTC), additional logic circuitry is required. However no additional circuitry is required to automate signals in a simple way to add action and interest to your layout. The diagrams show how to automate LED and bulb block signals using the circuit. Note that the voltage used to supply the units and the LEDs or bulbs need not be the same. We have shown neighboring undetected blocks connected through 1N5400 diodes as previously discussed.

In the case of LED block signals, the LEDs at both ends of the block can be driven by the circuit directly, as shown in Figure 9. Use 1N4000 series diodes (Radio Shack 276-1653) at the signal locations as indicated; the banded end of the diodes must be toward the OCCUP output of the circuit. The value of the LED dropping resistor can be calculated from the LED supply voltage as previously discussed.

In the case of bulb block signals, a relay should be used to handle the current required to drive the bulbs, as shown in Figure 10. Pick a relay with the same coil voltage requirement as the bulb voltage. Radio Shack has several suitable relays with coil voltages from 5 to 12 Volts. Make sure the relay will operate on less than the 200 mA output rating of the circuit. Use a 1N4000 series diode to damp the coil shutoff surge voltage as shown. The banded end of the diode must be toward the bulb power supply and away from ground.

Computer Control and Command Control

We designed the modules in this series with open-collector outputs and active-low inputs so we can more easily interface them to a computer or to command control later if we want to, although none of us currently has any plans to do so. For you computer hobbyists and command control guys out there who are now wondering if DetectTrain would make a good detector circuit to interface your machine to the layout, this module was designed with that in mind.

Conclusion

The detector circuit presented here is a key element in our block signal system. Next time we'll connect these detectors to a new circuit module, the BlockLock CTC panel block signal control circuit, and show how to use it to build a complete CTC block signal system. We'll also show how to use these circuits to build interlocking plants with prototype operation. This system is in use on Bill and Wayne Reid's Cumberland Valley System, and has resulted in a very easy to operate CTC system which has made operating sessions much more enjoyable for operators and crews. See you then!


Copyright 1992 - 2012 by TracTronics, Incorporated.
Last updated: December 28, 2011
These pages maintained by: Marc Haas