Model Train Forum banner
1 - 4 of 4 Posts

48 Posts
Discussion Starter · #1 ·
The following is how I constructed crossing signals on my HO layout using readily available signals, infrared sensors, and components. I have two parallel mainline tracks which a road crosses. The tracks are close enough such
that both tracks are controlled by the same set of signals.

Plant Wheel Motor vehicle Vehicle Truck

Parts Required

4 Osoyoo infrared obstacle avoidance sensor module
1 JTD877RP-2 HO scale railroad crossing signal 4 head & circuit board module
1 5 volt DC cell phone charger & charging cable
2 2700 ohm 1/4 watt resistor
1 1N4001 diode (any low voltage silicon diode)
1 1000uf 15 volt electrolytic capacitor

The infrared sensors (10 to a box) and crossing signal are available from Amazon. The cell phone
charger is available anywhere. If you are like me, you probably have a couple thrown into a junk
drawer. The resistors, diode, and electrolytic capacitor are available from electronic supply
houses such as Jameco and Digikey.

Two sensors are used on each track, one on each side of the road. The emitter and receiver are
bent 90 degrees so the majority of the sensor circuit board can be hidden in the bench top (I
use foam for bench top).

Passive circuit component Circuit component Hardware programmer Electronic engineering Font

The left sensor is as supplied. The right sensor has the emitter and receiver bent up 90 degrees.
The rightmost circuit board is the flasher circuit board.

The following photo is the wiring diagram. The diode has a stripe on one end, denoting the cathode.
This is connected to the output terminal on the sensors. The electrolytic capacitor is polarity
sensitive--be sure the + lead is connected to the diode anode and 2700 ohm resistor. The cell
phone charger cable is cut off at the phone end. Separate the wires and identify the +5 volt and
ground wires using a voltmeter or digital multimeter. These will power the sensor boards and
flasher circuit board.

Handwriting Rectangle Font Parallel Pattern

One 2700 ohm resistor, the diode, and electrolytic capacitor act as a "keep alive" circuit on the sensor
output to keep it active, especially in the space between cars as they pass. Some areas of some cars
will not trigger the sensors. I gave up trying to adjust the sensor sensitivity and position for all of my
rolling stock.

The following photo shows the sensor mounting arrangement. The wires are fed through a hole punched
through the bottom of the rectangular cavity which will accept most of the sensor.

Plant Road surface Motor vehicle Asphalt Land lot

The outputs of the 4 sensors are wired together. Any activated sensor will cause the signals to alternately
flash. Each sensor has a screwdriver adjustable potentiometer to set its sensitivity. Start with all the
potentiometers set fully counterclockwise. Each sensor board has a green LED which lights when the
sensor is activated. When one sensor activates, the green LED's on the other sensor boards will
light. Since my crossing signals are at curved areas of track, the sensors are mounted in the inside of
the curves. The emitter and receiver are positioned approximately 1/4" from the center of the longest
car as it traverses the curve. I carved a rectangular hole in the foam bench top to accept the circuit
board. A hole was punched in the bottom of the opening to accept the 3 wires from the sensor. Some
experimentation with sensor height and sensitivity potentiometer setting will be required. I aim for the
centerline of emitter and receiver to be at axle height. Originally I tried the lower portion of the cars
but some dark cars with flat paint schemes and tank cars would not reliably trigger the sensors. Once
you have the first sensor adjusted, fasten it in place with RTV at the edge of the circuit board. Do not
get adhesive on the circuit board traces or components. (Don't use anything liquid such as Elmer's
glue as it will get on the traces and affect the operation of the circuit board.) Repeat the process for
each of the 3 remaining sensors. If you are installing the signals on a single track, only 2 sensors are
required---one on each side of the road to detect the train coming from each direction. I have turnouts
relatively close to the road so the sensors are placed close to the road. They can be moved farther
away from the road so the signals start flashing before the train crosses the road. The signals can be
camouflaged with lichen to simulate vegetation. I fabricated a electrical relay cabinet to hide one signal
for a change of scenery. You'll have to experiment to determine how much the emitters and receivers
can be covered.

3,097 Posts
I'm seeing your word picture is saying that the circuit board is laying on top of the layout scenery?
What is the time delay on turning on and off? If a train is rolling by with some tank cars in the string, will the system be turning on and off?
How can a Tortoise Machine be used with this to control a crossing gate?

48 Posts
Discussion Starter · #4 ·
Clarification- the last photo in the above post shows the sensor laying on top of the layout scenery. That is not the final configuration. Sorry for the misinformation. I should have stated that the photo shows the sensor prior to being inserted into the carved hole in the foam bench top. The following mockup photo shows the final configuration.

Circuit component Passive circuit component Office equipment Electronic instrument Audio equipment

The signals operate as soon as something activates the sensor and stays on for approximately 1/2 second
after the sensor is deactivated. I have 2 locations on the layout with signals. One works with all the
rolling stock and the other behaves as mentioned in the post. Have to bite the bullet and probably have to
reorient one or more of the sensors in that location.

To control a crossing gate:
The sensor operates on 5 volts dc. It has 3 connections. "VCC" which is +5 volts,
"GND" which is the negative terminal of the 5 volt supply, and "OUT" which is a positive voltage approximately
3 volts when the sensor is not activated. When the sensor is activated, the "OUT" terminal drops to the same
voltage as the"GND" terminal. A 5 volt dc relay can be used to control the crossing gate. Connect one of
the relay coil terminals to +5 volts and the other coil terminal to the sensor "OUT" connection. The wiper and
normally open contacts of the relay can be used to operate the crossing gate just as a toggle switch would
be used. Attached is a diagram for the circuit. The 5 volt relay is inexpensive and eliminates the need to
tie up a Tortoise Machine. Hope this answers your question.

Handwriting Rectangle Font Material property Parallel
1 - 4 of 4 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.