The BOD2-NS has a built-in infra-red detector which can "see" in the dark and can detect trains in these situations.
Two leds and a small relay can be connected. Normally one of the leds is lit ("NO TRAIN"). When a train crosses the sensor, the first led is extinguished and the second led is lit (and relay, if connected) is energised. These leds can be fixed on a control panel to show a train has crossed the sensor.
After the train clears the sensor, the module resets to just the first led being illuminated. A delay can be set before this occurs to allow the train indication to remain present for a period, or the indication can immediately reset to the first led being illuminated.
The instantaneous mode is useful for precisely locating a train, for example for uncoupling, whereas the delayed mode gives a train present indication and ignores the gaps between the carriages.
You can power the module from 12V-25V DC, 12V to 16V AC, or from a DCC bus feed. The module reduces the supply voltage down to 12V to feed the signals and external resistors are not required as these are built into the module.