This guy was facing too much noise in the 3D printer End-Stop switch:
http://wot.lv/combating-endstop-noise-on-a-reprap.html
Then he decided to use a low-pass filter to remove the noise that microcontroller was getting.
Although this project still missing an anti-debounce circuit, it could be implemented in software inside the microcontroller.