Regrettably I have removed the circuit that did appear here. I am grateful to a correspondent who constructed it and tried several modifications, but under some circumstances train detection failed. I recommend that you use the circuit shown in Figure 14.4 on page 68 of my Complete Book of Model Railway Electronics.
If you entered my site directly using a link from a search engine, you may have missed out on the site navigation system. If you cannot see seven buttons along the left edge of the window, please click the Continue button below.