A magnet on the train activates
the TRIGGER reed switch to turn on the amber LED for a time determined
by the value of the first 10u and 47k.
When the first 555 IC turns off, the 100n is uncharged because both ends
are at rail voltage and it pulses pin 2 of the middle 555 LOW. This
activates the 555 and pin 3 goes HIGH. This pin supplies rail voltage to
the third 555 and the two red LEDs are alternately flashed. When the
train passes the CANCEL reed switch, pin 4 of the middle 555 is taken
LOW and the red LEDs stop flashing.
See it in action:
The circuit can also be
constructed with a 40106 HEX Schmitt trigger IC (74C14). The 555 circuit
consumes about 30mA when sitting and waiting. The 40106 circuit consumes
less than 1mA.