A Pluto.Studio app
SensorLab 15 sensor tools for Android · Free
Motion & position

Compass

A phone finds north by measuring the Earth's magnetic field. It points to magnetic north rather than true north, and any nearby metal or magnet will throw it off.

At a glance
Specifications for the Compass tool
Sensor usedMagnetometer, tilt-compensated by the accelerometer
UnitDegrees, magnetic heading (0–360°)
Useful rangeFull circle, outdoors and away from metal
Cannot doGive true north without a declination correction, or work reliably inside vehicles and steel-framed buildings
How it works

The mechanism, not the marketing.

The magnetometer senses the direction of the Earth's magnetic field. On its own that only works if the phone is flat, so the accelerometer supplies the tilt and the heading is corrected for how the phone is being held.

The result is a magnetic heading: the direction to magnetic north from where you are standing.

Honest limits

What a phone cannot do here.

  • Magnetic north and true north are not the same. The difference, called declination, depends on where you are on Earth and ranges from near zero to tens of degrees. Navigating by map without accounting for it introduces a real error.
  • Nearby ferrous metal and magnets dominate the Earth's field, which is weak. Car bodies, reinforced concrete, radiators, speakers and magnetic phone mounts all distort the heading, sometimes severely.
  • Magnetometers need calibration, which is why phones ask you to move the device in a figure-eight. Skipping it leaves a standing offset.
Questions

Why is my phone compass wrong?

Almost always local magnetic interference or missing calibration. Move away from metal, take the phone out of a magnetic mount or case, and sweep it in a figure-eight motion.

Does it show true north or magnetic north?

The magnetometer measures magnetic north. Converting to true north requires applying the local declination for your position.

Does it work indoors?

Poorly, often. Steel framing, wiring and appliances distort the field that the compass depends on.

Related tools

Every sensor your phone has, in one app.

15 tools and a multi-sensor CSV logger. Free, with a one-time remove-ads purchase.

Get Sensor Lab on Google Play
Free · No account required

← All 15 tools