Easy way to avoid noise in contact switches

This guy was facing too much noise in the 3D printer End-Stop switch:


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.