Noisy square wave readings - input filter guidance

rastamankg:
If you are using interrupt trigger on CHANGE, try to use RISING or FALLING. I had noise with reflective optointerrupter when reading motor RPM, Schmitt trigger did the job, and now I don't have problem. I am using 40106 with about 0.8 Volts of hysteresis.

I use falling. I tried now with a 1uf, 470ohm resistor together with the zener diode and the result was still the same. Damn feels really strange should it really be this hard to read a simple square wave.