An electronic component that measures motion and basic tilt information.
A device with an accelerometer knows what angle it is being held at. It can also measure basic movements such as simple rotation, and motion gestures such as swinging, shaking, and flicking.
One common use in phones it to detect whether the phone is upright or sideways, and automatically rotate the graphics on the screen accordingly.
Another common use is controlling games and other applications (such as music player) by moving or shaking the phone.
In a phone, an accelerometer is a very small electronic component. It's like a microchip, but with moving parts inside. This technology is called MEMS.
An accelerometer typically has extremely tiny weights inside it, suspended on simple springs. Small electric fields measure the position and movement of the weights. In addition to measuring movement, gravity's effect on the weights can be measured, proving orientation (tilt) information.
Most accelerometers are not very good at measuring changes in tilt. The best sensor for this information is a gyroscope: