This page shows three circuits for using the 555 timer IC as a photocell controlled train detector.
The circuit is shown driving light emitting diodes but any load of less than 200 milliamps could be used.
Shown on the schematic is a secondary output that uses the open collector at the DISCHARGE terminal (Pin 7) of the timer. This output can sink a fairly large current and would be ideal for driving relays.
An optional resistor, R6, can be added to the circuit to lower and compress the detection voltage range but this only partially alleviates the problem of the wide detection band.
The graphs at the bottom of the diagram show the input voltages at whic