How does the sensor work?