At home

How does a phone know when to rotate its screen?

Turn a phone sideways and its picture can turn to match. Tiny sensors provide clues about the device's orientation.

A phone switches to landscape mode
A phone switches to landscape mode · AI-generated illustrative image
✦ The short answer

An accelerometer helps a phone detect its tilt. When the device is held still, its readings can indicate which side points down. Software can then rotate the picture, provided the app and settings allow it.

The cover is an illustration. The diagrams show a simplified model; sensor parts and their movements are not drawn to scale.

A tiny mass inside

Many accelerometers contain a tiny mass on a flexible suspension. Electronics detect its displacement relative to the casing. This produces readings for different directions.

The yellow mark identifies the same edge before and after a quarter-turn. Red arrows show the direction of gravity, not the sign of sensor readings. Automatic picture rotation is allowed in this example.
The yellow mark identifies the same edge before and after a quarter-turn. Red arrows show the direction of gravity, not the sign of sensor readings. Automatic picture rotation is allowed in this example.

Holding still gives a clue too

A sensor supported in your hand gives a signal even without visible movement. Gravity contributes to this signal. As you slowly turn the phone, the components along its directions change. These help distinguish portrait from landscape.

The mass on springs is a simplified sensor model. Electronics measure displacement and software interprets the data. Depending on the device, other sensors can help.
The mass on springs is a simplified sensor model. Electronics measure displacement and software interprets the data. Depending on the device, other sensors can help.

Software interprets the signals

Sudden movements affect the readings too. Software can smooth signals and combine several sensors. An additional gyroscope measures how quickly the device turns. The exact arrangement varies between phones.

Sensing and rotating are separate steps

Detecting a change of orientation does not always rotate the picture. A rotation lock or an app that supports only portrait mode can keep the display fixed. An unchanged picture therefore does not prove that a sensor is broken.

↗ Try it yourself

Turn slowly and compare

  1. Sit at a table with an adult. On a phone you already have, open an app that supports both portrait and landscape, such as a web browser. Together, check that automatic rotation is allowed. Remember the original setting.
  2. Hold the phone securely in both hands, almost upright in front of you. Slowly turn it sideways by a quarter-turn and pause. Draw the orientation of the casing and the picture. Slowly turn it back.
  3. If a rotation lock is available, switch it on with the adult and repeat the same movement. Compare, then restore the original setting. You are observing the screen's behaviour; you cannot see the tiny sensor mass itself this way.

Observe while seated over the table and keep a firm hold of the device. Do not shake, throw, drop or open it. No extra app is needed.

The takeaway

Sensors provide clues about a phone's orientation. Software uses them to decide how to display the picture. Automatic rotation works only when the app and settings permit it.

A little question for you

What helps a phone held still detect its tilt?

Sources & further reading

Google · Science Journal Help: Sensors on your device · Accelerometer ↗NASA: Mars Buggy Curiosity Measures a Mountain's Gravity · Accelerometers at rest ↗Android Developers: Motion sensors · Gravity, accelerometer and gyroscope ↗Apple Support: Rotate the screen on your iPhone or iPod touch · App support and rotation lock ↗

Our stories explain the main idea in our own words. Pictures and models simplify reality and are not drawn to scale.

Copy link

Select and copy this address: