Some years ago I developed this schematic for automatic optical model train detetion using LDR's.
Recently I revisited this board and found a discrepancy in the text descriptions: The timing delay introduced by the RC combinations (R5 C1 and R7 C2) is shown first as R*C*2, in another text box as R*C/2.
What is it now: is the delay in the opamp output tipping point @63% (ie R*C), or another value when used in this circuit?
Is it a stock MCU for model railroads? If it is your design and code, which microcontroller? Many of them have on-board analog compare functionality. Your board may be smaller and easier with a few more lines of code
ATmega328.
Thank you for your response ZipZapOuch, but this design satisfies my needs and represents me a robust and reliable sensor platform.
Besides I have both hardware and software experience and I am of the school of thought that software more often then not does not provide an alternative for hardware solutions. Case in point is here the use of hardware to solve a sensor problem: it is fast, cheap and robust.
I think the implication is there because the ATMega328 has on-board analog voltage comparators that may simplify your hardware design by eliminating the op amps being used as comparators and LED drivers.
if you claim not to have enough IO pins, you may want to add a second ATMega328 at minimal additional cost, and likely a smaller footprint because you won't need the voltage divider resistors and RC delays. With a MCU, solving the timing question in your original post becomes trivial with code. That's why someone assumed your skills may be less that you claim.