When you're talking on the iPhone the screen turns off immediately to prevent accidental touching the screen buttons with your face. As soon as you remove it from your ear, the screen comes back on. So I though it was the accelerometer detecting movement. Then I noticed I was wrong. There's an actual sensor in the iPhone's earpiece. If you put your finger in the earpiece while on a phone call, the screen will power off. The screen comes back on as you remove your finger from the earpiece. But what kind of sensor is this? I thought it might be a light sensor, so I tried to fool it by going into total darkness so that it can't detect when my finger was near, but still I was not able to fool it. Anyone know what kind of sensor this is? maybe infrared? It's not even a touch sensor because even within an inch away from the earpiece it will detect my finger. I also tried to test for a heat sensor but it is not. It will detect any object that goes near the earpiece, like metal, cloth, paper, plastic or glass (even transparent), etc. It did seem to be extra sensitive when approaching it to a mirror. Within 3 or 4 inches from the mirror it will detect it. However, other objects are detected within one inch.