← Glossary
What is a compass and how to measure a direction with a smartphone?

Compass

A compass is an instrument that indicates the direction of magnetic north: it gives the azimuth, that is, the horizontal angle between the device’s orientation and that north. On a smartphone, it is not a magnetised needle but a value computed from the magnetometer.

Discover FizziQ

How to measure it in class

With FizziQ, you can follow live the azimuth indicated by the phone’s compass and understand where this value comes from.

Steps:

  • Open FizziQ and display the compass measurement (derived from the magnetometer), which gives an azimuth from 0 to 360°.
  • Lay the phone flat on a table, away from any metal object, and locate the direction of north.
  • Turn the device slowly: check that the azimuth changes by the same amount as the rotation.
  • Bring a magnet or an iron object closer: watch the needle deviate, revealing the influence of magnetic masses.
  • Compare the direction obtained with that of a classic compass or a map.

Scientific activities on this topic

Possible extensions with FizziQ: locating ferromagnetic objects in a room, comparing several phones, or orienting a map using the azimuth. See the smartphone sensors guide.

Learn more

The smartphone’s magnetometer measures the three components of the magnetic field (along the device’s x, y and z axes). The Earth’s field adds its signature: held flat, the compass mostly uses the horizontal component of the field to find the direction of north. A pedagogical paradox illustrates it: bring a magnet close, the raw field value goes wild, but the compass often keeps pointing north. The reason lies in permanent software processing that subtracts stray fields and slowly tracks drifts: it is the whole difference between raw data and processed data. A smartphone is not a metrology instrument, and the orientation remains sensitive to metal structures and nearby magnets.

Orders of magnitude: in western Europe, the Earth’s magnetic field is about 47 µT, of which only about 20 µT for the horizontal component (the one the compass uses), the rest plunging towards the ground. The magnetometer distinguishes variations of about 0.1 to 0.3 µT. The realistic accuracy of the displayed azimuth is of the order of a few degrees, and degrades sharply near metal objects.

Formula

For a phone held flat, the azimuth follows from the two horizontal components of the measured field:

azimuth = arctan(Bx / By)

Where:

  • Bx and By: horizontal components of the measured magnetic field, in µT.
  • azimuth: angle relative to magnetic north, expressed from 0 to 360°.

This value gives magnetic north; to obtain true north, the local magnetic declination must be added.

Application examples

  • Orientation on a hike and topographic map reading.
  • Locating metal rebar in a wall or a slab.
  • Aligning a solar panel or an antenna in a given direction.
  • Determining the orientation of a façade or a classroom.
  • Studying the influence of metal objects on a direction measurement.
  • Comparing magnetic north and true north (declination).

FAQ

Q: Why is the smartphone compass sometimes wrong? A: A magnet, a case with a magnetic clasp or a metal structure distort the measured field. You must move these objects away and sometimes redo a few figure-eight motions to help the software processing.

Q: Does the compass indicate true north? A: It indicates magnetic north. True north follows by adding the local declination; some apps apply this correction automatically.

Q: Do all smartphones have a compass? A: Only models fitted with a magnetometer have one. That is the case for the vast majority of recent smartphones, but a few entry-level devices lack it.

Magnetometer - Earth’s magnetic field - Teslameter - Magnetic declination - Orientation

Explore FizziQ

Discover all the science experiments you can do with your smartphone.