
This circuit is available in kit form from Bill Pistello at MMRE, 625 South Princeton, Villa Park, IL 60181 (630-832-9152).
This is the sixth 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 group of four articles on train detection and signal control with a discussion of SeeTrain, an infrared optical detector circuit.
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. The SeeTrain infrared optical detector module is available from Modular Model Railroad Electronics, 625 South Princeton, Villa Park, IL 60181 (630-832-9152).
In the first article on train detection and signal control we discussed DetectTrain, a current sensing train detector circuit. We prefer current sensing train detection for most applications, because it is most similar to the train detection method used by the prototype, and is the easiest method with which to model prototype situations. Optical train detection has its place as well, however, and we use it on our layouts where appropriate.
Optical train detection uses a beam of light, usually infrared light which is invisible to human eyes, aimed across the tracks in the path of the train. The usual arrangement is an infrared LED on one side of the track, and an infrared-sensitive opto-transistor on the other side of the track. Variations include orienting the beam vertically, with the LED and opto-transistor above and below the track, and orienting the beam at a 45 degree angle so that the beam does not shine through the gaps between cars. When the train breaks the beam, it casts a shadow on the opto-transistor, which then ceases to conduct electricity. The change in the conductivity of the opto-transistor is detected by the detector circuit, and used to drive LEDs, relays, and other electronics.
The key issue to determine whether to use an optical detector or a current sensing detector is simple: Do you want to know when the train is in the exact position desired, or do you want to know if there is a train anywhere in a length of track? Use a current sensing detector when you want to know if there is a train anywhere in a length of track, such as for block signals, where the detector indicates whether the track is clear through the next signal block or not. Use an optical detector when you want to know if the train is in exact position, such as in engine houses and staging tracks, where the detector indicates whether the train has reached the end of the track or not. With a little effort, either detector can be used in a situation which is more clearly suited to the other, but the results are not as good.
We use the optical detectors at the end of enginehouse tracks, to avoid the unsightly and unprototypical appearance of brick buildings moving across the layout when the end of track is overrun. We also use the optical detectors on staging tracks, which are usually located in places that are hard to see well, to avoid costly damage to rolling stock caused by overrunning the proper position and colliding with end-of-track bumpers, other trains, and the floor. We like to put one optical detector just short of the end of staging yard tracks, to warn us as we approach the end of track and as a later indication that the track is taken, and one at the fouling point of the staging track entrance, to ensure that the train clears the fouling point.
The circuit we use, which we call a SeeTrainTM, is shown in Figure 1, with the component values and part numbers given in Table 1. The circuit board actually contains two circuits, because we generally use these detectors in pairs, and we show two identical circuits in Figure 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 resistor R1 biases the opto-transistor so that when the opto-transistor is not conducting, that is, there is no light on the opto-transistor, the voltage on the minus input of the 741 op amp will be +5 Volts, which is higher than the voltage on the plus input, and the op amp output goes to negative. When the opto-transistor conducts, that is when there is sufficient light falling on the opto-transistor, the voltage on the minus input of the 741 op amp falls below that on the plus input, and the output of the 741 goes to positive. The resistors R2 and R3 determine the voltage against which the input will be compared to determine whether the opto-transistor is conducting or not. The other circuit works in the same way.

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 pattern is printed as seen from the component side of the board, per electronic industry standards. This is a solder side image which must be reversed on the board you build, so that the text and the image are correct.
This module, unlike most of the rest of the modules in the series, does not include connectors. This module is so small and simple and easy to repair in place by replacing IC's, that we just solder the lead wires directly to the board.
This circuit has the widest power supply range of any module in the series. We usually use +5 Volts and -5 Volts to supply the circuit, as indicated on the circuit etch pattern. This allows the circuit to drive bicolor LEDs directly, giving a green indication for no train detected and a red indication for train detected, that is, light beam interrupted. You can also use +9 and -9 Volts to drive LEDs, +5 Volts and Ground to interface the circuit to TTL logic circuits, or +12 and Ground to drive relays, etc. The absolute maximum ratings for the circuit are plus and minus 15 Volts for the supply voltage, and just about anything in this range can be made to work okay. You may have to play with the resistor values a little for other voltages; the values shown are for plus and minus 5 Volts.

Many of you who are installing electronics on your layouts will already have plus and minus 5 Volt supplies to power the circuit. You can also build a separate power supply, such as the one in Figure 3; this circuit gives a regulated plus and minus 5 Volts supply. If you leave out the 7805 and 7905 regulators and the .47 uF capacitors, you have a plus and minus 9 Volt supply which will also work. 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 two lantern batteries. The +6 Volt and -6 Volt DC supplied by the batteries will provide the same operation as the +5 Volts and -5 Volts we use. Connect the positive post of one battery to the negative post of the other; this connection is ground. The positive and negative posts remaining are then plus and minus 6 Volts.
The circuit should be wired as shown in Figure 4. IRL is the infrared LED used to illuminate the opto-transistor OQ. We use Radio Shack 276-143 for the LED and 276-145 for the opto-transistor. The resistor RIRL limits the current through the infrared LED. You can determine the value of RIRL for different supply voltages 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 of 5 Volts, as shown, use 150 Ohms; for an LED supply voltage of 12 Volts, use 500 Ohms; etc.

Note that there is no limiting resistor on the output to limit the current through BCL, the bi-color LED on the panel (Radio Shack 276-025). This is because the 741 op amp IC used in the circuit has a short-circuit current of 20 mA, and so the current through BCL is already limited in the IC.
The circuit can also be used to automatically stop trains in the correct position. Figure 5 shows how to wire the circuit to break the throttle connection to the rails when the train is detected. The supply voltage used here is a plus and minus 5 or 6 Volt supply for a 9 Volt 18 mA relay such as Radio Shack 275-005. The normally-open (NO) contacts of the relay are held on by the detector when no train is seen. When the detector sees the train, the relay is released and the throttle connection to the rails is broken, stopping the train. The push-button (Radio Shack 275-609) allows track power to be restored when it is desired to move the train. Hold down the push-button and advance the train until the motive power is clear of the isolated block of track which is disabled by the relay. The 1N4001 diode D1 (Radio Shack 276-1653) keeps the surge voltage of the relay coil out of the 741 IC.

Figure 6 shows a variation on this application which is intended strictly for stub-ended yards in which the train will be backed out of staging, and will work for block control but not for carrier control layouts.. The additional diode connected around the relay allows the train to be backed out of the staging track whether the relay is engaged or not. When heading into the staging track, the diode opposes the throttle voltage to the train, so when the detector releases the relay the train will stop. When the throttle is reversed, however, the diode will conduct the throttle power to the train, allowing the reverse move. Diode D2 here is a 1N5400 (Radio Shack 276-1141) which can take the full throttle current required to move a large train.

The correct polarity of the 1N5400 diode D2 in Figure 6 will depend on whether heading into staging is reverse or forward throttle on your layout, and whether the hot rail is on the train's right or left side as it heads into staging. The diagram shows the proper polarity for a staging yard in which heading into staging is forward throttle and the hot rail is on the train's right. The diode in this orientation will conduct when the throttle is in reverse. You might need to experiment a little to get it right.
The engine house installation on Bill Pistello's Union Pacific, both top and bottom views, are shown in the photos. The infrared opto-transistors are located on the bridges over the tracks and the LEDs are located under the tracks between the rails. Locating the opto-transistors on the bridge pointing down will keep them from being falsely triggered by incandescent layout lighting; note the heat shrink tubing over the opto-transistor which acts as a shroud to keep out stray light from the side. The pole is a tube which allows the wiring to run down the center, safely clear of snagging on equipment. In November 1993 Mainline Modeler we showed you the panel for Bill's Riverside Yard; look at the photo here of the upper right corner of the panel and you'll see the LED indicators for the engine house tracks.
This circuit really has saved a lot of neck-craning, guessing, and broken Kadee couplers that can result from colliding with end-of-track bumpers and other trains in the long stub-ended staging yards on Bill and Wayne Reid's Cumberland Valley System. On Bill Pistello's Union Pacific, this circuit allows stacking multiple trains on the completely hidden main line tracks which serve as through staging tracks, and has banished costly collisions from his multi-engine diesel house.
Next time we'll discuss MasterFlasher, a programmable-rate multiple-output flasher circuit which can be used to run all the flashing LEDs and bulbs on a large layout. We use this circuit for crossbucks at grade crossings, flashing block signals, flashing panel LEDs, mast and building warning lights, and anything else that flashes. We'll see you then.
We've been told that one of our favorite transformers is no longer available from Radio Shack. They have discontinued the 18 Volt CT transformer, #273-1515, which we have mentioned in these articles for plus and minus 12 Volt DC power supplies for some of the circuits. As mentioned in the articles, most of the circuits will run on plus and minus 9 Volt DC power supplies built with the #273-1511 12.6 Volt CT transformer. For SwitchWitch, and for SwitchLock driving Hankscraft and American Switch & Signal stall motors, you really need an 18 Volt CT transformer. You can look at your local Radio Shack, as it may take them a while to run out, but here are some alternate sources:
Mouser Electronics: 800-346-6873: Part No. 41FJ020
Fertik's Electronics: 215-455-2121: Part No. T327
Both of these are 2 Amp 18 VCT enclosed transformers similar to the discontinued Radio Shack unit. We have ordered from both companies before and have been happy with their products and service.