R6 is used as a pullup, the sensor contacts connect to GND. R8 and C6 form a low pass RC filter against bouncing contacts.