Sensors

How Accelerometers and Gyroscopes Measure Motion

By FigSensor Editorial Team · · 4 min read

Phones that rotate their screen, drones that hover level, game controllers that sense a swing and cars that detect a crash all rely on two small sensors: the accelerometer and the gyroscope. They are tiny silicon chips, often combined in a single package called an inertial measurement unit, or IMU.

They measure different things. An accelerometer reports acceleration along an axis, and a gyroscope reports how fast something rotates. Used together, they describe how an object moves and how it is oriented.

What an Accelerometer Measures

An accelerometer measures proper acceleration, which is acceleration relative to free fall. That has a surprising consequence. A sensor lying still on a table does not read zero. It reads about 1 g (the pull of gravity, around 9.8 meters per second squared) pointing upward along the axis aligned with gravity. In free fall, a sensor reads close to zero.

A three-axis accelerometer reports values for X, Y and Z. When the device is stationary, those three numbers form a vector that points away from the ground, so you can calculate tilt. When the device moves, the readings combine gravity with the motion itself.

How MEMS Accelerometers Work

Most modern sensors are MEMS, short for micro-electro-mechanical systems. Inside the chip is a tiny proof mass suspended on springs made of silicon. When the chip accelerates, the mass lags behind because of inertia, and it shifts relative to the frame.

The chip measures that shift using capacitance. Fixed plates surround comb-like fingers attached to the mass. As the mass moves, the gap between fingers changes on one side and the opposite side, so the capacitance changes. Built-in electronics convert this change into a voltage or a digital number. Other designs use piezoelectric or piezoresistive materials, but the capacitive approach is the most common in consumer parts.

What a Gyroscope Measures

A gyroscope measures angular velocity, the rate of rotation, usually in degrees per second. It does not tell you an angle directly. It tells you how quickly the angle is changing around each axis.

How MEMS Gyroscopes Work

A MEMS gyroscope uses the Coriolis effect. A small mass is driven to vibrate back and forth along one direction. When the chip rotates, the Coriolis force pushes the vibrating mass sideways, at right angles to both its motion and the axis of rotation. The sideways motion is proportional to the rotation rate and is measured capacitively, just as in an accelerometer.

Because it relies on vibration, a gyroscope needs power and a drive circuit, and it takes a moment to start up.

Why You Need Both

Each sensor has a weakness that the other can offset.

  • Accelerometers give a stable long-term sense of which way is down, but they are noisy and get confused by movement, because motion acceleration mixes with gravity.
  • Gyroscopes are smooth and quick, but to get an angle you must add up the rate over time, called integration. Any small bias in the rate grows into a steadily increasing error, known as drift.

Combining them fixes both problems. The gyroscope handles fast changes, and the accelerometer slowly pulls the estimate back toward the true gravity direction.

Sensor Fusion

The process of merging sensor data is called sensor fusion. Common methods include:

  • Complementary filter: A simple blend that trusts the gyroscope for short-term changes and the accelerometer for long-term tilt. It is easy to code and runs on small microcontrollers.
  • Kalman filter: A more advanced statistical estimator that weighs each sensor by its expected noise.
  • Madgwick and Mahony filters: Lightweight algorithms often used for orientation in drones and wearables.

A third sensor, the magnetometer, measures the magnetic field and provides a heading reference, which stops rotation around the vertical axis from drifting. A six-axis IMU has an accelerometer and gyroscope, and a nine-axis IMU adds the magnetometer.

Practical Tips

  1. Calibrate offsets by averaging readings while the sensor is still, then subtract that bias.
  2. Set the full-scale range to match your motion. A small range gives finer resolution but clips on strong shocks.
  3. Choose a sample rate high enough for the fastest motion, and filter noise using the sensor's built-in low-pass setting.
  4. Mount the sensor firmly. Loose mounting adds vibration the sensor will faithfully report.
  5. Mind the axis orientation printed on the chip, because signs and directions differ between parts.
  6. Expect temperature to change bias, and recalibrate if the environment changes widely.

Frequently Asked Questions

Can an accelerometer measure speed or position?

Not directly. You can integrate acceleration to get velocity and integrate again to get position, but small errors grow very quickly, so position from an accelerometer alone becomes unreliable within seconds. Systems usually combine it with other sources such as GPS or wheel sensors.

Why does my gyroscope reading drift when it is not moving?

Every gyroscope has a small bias that outputs a nonzero rate even at rest. When that rate is integrated to get an angle, the error accumulates. Measuring and subtracting the bias, then correcting with accelerometer or magnetometer data, reduces the drift.

What does g mean in accelerometer specifications?

The letter g stands for standard gravity, about 9.8 meters per second squared. A range of plus or minus 2 g means the sensor can measure up to twice the force of gravity in each direction before the signal clips.

Related reading

  • Calibration

    Sensor Calibration Explained

    Understand what sensor calibration is, why offset and gain errors appear, and how one-point and two-point methods bring readings closer to the truth.

    · 4 min read