Thursday, September 22, 2011

IR Detectors

I've started work on the train detection system for Hannerton New Street.  This will use Infra Red (IR) LEDs and receivers.  The detection circuits serve two purposes:
  1. Before a train departs the station the relevant signal will be 'pulled off' - or in other words, it will turn green.  Shortly after passing the signal, the train will activate the sensors and the signals will automatically be set back to red.  This is how real railways work - except they don't use IR.
  2. In addition to this, where the tracks disappear into the tunnel at the west end of the station, the sensors will operate LEDs on the control panel to give a visual indication that there is a train in the tunnel.  There will be two separate sections in the tunnel, the first will indicate that there is a train occupying the point work, the second will indicate that there is a train in the tunnel, but that it is clear of the points.
For those who are electrically minded, the circuit is actually very simple.  The IR detector is a photodiode.  This means that the amount of current that flows through it varies depending on the amount of IR light falling on it.  This detector is connected in series with a resistor and so consequently the voltage varies as the amount of IR light varies.  This voltage is fed into one input of a comparator chip and another voltage is fed into the other input.  This second input allows the sensitivity to be controlled.  The output of the comparator controls a transistor which controls the power to the indicator LED.

I've now got to build three of these circuits on the stripboard in the control panel (see Control Panel Progress 3).  All three circuits will share the same comparator chip as it has multiple comparators within it.

Prototype IR Detection Circuit used to confirm that the system would work as planned. 
A transmitter and detector mounted on brackets made out of stripboard.
Sensors Blu-Tacked into position ready for testing.
The HST passing between the detectors

2 comments:

  1. There's a company that manufactures PCB's with IR proximity detectors mounted on them for train detection. They're designed to be fixed under the baseboard and poking up through a hole, looking between sleepers.

    ReplyDelete
  2. I'd heard of these - but I wanted to detect the presence of a train in a section of track, rather than at a specific point. Besides - it's more fun working things out for yourself!

    As an update to this post, the circuit is now built and the first of the detectors is in place and working. It has a range of around 30cm.

    ReplyDelete