Above And Across The Track Infrared Detectors + 10 May, 2021

  This page presents information on infrared - Above The Track and Across The Track train position detection circuits. The circuits are designed around the LM339 quad comparator chip and can use a wide assortment of matched infrared - emitter / detector pairs.

  The circuit bellow is the basic voltage comparator based detector circuit using the LM339 Quad or LM393 Dual comparator ICs.

  The LED will turn on when the infrared beam is broken. The value of the resistor R1 determines the sensitivity of the phototransistor Q1. In most cases a value of 1 Meg or 470K ohm with good results but every situation is different and some experimentation might be needed.

Basic Infrared Detector Schematic

Circuit Operation - When a train breaks the infrared beam the phototransistor will conduct less current. The voltage at the MINUS input of the comparator will rise above the reference voltage at the PLUS as determined by R3 and R4. The output of the comparator to turn ON and the LED will be lit.


Above The Track Infrared Detectors

Long Range - Across The Track Infrared Detectors

  The method shown below has been tested with sensor gaps as wide as 12 inches but a distance of 8 inches or less is more practical.

  There is also a method that can be used for longer range across track detection that could be used for yard throats. A detector circuit of this type 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.

  For general information about Voltage Comparators please see the Voltage Comparator Information page at this site.


Emitter/Detector Alignment

  Good alignment of the emitter and detector is important for good operation, especially if the gap is large. This can be done with a piece of string stretched between and in line with LED and phototransistor. A length of dowel or stiff wire could be used to set the alignment. Another method that can be used for longer distances is a laser pointer shone through one of the mounting holes.

  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 and at an angle across the tracks.

Emitter/Detector Alignment Methods

  The emitter could also be mounted above the track with the phototransistor placed between the rails in locations such as hidden yards. Placing the emitter and detector at an angle would again be helpful.



Phototransistor Shielding

  Most infrared phototransistors are also sensitive to visible light and therefore will need to be shielded in someway to prevent the device from being swamped by the rooms lighting. This can be done by hiding the phototransistor inside a lineside structure or placing it inside a short piece of opaque tubing as shown below. The back of the phototransistor can be painted black to prevent room light from entering if it is in the open.

Detector Shielding Method

  The longer the length of tubing the narrower the entrance angle to the phototransistor. The tubing can be clamped in place or mounted through a hole drilled in a small block of wood or plastic.

  The emitter does not need to be shielded unless its beam can affect another phototransistor nearby.



  The following schematic shows how the LM339 can be used to build a multiple detector unit.

4 - Infrared Detectors Schematic

    In order to reduce on the total current needed for the circuit the infrared LED's can be wired in series and the value of the series resistor adjusted to supply the needed current. In this way the LED's use the same 17 milliamps instead of needing 17 milliamps each.

    The parts values shown on the schematic are guidelines that should work in most situations but may have to be adjusted for your particular needs.


Circuit Boards For Light Detector Circuits

8 - Photo-Detector Circuit - Dark Sensor = LEDs On - Circuit boards and parts.

8 - Photo-Detector Circuit - Dark Sensor = LEDs Off - Circuit boards and parts.

4 - Photo-Detector Circuit - Bipolar Output (LM556) - Circuit boards and parts.



Across The Track Infrared Detection Notes


Is The IR LED Working?

  Infrared light is not visible to the naked eye, however, a digital camera can be used to view the IR light if it does not have an IR blocking filter on the lens.

  The image may not be very bright but close-up or in a darkened area the light should be visible on the camera's display screen.

  For information on Voltage Comparators please see the Voltage Comparator Information page at this site.

  This High Impedance Test Voltmeter circuit can also be used for testing phototransistors installations.

  Method of mounting LEDs above the track. See lower portion of page.


Use the google or a vendors web page to find data sheets for these or any other devices.

Pinout Diagram For Various Devices.

Return to the Main Page


Please Read Before Using These Circuit Ideas

  The 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.

Return to the Main Page

10 May, 2021