See Electronics for Model Railways Book 1!
The train sensor with a delay. Each sensor has its own variable delay.
Six sensors can be placed around a model railway layout to detect the
presence of a train.
The indicator LED will come on as soon as a train passes over the sensor and
will remain on for a short while after the train has passed This is so the
gaps between the coaches will not cause the the LED to flicker.