The proximity sensor in an iPhone senses how close the iPhone is to the user's cheek/face, so that it can pause whatever activity it is in the middle of (playing music or browsing the web, for example) so the user can take a phone call. When the iPhone is removed from the ear after the call, the iPhone resumes its previous activity.
---
The orientation sensor (accelerometer) works very much like the same sensor in a digital camera that gauges what orientation the unit is being held so that it can rotate the display for optimal viewing.
Here are a couple of real-world examples of the accelerometer at work:
- You're looking at your photos on an iPhone - you can hold the iPhone vertically for portrait-oriented (taller than wide) photos, and horizontally for landscape-oriented (wider than tall) photos, and they will stretch to fill the screen.
- You're browsing the web, and you come across a site that features a lot of text (a news site, for example). It all shows up when you hold the iPhone vertically, but you can't read it because the text is so small. Rotate the iPhone 90 degrees, and the page will adjust to fill the width of the longer dimension of the screen, making the text much more legible.