Train Detector with Relay BOD2-RLY

BLOCKsignalling BOD2-RLY Block Occupancy Detector

Detects trains and operates a built-in relay.

  • Quick and easy way to detect trains anywhere on your layout, even in tunnels
  • Detects passing trains using its in-built infra-red sensor
  • Very easy to connect up to simple indications on a control panel or to add as inputs to computer systems
  • Operates from 8V to 25V DC
  • Low current output (+5V DC) to feed leds, signals or small relays
  • No soldering required, all components are ready wired
  • No programming necessary (but you can adjust all settings if you wish)


We often are asked how to detect trains in tunnels, or on layouts where enthusiasts run their trains in twilight, or even in complete darkness.  In these situations, photocell operated detectors will not work, and so you need a detector with a built-in light source.

The BOD2-RLY has a built-in infra-red detector which can "see" in the dark and can detect trains in these situations.

The module has a small relay built-in. When a train crosses the sensor, the relay coil is energised and the relay common contact (labelled COM) moves from the normally-closed (NC) position to the normally open position NO. 

After the train clears the sensor, the module de-energises the relay and the relay contact moves to the normally-open position. 

A delay can be set before this occurs to allow a train indication to remain present for a period, or the indication can immediately reset.  The  module can also be set to ignore the gaps between carriages. With a delay, the module can operate a two aspect signal, switching to red when a train crosses the sensor, and back to green a preset time after the sensor is cleared.

There are several programming options available (see later).

You can power the module from 8V-25V DC..  The module reduces the supply voltage down to 5V to feed attached leds, etc.

 

Installation

Simply drill an 8mm hole through the baseboard between the sleepers and insert the sensor from below.

Train Detector

 

 

If required, the sensor can be held in place using a small amount of blutack, expanded polystyrene or similar.

The led diameter is 2.2mm, so on smaller scales the leds can still have a clear view between the sleepers.

Train Detector

 

 

Power Supply

The module will operate reliably with a power supply in the range of 8V to 25V DC.

When connecting a DC supply, connect the negative to the GND terminal and the positive to the Vin terminal.  If the connections are accidentally reversed, the module will not function, but no damage will result.

 

Connecting up

The relay outputs are available on the normally-open (NO), common (COM) and normally-closed (NC) contacts.  When the power is turned off, the relay de-energises and the connection is made between the NC and COM connections.

wiring diagram BLOCKsignalling BOD2-RLY

The relay output can be used to connect to leds, filament bulbs, relays, or computer systems.  There are no volts on the contacts (they are "volt free").

 

Terminals

The module has six terminals.

Vin           Positive feed of the DC supply

GND         Negative feed of the DC supply

Vout         This is a regulated +5V DC output which can be used to feed leds, small relays, or bulbs (maximum 100mA).

NO           The terminal is the normally-open contact of the relay.

COM        The terminal common terminal of the relay.

NC           The terminal is normally-closed contact of the relay.

 

 

LED Connection

When using leds it is important to connect them the right way around.

The negative lead (cathode) is identified by a flat on the side of the led body, and by having a shorter lead.
led anode and cathode connections

 

 

Shown below is an example wiring diagram to connect a 2-aspect signal or control panel leds to the BOD2-RLY.

A 1k resistor is necessary to limit the current through the leds.

wiring leds to the BOD2-RLY

 

 

Programming

The default program is to operate in the instantaneous mode, so if you want one of the other modes, you will need to reprogram the module.

Programming is performed holding down the Push Button when switching on the power.

Red Green 2 Aspect Signal Controller

The red led on the PCB flashes at 1 second intervals.  When the required number of flashes is seen (see later for the list of possible choices) the button is released to store the first value. At this point the led comes on for five seconds to confirm the value is stored.

The led then starts flashing again, and this time the button needs to be pressed to store the second value.

Once the two values to be stored are entered, the led flashes 10 times rapidly, and the module starts operating.

Most values entered can range between 1 and 255 (see below for limits).  If more flashes are seen, or the programming is aborted by switching off, then the programming must be repeated.

 

Factory Reset

To reset the module back to factory settings, switch off the power to the module and hold down the Push Button. Apply the power and continue holding the push button until 1 flash of the led is seen. At this point, release the button. You will see a long flash of five seconds.

The led will begin flashing again. When you have seen 1 flash press the button. You will see a long flash of five seconds and then 10 rapid flashes. The reset procedure is then complete and the module will restart with factory settings, and run in instantaneous mode. If you make a mistake programming, simply repeat the process.

 

Sensitivity Setting

The module is supplied with the sensitivity preset to suit most installations and should not need adjustment.

The sensitivity is factory set to 5, and can be adjusted from 1 to 10 (with 1 being the most sensitive and 10 being the least sensitive).

To change the sensitivity, switch off the power to the module and hold down the Push Button. Apply the power and continue holding the Push Button until 9 flashes of the led are seen. At this point, release the button. You will see a long flash of five seconds.

The led will begin flashing again. When you have reached the desired number of flashes to set the new sensitivity, press the button. You will see a long flash of five seconds and then 10 rapid flashes. The programming is then complete and the module will restart. If you make a mistake programming, simply repeat the process.

Performing a factory reset will reset the sensitivity setting back to 5.

 

 

Built-in Programs

In order to set-up the module with minimum effort, there are several programs built-in.

Selecting one of these programs will perform a factory reset on the module (losing any previously made changes), and then make a number of setting adjustments automatically.

If you want to further refine the settings of these programs, follow the instructions in the section after selecting the required program.

 

Program 1 - Test Mode

In this mode, the relay is energised for 1 second, and then denergised for 2 seconds.

This is repeated until another mode is selected.

 

Program 2 - Instantaneous Mode (DEFAULT)

When the infra-red sensor is triggered by a train, the module immediately activates the relay.

The module checks to see if the train has cleared the sensor.

If the train has cleared the sensor for at least 1 second, the relay is denergised.

The module then restarts and awaits the next train.

 

Program 3 - Signal Mode

When the infra-red sensor is triggered by a train, the module immediately activates the relay.

The module checks to see if the train has cleared the sensor.

If the train has cleared the sensor for at least 4 seconds, the module waits 10 seconds, and then the relay is denergised.

The module then restarts and awaits the next train.

This program could be used to control a 2-aspect led signal.  The holdover setting means that gaps between carriages are ignored, and the final delay allows the signal to remain at red for a realistic period.

 

Program 4 - Short Pulse Mode

This program energises the relay briefly when the sensor is covered by a train.

The relay pulse duration is in steps of 100ms, with a default value of 2 (=200ms).

The duration is set in multiples of 100ms steps using setting 5 (the PULSE ON TIME).

The train must clear the sensor, before the train can be detected again, and so generate another pulse.

Typically this program would be used to connect to a computer control system, to notify it that a train has arrived at a certain poiint on the layout.

 

Program 5 - Long Pulse Mode

This program energises the relay for a number of seconds when the sensor is covered by a train.

The relay pulse duration is in steps of 1 second, with a default value of 2 (=2 seconds).

The duration is set in 1 second steps using setting 5 (the PULSE ON TIME).

The train must clear the sensor, before the train can be detected again, and so generate another pulse.

Typically this program could be used to halt a train at a certain point on the layout for a number of seconds.  When the train crosses the sensor, the relay will energise for a period, curtting the power to the track section.  When the power is re-applied after the pulse delay, the train will clear the sensor without the module being retriggered.

 

Program 6 - Recurring Short Pulse Mode

This program energises the relay briefly when the sensor is covered by a train.

If the sensor remains covered, the relay will continue to energise and de-energise.

The pulse duration is in steps of 100ms, with a default value of 2 (=200ms).

The duration is set in 100ms steps using setting 5 (the PULSE ON TIME).

The relay is denergised for the time it takes for the module to detect the trains presence again (default is 1 second).

Typically this program could be used flash an led at a fast rate when the train is over the sensor (perhaps to convey an urgent indication).

 

 

Program 7 - Recurring Long Pulse Mode

This program energises the relay for a number of seconds when the sensor is covered by a train.

The pulse duration is in steps of 1 second, with a default value of 2 (=2 seconds).

The puse on duration is set in 1 second steps using setting 5 (the PULSE ON TIME).

The pulse off duration is set in 1 second steps using setting 6 (the PULSE OFF TIME).

Typically this program could be used flash an led at a slow rate when the train is over the sensor.

 

 

 

Program Flow Diagram

The diagram below shows all the programming options.

Programming is performed by holding down the Push Button when switching on the power.

The red led on the PCB flashes at 1 second intervals.  When the required number of flashes is seen (see later for the list of possible choices) the button is released to store the first value. At this point the led comes on for five seconds to confirm the value is stored.

The led then starts flashing again, and this time the button needs to be pressed to store the second value.

Once the two values to be stored are entered, the led flashes 10 times rapidly, and the module starts operating. 

The led will now flicker whilst the module searches for trains.

Most values entered can range between 1 and 255 (see below for limits).  If more flashes are seen, or the programming is aborted by switching off, then the programming must be repeated.

 

Following the diagram is a detailed explanation of all the settings.

 

 

Any additional components shown in diagrams and photos are only to illustrate connections and are not included with the module.