There are five sensors built into most models of the iPhone, iPad, and iPod touch that allow them to perform some of their coolest interface tricks. Without these sensors, none of the devices would be what we know them as today. The sensors are:
Proximity sensor – This sensor can determine how close the iPhone is to your face. This sensor is what helps the iPhone turn off its screen automatically whenever you hold the phone up to your ear. This is necessary to prevent accidental button clicks by the side of your head when talking. This sensor is only on the iPhone (since the other devices don't need it).
Motion sensor/accelerometer – This sensor enables the iPod touch, iPad, or iPhone’s screen to automatically switch from landscape to portrait modes and back again based on whether you’re holding the phone up and down or sideways. This sensor is also present in the iPad.
Ambient Light sensor – This sensor can determine how much light is available in the area surrounding the iPhone, iPod touch, and iPad and automatically adjust the brightness of the screen in order to conserve battery life.
Moisture sensor - The devices also contains a fourth sensor, though this one isn’t related to the interface. The water sensor is a little red tab that appears in the dock connector when the phone has been submerged in water. It can also appear as a red dot in the headphone jack.
Gyroscope - Starting with the iPhone 4, 4th gen. iPod touch, and iPad 2 there's another sensor: a three-axis gyroscope. When combining the gyroscope with the accelerometer, this gives these devices six axes on which the it can operate. This is designed to make them more sensitive, responsive, and powerful for gaming.
Want tips like this delivered to your inbox every week? Subscribe to the free weekly iPhone/iPod email newsletter.