I have build a schematic to read a counter. The counter has a white point at one of the digits, that I detect with a IR transmitter-receiver. The voltage at the receiver changes from 2.2 to 2.5 volts (with some noise between) when te white point passes. So I use a opamp diff amplifier to change the voltage range to 1 - 3 volts. That signal goes to opamp comparator that changes at 2.2 volt input. I measured the voltage and indeed, only when the white point passes, the voltage is more than 2.2 volts The output from the last one goes to a arduino that I programmed to count the signal via a interrupt. The problem is now that I have false counts, but I cannot find why. I use a software debounce that is sure big enough to avoid false detections caused by bounces. I think it has something to do with the hardware. Hereby a schematic. Unfortunatly I have no scoop...
simulate this circuit – Schematic created using CircuitLab