User Tools

Site Tools


GCA133 Infra Red gate / reflector sensor


By Peter Giling

IR gate as easy as anything...

In some situations, it would be nice to sense trains and/or waggons on approach.
With power consuming items, like locs or waggons with illumination or tail lights, it is easy done by GCA93 current detector.
But on a cargo bay, not all waggons have this outfit.
One good option is using CAN-GC network, and use transponders with a CAN-GC4.
The other option is this GCA133. It provides four solid and easy to build sensor gates, also useable for detection by reflection.

The pcboard

Professional produced boards and/or kits are available at


The processor PIC16F628 or alike,has a crystal of 9.216 MHz.
With that frequency it is easy to generate an exact 36 Khz 50% duty cycle pulse.
This pulse is available at U1(9).
IR sensor and IR Led can be connected directly to this board. But since each IR sensor need some filtering in the 5V supply, a small satellite board is available.
Four of these boards GCA141-c will be connected to S1 .. S4.
GCA141c contains the sensor, a power filter, the connection for IRLed and a driver transistor to make sure longer wires will not give any problems.
The receiver SFH5110-36 will detect the transmitted 36 kHz.
Both IR Led and SFH5110-36 should match in their IR wave lenght of 940-950 nM.
Each gate will work between 5 and 500 mm distance between IR-Led and IR-sensor.
The basic setup will be limited to approx 80mm which would be adequate for most situations.
Larger range can be achieved to lower R5..R8 (Port 1..4) from 10 KOhm down to zero for maximum.
Please consider that other ports in the close area might by influenced by it.
Also reflection is possible by mounting the two items side by side. It is very convenient to mount them under the rails, and sending and receiving signal throught the gaps between the rail-beans.
Almost anything that comes on top of will reflect the ir beam onto the sensor.
Some plastics might not be able to reflect IR-light. In that case glue a small peace of metal or metal tape in or under the waggon.
It also might be necessary to fix a metal plate between transmitter and receiver, because they should not see each other directly.
For the longer distance , it helps to put a small tube over the IR led, to create a narow bundle.
Connector J1 is to be connected to GCA50/CAN-GC2. The connector also provides 5V supply through pin 1 & 2.
Since there only four signals available to send to GCA50/CAN-GC2, dipswitch SW1 selects which input of GCA50/CAN-GC2 you will use.
Switch 1..4 ON will pass signals to Input 1..4(or 9..12, if J6 is used) of GCA50/CAN-GC2.
Switch 5..8 ON will pass signals to input 5..8(or 13..16, if J6 is used)of GCA50/CAN-GC2.
J2 connector on GCA133 could be used to connect a next interface to use the free 4 inputs (or outputs).
Sw2 is to select the way you are using the irGate.
Set to OFF, the input is active when iR-beam is interrupted. Set to ON, the input is active when a reflection is detected.
Switch 1 correspondents with S1, etc.
Using an external 5 V supply to J1 (1 = +5V, 2 is neg.) GCA133 can be used as a stand alone unit for other systems.
Each output will switch between 5V and 0V, maximum current out is 25 mA.

Can I use GCA133 as stand-alone unit?

That is also possible.
The GCA133 needs 5V for supply (max 10 mA for the board and saltellites itself.)
For connections see table below.
Each output can drive 25 mA 5V, active low. This means that output is given against +5V.
In case of using inductive loads (relay) use diode with kathode to +.

Connections GCA133 J1 or J2 Output max load
+5V 1
0V ground 2
output 1 3 25mA
output 2 4 25mA
output 3 5 25mA
output 4 6 25mA

Dip-switch SW1 > 1-4 ON, 5-8 OFF.

Dip-switch SW2 is to select reflection or direct beam. See descriptions

Older versions

For the old version MGV133 look here.


  • Useable to a wide variety of distances.
  • No adjustments needed for the given distances.
  • Output capable of driving small relay like Omron GV5-1 or HFD2 5V(Reichelt). (use diode for fly-back suppresion, cathode to +)
  • Low power consumption.
  • 4 ports on one board.
  • good immunity against normal daylight/ electrical light.

Adjustments and setup

For many waggons, it might be necessary to fix a reflecting surface (best choice some metal)on the bottom of it.
Infra red is usually not very well (or not at all !) reflected by plastic materials.
Closed waggons can have a little metal plate fixed inside.
Some tests with the used trains and waggons need to be done, to get a satisfying result.
To connect sensor outputs to GCA50/CAN-GC2 input pins, SW1 can be used to select the right input.
The standard program has an internal delay of approx 20 mSec for each switch.
This is done to make the sensor really insensitive for small errors in light obstructions (insects , etc).

Schematics, Layout and hardware list

Cable to GCA50 / CAN-GC2 / CAN-GC4

The firmware

The firmware

The very simple basic program is made with this Basic compiler

gca133-en.txt · Last modified: 2020/05/28 13:48 by phg