iOS Compass

20 10 2014

You iPhone comes with the built-in app Compass which includes a Bubble Level designed by Jonathan Ive.

Open the app, swipe left, and move your device around a horizontal or vertical axis to see whether something is thrown out of kilter.

Unfortunately the Compass app won’t help if you stray from the straight and narrow or an Android fanboy went astray.


Compass is a nifty little helper and saves about 1$ for picking up a bubble level app from the App Store.

Apple’s app wouldn’t work without the help of the nature, particularly the Earth’s magnetic field. It’s mostly caused by electric currents in the liquid outer core, which is composed of conductive, molten iron. Loops of currents in the constantly moving, liquid iron create magnetic fields.

From afar, the Earth looks like a big magnet with a north and south pole like any other magnet (the pole located up in northern Canada is really the magnetic South Pole).

The technique …

If you are a proud owner of an iPhone you have purchased a device which is in someway much more sensitive than any human being ever can be. iPhone’s sensors know all about your finger, the distance between your ear and the device, the brightness of the environment, the strength of the magnetic field you are actually in, and your current location and movements.

This mind map shows you all sensors implemented in the new iPhone 5S.


Feel free to download this map from my Box account.

The alternative file formats have been created with iThoughts for iOS (.ITMZ file format). Compatibility to other tools is limited. The DOCX file format is suggested for those who don’t use a mind mapping tool. The file contains the image as well as a detailed outline of all topics.

Application File format
Adobe Reader PDF
Apple iWork/Microsoft Word DOCX
iThoughts ITMZ
MindManager MMAP

With the iPhone 4 Apple manifested it’s market leading smartphone technology. The integration of the 3-axis accelerometer, the gyroscope, and the Hall-Effect-based compass provides full nine degree-of-freedom (9DoF) motion sensing and can be seen as a milestone in the evolution of portable consumer electronics devices.

A voltage difference (the Hall voltage) is generated across an electrical conductor, transverse to an electric current in the conductor and a magnetic field perpendicular to the current (discovered by US physicist Edwin Hall in 1879). The voltage measures the magnet field’s intensity.

The position of a rigid body in space is defined by three components of translation and three components of rotation, which means that it has six degrees of freedom.
Translation: Moving up and down, left and right, forward and backward
Rotation: Tilting forward and backward, swiveling left and right, pivoting side to side
iPhone’s sensors provide 9 independent parameters and so we talk about 9DoF: 3-axis accelerometer, 3-axis gyroscope, 3-axis magnetometer

The Compass app uses some of the 10 sensors of your device to process their raw data and display them as a user-friendly information.


The Attitude (rotation) sensor provides the pitch, roll and yaw (azimuth) angles of the device relative to the normal horizon. It’s part of the Device-Motion information computed by the iPhone operating system from the main sensors, particularly the gyroscope.

Although the gyroscope provides precise measurements of the angular rates, calculating rotations only from the gyroscope are subject to a noticeable drift due to various inherent physical phenomena like gyro precession. The Device-Motion computation automatically uses measurements from the accelerometer to minimize the drift.

There is much work for iOS to show precise data because the Earth’s magnetic field wasn’t designed by Apple saying NO to complicated things.

Strength and direction of the magnetic field is dependent of your current position.

  • Intensity
    is the overall strength of the magnetic field.
    This globe shows the intensity and direction of the earth’s magnetic field at the surface of the earth. On average, the field strength is about half a gauss; 0.5 gauss or 50 μT. Locally, however, this varies. For example, the field strength in Cupertino, USA is about twice as strong as in Rio de Janeiro, Brazil.
  • Declination
    is how far off from true north you would expect a compass to point, where true north points straight to the earth’s north pole (the top of the globe, where it rotates).
  • Inclination
    is how much the field direction is pointing up (into the sky) or down (into the ground). Up is denoted as positive numbers, while down is negative.

The app …

The Compass app has gone through a major redesign with Apple’s release of iOS 7 in October 2013. Redone from top to bottom, it now looks like a cockpit flight instrument with no hint of wood paneling or rosy parchment paper of older versions of iOS.

The compass offers all of the features present in the iOS 6 version of the app (though the choice between true north and magnetic north has moved to Settings – Compass), and as an added bonus it refers to geolocation services when showing your current city and state, and latitude and longitude coordinates below. In addition, if you want to follow a particular bearing (say, 23 degrees northwest), you can tap the compass face once to set it; as you move around, the compass draws a red arc on the inside of the circle, showing how far you’re deviating from your original course.


Finally, the new compass recalibration tool says farewell to awkward figure eights and waving your phone in the air; instead, you play a make-the-dot-follow-the-circle game that’s not only much more enjoyable, but easier to explain to random passersby.

That may be all for the compass tool, but it’s not all the app has to offer:
Swipe left on the compass, and you access an iOS 7- exclusive tool: a horizontal and vertical level. The level is wonderfully simple, using white, black, and green geometric shapes to display level information.

Place your device flat on its back, and two overlapping white circles appear with a degree of measurement in the center; as you adjust the level, the circles change until they overlap perfectly for more than a few seconds—at that point, the screen goes bright green to indicate you’ve achieved a perfect level. Hold your device in landscape or portrait mode in an upright position and the app shows a rectangular level, dividing the screen into white and black squares. When the white square reaches equilibrium with the black square, the screen turns green. The y- and z-axis then are parallel to the ground and the x-axis is perpendicular to the Earth’s surface.

Limitations …

If you find yourself having problems with the motion sensors that power your iPhone’s Compass, Maps, or other third-party apps, you need to calibrate the compass before using Maps, Compass, or other apps that use this feature.

The calibration screen that appears when you first launch the app hooks into Apple’s entire Core Motion framework, which includes your accelerometer, gyroscope, and other motion data. Calibrate the device in Compass, and it should properly adjust your motion data in other apps. Unfortunately, this calibration isn’t perfect.

You can try to fix badly-behaving motion data by force-quitting and relaunching Compass to trigger the calibration screen. The accuracy of digital compass headings can be affected by magnetic or other environmental interference, including interference caused by proximity to the magnets contained in the iPhone earbuds or your car’s dashboard. You’ll have the best luck if you calibrate at least several feet away from any other magnetic or electronic devices.

Apple does note in the support document TS 2767 that

you shouldn’t rely on it to determine precise locations, proximity, distance, or directions.

Sensors such as the one in the iPhone aren’t necessarily as good as a traditional mechanical compass, sadly.

Summary …

A nice-to-have little app showing us what miniaturized sensors in modern devices can do for us in a pretty precise way.

Messing with powerful magnets near your iPhone can alter the calibration of the sensor. While the compass can re-calibrate itself, it is possible to mess it up. There are a number of stainless steel shields inside an iPhone that might have been very slightly magnetized by passing magnets. While the compass may work reasonably well, it doesn’t show the same overall field strength when you twist the device around in different directions. Avoid getting powerful magnets too close to your iPhone.

The North and South magnetic poles wander widely, but sufficiently slowly for ordinary compasses to remain useful for navigation. However, at irregular intervals averaging several hundred thousand years, the Earth’s field reverses and the North and South Magnetic Poles relatively abruptly switch places.

But don’t worry. If this happens Apple will immediately release an update to iOS which lets you find the way back home.

Related links …


Thanks for dropping by.



%d bloggers like this: