Measurement and Units

Accelerometers and Gyroscopes: The Motion Sensors Inside a Phone

Learn what a phone's motion sensors really measure, how tiny silicon parts do it and why position from them drifts fast.

Key takeaways

  • An accelerometer at rest on a table reads about 1 g upward, and in free fall it reads close to zero.
  • MEMS accelerometers measure how far a small mass on springs shifts, usually through changes in capacitance.
  • Phone gyroscopes use vibrating structures and the Coriolis effect to measure rate of rotation.
  • Adding up sensor readings over time to get position or angle makes small errors grow quickly.
  • Combining several sensors, called sensor fusion, covers the weaknesses of each.

A phone knows which way you are holding it because of two kinds of sensor. The accelerometer senses how its tiny internal mass is pushed or pulled along each axis. The gyroscope senses how fast the phone is turning. Each usually reports in three directions at right angles.

Both are microelectromechanical systems, or MEMS: mechanical structures only fractions of a millimeter across, etched into silicon alongside the electronics that read them. Neither one measures position or orientation directly, and that fact explains most of their quirks.

A mass on springs

Inside an accelerometer a small block of silicon, the proof mass, hangs on thin silicon springs. When the chip accelerates, the mass lags behind until the springs pull hard enough to bring it along. The deflection is proportional to the acceleration.

This follows from Newton's second law combined with a spring's linear response. If ω₀ = 2πf is set by the natural frequency f of the mass and spring, the steady displacement is x = a / ω₀².

Illustrative sensor: f = 3000 Hz
ω₀ = 2π × 3000 ≈ 18850 per second
ω₀² ≈ 3.55 × 10⁸ per second squared

Acceleration a = 9.8 m/s²
x = a / ω₀² ≈ 2.8 × 10⁻⁸ m  ≈ 28 nm

A shift of tens of nanometers is read electrically. Fingers of silicon attached to the mass sit between fixed fingers. As the mass moves, one gap widens and its neighbor narrows. The circuit detects the change in capacitance, the ability of those surfaces to store charge.

Why a resting phone reads 1 g

An accelerometer cannot feel gravity pulling equally on the whole chip and its proof mass. What it senses is the support force that keeps the chip from falling. Physicists call the result proper acceleration.

Lay the phone flat and still. The table pushes it upward, the proof mass sags relative to the frame, and the sensor reports about 9.8 m/s² upward. Drop it, and everything falls together, the springs relax and the reading goes to nearly zero. That is the same equivalence behind why all objects fall together without air.

Do not test this by dropping a phone onto a hard floor. A short hop onto a thick cushion, at your own risk to the device, is enough to see the dip, and a sensor app that records the data will show it.

Finding tilt from gravity

When the phone is still, the only acceleration reading is the 1 g support, so its split among the three axes reveals the tilt. If x runs across the screen and z points out of it, the tilt about one axis is the angle whose tangent is aₓ divided by a_z.

The weakness appears as soon as the phone accelerates. Suppose you hold it level in a car that speeds up at 2 m/s². The sensor combines that with the 9.81 m/s² support force:

apparent tilt = arctan(2 / 9.81)
              = arctan(0.204)
              ≈ 11.5°

The accelerometer alone cannot tell whether the phone tipped or the car sped up. It also says nothing about turning around the vertical axis, since gravity looks the same however you spin on a level table.

How a vibrating gyroscope works

A spinning-wheel gyroscope keeps its axis steady because of angular momentum. A phone has no spinning wheel. Instead, a silicon mass is driven to vibrate back and forth.

Now rotate the chip. In the rotating frame of the chip, the moving mass experiences a Coriolis effect, with acceleration of size 2Ωv when the rotation rate Ω is about an axis at right angles to the velocity v. This pushes the mass sideways, at right angles to both. The sideways vibration, again read through capacitance, grows in proportion to the rotation rate.

So a MEMS gyroscope reports degrees or radians per second. To find the angle turned, software adds up rate multiplied by time.

Drift, bias and noise

Every sensor has a small offset called bias: it reports a little motion when there is none. It also has random noise and a sensitivity that varies with temperature.

For a gyroscope, a constant bias of 0.01 degrees per second becomes 6 degrees of angle error after 600 seconds. For an accelerometer the problem is worse, because position requires adding up twice. A constant bias b produces a position error of ½bt².

b = 0.01 m/s²   (about one thousandth of g)
t = 60 s
error = ½ × 0.01 × 60² = 18 m

After ten minutes the same bias would give 1.8 km. This is why a phone cannot navigate for long on these sensors alone. It leans on satellite positioning, wireless signals and maps. High-grade inertial navigation systems in aircraft and submarines use far better sensors, and even they drift.

Sampling, range and filtering

The sensors do not report continuously. The chip converts the signal into numbers many times per second, often a hundred or more, though apps and operating systems may lower the rate to save battery or protect privacy.

Motion faster than half the sampling rate cannot be captured faithfully. A rapid vibration can masquerade as a slow wobble, an effect called aliasing. Sensor chips filter the signal before sampling to reduce this.

Each sensor also has a range, such as a few times g for an accelerometer, often selectable. A wider range tolerates hard knocks but spreads the same number of digital steps over a bigger span, so each step is coarser. Beyond the limit the reading clips at the maximum, and any position or angle computed from clipped data is wrong.

Calibrating a motion sensor

Factories adjust each chip, but offsets can shift when it is soldered to a board, and they change with temperature and age. Software therefore keeps estimating corrections during use. When the phone lies motionless, any rotation the gyroscope reports must be bias (apart from the very slow turning of Earth), so it can be recorded and subtracted.

The accelerometer has a neat reference built in. At rest in any orientation, the three readings should combine to the same total:

√(aₓ² + a_y² + a_z²) ≈ 9.8 m/s²

example at rest: aₓ = 4.9, a_y = 0, a_z = 8.49
√(24.01 + 72.08) = √96.09 ≈ 9.80 m/s²

If the total differs noticeably between orientations, the software can fit offsets and scale factors that make all of them agree.

Sensor fusion

What each sensor contributes
Orientation estimate Software blends the inputs Barometer Hints at height changes Magnetometer Gives heading, upset by metal Accelerometer Shows down, noisy in motion Gyroscope Smooth turning, slowly drifts Orientation estimate Software blends the inputs Accelerometer Shows down, noisy in motion Gyroscope Smooth turning, slowly drifts Magnetometer Gives heading, upset by metal Barometer Hints at height changes

A simple method, the complementary filter, trusts the gyroscope for quick changes and nudges the result toward the accelerometer's idea of down over longer times. A Kalman filter does a more formal version, weighting each source according to its expected uncertainty and updating the estimate with each new sample.

This is a general measurement strategy: combine instruments whose errors differ. Averaging helps with random noise, as described in how averaging pulls out a signal, but it cannot remove a steady bias.

What your phone does with them

  • Rotating the screen when you turn the device.
  • Counting steps from the repeating jolts of walking.
  • Stabilizing photos and video by countering hand shake.
  • Aiming augmented reality graphics as you look around.
  • Controlling games by tilting.

Related sensors trigger airbags in cars and help drones stay level. Step counts are estimates produced by a pattern-matching program, so different devices can disagree about the same walk.

Experiments you can try

Many free apps show raw readings and save them. Place the phone flat and record for a minute to see noise and bias. Turn it onto each of its six faces and check whether each axis reads about +9.8 and −9.8 m/s². Any asymmetry reveals offset, and any difference in size from 9.8 reveals a scale error.

You can also set the phone on a rotating office chair or a turntable and compare the gyroscope's rate with your own timing of full turns. Secure the device first. Never record sensor data while driving or while walking near traffic.

Careful notes about uncertainty turn such play into a respectable experiment. Report the spread of readings, not just one value.

Common questions

Does a phone gyroscope need the Earth's rotation?

No. It responds to its own rotation. Earth turns at about 0.004 degrees per second, which is small compared with the noise and bias of a typical consumer sensor, so a phone is not a practical gyrocompass.

Can motion sensors reveal things about me?

Patterns of movement can indicate walking, driving or how a phone is being held. For that reason many systems let you limit which apps or websites may read these sensors. Check your device's privacy settings, which differ between makers and software versions.

Why does the compass ask me to wave the phone around?

The figure-eight motion gives the software readings in many orientations, so it can estimate the magnetic offset caused by the phone's own parts and nearby objects.

Written for 4Sciences with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 51 articles in Measurement and Units →

Latest news on this topic