This page presents information on infrared - 'Across Track' train detection circuits. The circuits are built around the LM339 comparator chip and can use a wide assortment of emitter detector pairs.
The "Basic" circuit shown below has been tested with sensor gaps as wide as 12 inches but a distance of 8 inches or less is more reasonable. There are also "Long Range" across track detection methods that could be used across yard throats.
This type of circuit is in use at the London Model Railroad Group's club layout and spans seven "O" Scale tracks using one infrared LED and a lensed phototransistor.
In the circuit bellow the LED will turn on when the infrared beam is broken. Other output options and general information regarding comparators can be found on the Comparator information page link shown below.
This "Basic" circuit could be used to experiment with for your own detectors as it has a 1Megohm variable resistor R2A to control the sensitivity of the phototransistor.
In actual circuits, R2 and R2A would be replaced by a fixed value resistor to save money. In most cases the value can be 1 Meg or 500K ohm with good results but every situation is different and some experimentation might be needed.
The "Basic" circuit can be used to test emitter/detector pairs when they are installed and before they are connected to the actual detector circuit.
Circuit Operation - When a train breaks the infrared beam the phototransistor will go dark and turn OFF. The voltage at the MINUS input of the comparator will rise above the reference voltage, approximately 9 volts, that is between R3 and R4. This will cause the output of the comparator to conduct and the LED will be ON.
The LED can be made to turn OFF when a train is detected if the PLUS and MINUS inputs of the comparator are reversed.
The following schematic shows how the LM339 might be used for a multiple detector unit.
Some emitters and transistors have the leads placed so that the lens points to the side when the device is mounted vertically. Consult component catalogues for the various case styles.
Another method that can be used for longer distances is a laser pointer shone through one of the mounting holes. Refer to the Alignment Methods diagram further down this page.
The next diagram shows two methods of aligning the emitter and detector mountings. For best results the height of the "beam" should be at coupler height.
The next diagram shows a method of shielding the detector phototransistor from room light.
The next diagram shows an inexpensive method of increasing the range of infrared across track detectors by using additional LEDs to supply a higher infrared light level.
Operation is the same as the Basic Detector but the increased IR energy allows for greater distances.
Making use of phototransistors with lenses built into the case would also be helpful for this particular application and may reduce the number of extra LED's needed to span a given distance. This is a situation where some bench testing can be very helpful.
The "Long Range "Infrared" Detector" is a variation on the "Day and Night Phototransistor Detection" system shown on this site. A link for this page follows.
Day and Night Phototransistor Detection information.The next diagram is for a small printed circuit board that could also be used to mount the infrared emitting diodes.
Below is a link to the "Voltage Comparator information" page. This page has more information on the use of comparators.
Voltage Comparator informationThe explanations for the circuits on these pages cannot hope to cover every situation on every layout. For this reason be prepared to do some experimenting to get the results you want. This is especially true of circuits such as the "Across Track Infrared Detection" circuits and any other circuit that relies on other than direct electronic inputs, such as switches.
If you use any of these circuit ideas, ask your parts supplier for a copy of the manufacturers data sheets for any components that you have not used before. These sheets contain a wealth of data and circuit design information that no electronic or print article could approach and will save time and perhaps damage to the components themselves. These data sheets can often be found on the web site of the device manufacturers.
Although the circuits are functional the pages are not meant to be full descriptions of each circuit but rather as guides for adapting them for use by others. If you have any questions or comments please send them to the email address on the Circuit Index page.