An accelerometer and a gyroscope are both motion sensors, but they measure different things:
| Sensor | Measures | Best at detecting |
|---|
| Accelerometer | Linear acceleration (changes in speed and direction) | Movement, tilt, vibration |
| Gyroscope | Angular velocity (rotation rate) | Turning, spinning, orientation changes |
Accelerometer
An accelerometer measures acceleration along one or more axes (typically X, Y, and Z). It also detects the constant acceleration due to gravity, which allows it to estimate tilt.
For example, a phone's accelerometer can:
- Detect when you shake the phone.
- Count steps by sensing the impact of each step.
- Determine whether the phone is held upright or sideways.
- Measure vibrations in machinery.
One limitation is that during movement, it can't always distinguish between acceleration caused by motion and acceleration due to gravity.
Gyroscope
A gyroscope measures how quickly an object is rotating around its axes.
For example, a phone's gyroscope can:
- Detect when you rotate the phone.
- Make first-person games respond smoothly as you look around.
- Help stabilize photos and videos.
- Improve virtual reality (VR) tracking.
Unlike an accelerometer, a gyroscope does not measure linear movement—it only measures rotational motion.
Why devices use both
Many modern devices combine both sensors because they complement each other.
- The accelerometer provides a stable reference using gravity but can become noisy during motion.
- The gyroscope provides very smooth, responsive rotation measurements but can slowly drift over time.
Software combines their data (often using sensor fusion algorithms such as complementary or Kalman filters) to produce a more accurate estimate of orientation and motion than either sensor could provide alone.
Simple analogy
Imagine you're sitting in a car:
- The accelerometer tells you when the car speeds up, slows down, or moves over bumps.
- The gyroscope tells you when the car is turning left, right, or rotating.
Together, they give a much more complete picture of how the car is moving through space.