A device that senses when another object is close by.
In a mobile phone, a proximity sensor is most commonly used to detect when the phone is held to the face. Specifically, the sensor detects human skin within a certain distance. The sensor is typically placed next to the speaker area at the top of the phone.
The phone uses this information to temporarily power down the display - to save battery life - and the touch screen, to prevent the face from accidentally touching on-screen buttons and triggering unwanted actions.
There are multiple types of proximity sensors, employing different technology. One type projects an invisible beam of infrared light and measures the beam's reflection from nearby surfaces. Another type uses capacitive technology (like touch-screens) that uses an electric field to detect the unique electrical properties of human skin.
Some types of proximity sensors detect any type of solid object, while other types are tuned specifically for one material, such as human skin.