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.
LM555 Photo-Detector Circuit Notes
Inductive loads such as relay solenoids should have anti-ringing diodes across their coils.
The use of R6 in the circuit would make this type of detector more suitable for use with photo transistors.
Resistor R1 is used to prevent excessive current flow to the THRESHOLD terminal of the timer ar through the photocell if R2 is set to a zero position.
Cadmium Sulfide photo-resistors come in a wide variety of characteristics and ratings. Some testing and adjustment may be required to get reliable detection with this circuit.
Visit Here for more.