Infrared radiation (IR) proximity sensors are used to locate the switcher, end of the train of moving ore cars, and detect gapes between the ore cars. These detected locations are used to control the switcher while executing an Inglenook move solving the puzzle, coupling and uncoupling ore cars and controlling the flashing bumper.


Starting with a readily available IR sensor two different modifications are made to meet the needs of this project.


IR Sensor, TopIR Sensor, bottom


IR Sensor, original and Modified

The simplest modification is shown at right. The objective is to relocate the two LEDs (IR emitter & IR sensitive phototransistor) so they can be located between the RR ties from under the layout. Replacing the large 5mm LED packages with 3mm packages allows drilling two small holes down through the base, fitting between the HO RR ties. 


Unsolder the two 5mm LEDs from the front of the circuit board, being sure to note were the cathode (flat side of the package) of each part is located. Clean the solder out of the mounting holes.


I used shrink wrap to insulate two of the four leads so they don't short when pushed up through holes drilled in the layout baseboard. 


Mount the new 3mm LEDs from the back side of the circuit board being careful about which goes where and getting the cathodes in the correct location. In my case the leads are long enough to position the LEDs between the ties (½" plywood base + cork ballast).


When in place, the LEDs are not seen resting just below the RR ties. The back of the circuit board is agents the underside of the baseboard and the sensitive adjustment is accessible. A short #2 wood screw through the mounting hole can be used to secure the circuit board.


I used an IR sensor modified in this way to detect when the switcher is getting close to the flashing bumper. The sensor is located so that when two, two and a half, ore cars have been pulled onto the head shunt, the loco will be over the sensor, changing the flashing rate of the bumper. Could also use the second modification. However, with this mod when the loco is present the sensor goes low which is needed. With the second mod when the loco is present the sensor goes high and an inverter would be required. See Lighted Bumper


The first modification does detect when the switcher or an ore car is present. However, there is no way to adjust the sensitive so when 'looking up' to tell the deference between the ore car and the coupling between the body of the cars. Around an uncoupler we need to know where the couplings between the cars are located.

Diagram showing location of IR sensor in relationship to train cars Basic design of remote LED mounts for IR sensors.

The basic plan is to mount the LED and phototransistor for a sensor in small copper tubing as outlined above on the right. The main L shaped part will be ~3mm inside diameter so the LED will fit inside held with a spot of glue. The 'light guard' is just big enough to slide over the LED and L shaped part. The washer near the bottom sets the height of the sensors when pressed against the baseboard. Drilling the right size hole in the baseboard should give a snug fit so no glue, etc. will be required. Wires for the LED or phototransistor are fed through the L part and connected to an IR sensor circuit board.


Filling in the outline, the 3mm LED has a 4mm/0.157" base (measured as 0.153"). Found tubing with an ID of 0.1595" so LED nicely fits inside. This tubing's OD is 0.1875". For the light guard tubing with an ID of 0.1908", 0.033" oversized is a good enough fit.


These LED sensors will be mounted high enough to be above the couplers. When the sensors are mounted/aimed straight across the track the edges of the ore cars can be detected locating the coupler. This is needed around the uncouplers.


If mounted at an angle the gaps between cars won't be detected. This would be desirable on the head shunt where when the cars have cleared the turnout is what is needed.


With the IR LED and phototransistor mounted on top of the layout and the sensor board on the bottom, plugs and standards for wiring are needed. 

Looking at the circuit for the IR sensor, the cathode of the IR LED and the phototransistor emitter are connected directly to ground. This makes it easy to identify which hole on the circuit board is the ground. These are marked with a black marker on the edge of the board. Which plug is for the IR LED (the clear LED) is also identified with a sliver marker. 


The component leads are hidden in the mounting, so wire color needs to be standardized to identify cathode/emitter and LED from phototransistor. Rainbow cable is stripped in two ways, so the IEC (International Electrotechnical Commission) colors (low-high) are odd-even for the LED and even-odd for the phototransistor. The odd color (Cathode or Emitter) are connected to ground on the sensor circuit board. In the photo above this is the brown/orange wires vs the red wires.


IR LED

Phototransistor

Cathode

Anode

Collector

Emitter

Brown(1)

Red(2)

Red(2)

Orange(3)

Orange(3)

Yellow(4)

Yellow(4)

Green(5)

Green(5)

Blue(6)

Blue(6)

Violet(7)

Violet(7)

Gray(8)

Gray(8)

White(9)

White(9)

Black(0)

Black(0)

Brown(1)


The top of the L is long enough to hold the base of the component and shrink wrap. The component and shrink wrap fit snuggly inside the mount not requiring any glue. With paint the light guard also fits tight enough. This one is for the test stand so did not solder on the washer.