# How does an iphone directional compass work?

**URL:** <https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940>\
**Category:** Factual Questions\
**Created:** [July 12, 2023, 2:13pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940 "2023-07-12T14:13:35Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![pullin](https://avatars.discourse-cdn.com/v4/letter/p/c57346/32.png) [@pullin](https://boards.straightdope.com/u/pullin)\
**Post date:** [July 12, 2023, 10:04pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/21 "2023-07-12T22:04:46Z")

</div>

> [@Marvin\_the\_Martian](#):
>
> assume the phone uses GPS location to correct for magnetic declination?

Presumably it could, but mine only displays magnetic, not true. I compared it with the wife’s iPhone compass, and they agree perfectly (as well as I can tell).

I delved into to it a little more and got the following:  
Sensor Status:  
Magnetometer-\>Medium  
Accelerometer-\>Good  
Gyroscope-\>Good  
RotationVector-\>Good  
Magnetic Field Strength 47 uT (u=micro, don’t know how to code that symbol here)

The altitude app shows barometric pressure, so I assume there’s a barometer in there somewhere.

---

<div class="post-metadata">

**Author:** ![Marvin\_the\_Martian](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/marvin_the_martian/32/2898_2.png) [@Marvin\_the\_Martian](https://boards.straightdope.com/u/Marvin_the_Martian)\
**Post date:** [July 12, 2023, 11:07pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/22 "2023-07-12T23:07:43Z")

</div>

> [@Chronos](#):
>
> I have a (completely free) app on my phone called Physics Toolbox Suite, which provides direct access to all of the sensors on the phone, and allows logging data from them. I’ve used it most for the accelerometers, but it also has the magnetometers in it.

Thanks a lot. Now I have yet another way to be distracted by my phone.

---

<div class="post-metadata">

**Author:** ![Johnny\_L.A](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/johnny_l.a/32/1084_2.png) [@Johnny\_L.A](https://boards.straightdope.com/u/Johnny_L.A)\
**Post date:** [July 12, 2023, 11:25pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/23 "2023-07-12T23:25:20Z")

</div>

> [@Pork\_Rind](#):
>
> At least in my version of iOS, the default compass app installed as part of a standard iOS install, it’s just called _Compass_.

The app on my phone that I have to pay for to use is – or _was_, since I’ve just deleted it – Compass GPS. I do have Compass in my Extras app. It would be nicer if it was on the main screen, but at least I know where it is.

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [July 12, 2023, 11:52pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/24 "2023-07-12T23:52:16Z")

</div>

Just move it if you want it on the first screen.

---

<div class="post-metadata">

**Author:** ![Lucas\_Jackson](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lucas_jackson/32/303_2.png) [@Lucas\_Jackson](https://boards.straightdope.com/u/Lucas_Jackson)\
**Post date:** [July 12, 2023, 11:52pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/25 "2023-07-12T23:52:46Z")

</div>

> [@Pork\_Rind](#):
>
> At least in my version of iOS, the default compass app installed as part of a standard iOS install, it’s just called _Compass_.

Same here. I Letterbox and Geocache so I’ve used mine quite a bit for years.

---

<div class="post-metadata">

**Author:** ![Machine\_Elf](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@Machine\_Elf](https://boards.straightdope.com/u/Machine_Elf)\
**Post date:** [July 13, 2023, 10:18am UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/26 "2023-07-13T10:18:26Z")

</div>

> [@bump](#):
>
> Depends on the size of the ship, I suppose. Phones regularly get 3 meter accuracy, so if you have a big enough ship, you can probably get a pretty good idea of what direction you’re going. And your GPS accuracy slop will be minimized as well, because of hte
> 
> But that’s still only as accurate as your GPS receiver. Most receivers are only good to about 3-5 meters with regular old single-frequency GPS, if you’re not using some sort of differential assistance. I’m not feeling froggy enough to work out the exact amount, but you could be off by however much about 3 meters at either end translates to for a ship of whatever size. On a small boat, that could be very significant.

As @Chronos mentioned, I wasn’t talking about forming a satellite compass on a ship using two phones - I was talking about implementing a satellite compass on a single phone using two GPS receivers in that single phone. If you put a receiver at each end of the phone, the separation distance is only a few inches, likely not enough for GPS to resolve with acceptable accuracy.

---

<div class="post-metadata">

**Author:** ![Francis\_Vaughan](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/francis_vaughan/32/3093_2.png) [@Francis\_Vaughan](https://boards.straightdope.com/u/Francis_Vaughan)\
**Post date:** [July 13, 2023, 10:59am UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/27 "2023-07-13T10:59:10Z")

</div>

Some remarkable things are done with GPS.  
Instantaneous velocity is usually done with Doppler. It isn’t as accurate as using positional information but is available right away. More accurate requires time.  
So I wouldn’t be surprised if a passable estimate of orientation could not be got from phase differences along the length of a phone. Not going to be as good as a magnetic compass, but not totally unusable either. The more satellites in view across the sky the better- just like positioning.  
GPS receiver chips are now about a rice grain in size and not a huge impost on the BOM.  
I rather doubt there is enough value in the idea but it isn’t totally hopeless.

---

<div class="post-metadata">

**Author:** ![JKellyMap](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/jkellymap/32/15880_2.png) [@JKellyMap](https://boards.straightdope.com/u/JKellyMap)\
**Post date:** [July 13, 2023, 12:22pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/28 "2023-07-13T12:22:11Z")

</div>

> [@Pasta](#):
>
> Topology maps

Nitpick: “topography.”

(Topology is the science of “why is a donut like an earthworm?”)

---

<div class="post-metadata">

**Author:** ![GaryM](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/garym/32/241_2.png) [@GaryM](https://boards.straightdope.com/u/GaryM)\
**Post date:** [July 13, 2023, 12:33pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/29 "2023-07-13T12:33:31Z")

</div>

> [@JKellyMap](#):
>
> Topology is the science of “why is a donut like an earthworm?

Oh Oh Oh, pick me! I know the answer.

They both have a hole all the way through themiddle

---

<div class="post-metadata">

**Author:** ![JKellyMap](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/jkellymap/32/15880_2.png) [@JKellyMap](https://boards.straightdope.com/u/JKellyMap)\
**Post date:** [July 13, 2023, 12:37pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/30 "2023-07-13T12:37:28Z")

</div>

Yup. A “torus.”

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [July 13, 2023, 12:55pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/31 "2023-07-13T12:55:11Z")

</div>

Alternately, a topologist is someone who can’t tell his ass from a hole in the ground, but can tell his ass from two holes in the ground.

---

<div class="post-metadata">

**Author:** ![bump](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@bump](https://boards.straightdope.com/u/bump)\
**Post date:** [July 13, 2023, 1:21pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/32 "2023-07-13T13:21:41Z")

</div>

Fair enough; I misread what you were saying- you’re exactly right!

---

<div class="post-metadata">

**Author:** ![Topologist](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/topologist/32/3208_2.png) [@Topologist](https://boards.straightdope.com/u/Topologist)\
**Post date:** [July 13, 2023, 4:56pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/33 "2023-07-13T16:56:59Z")

</div>

> [@Chronos](#):
>
> Alternately, a topologist is someone who can’t tell his ass from a hole in the ground, but can tell his ass from two holes in the ground.

I resemble that remark.

---

<div class="post-metadata">

**Author:** ![Pasta](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pasta](https://boards.straightdope.com/u/Pasta)\
**Post date:** [July 13, 2023, 5:23pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/34 "2023-07-13T17:23:26Z")

</div>

> [@JKellyMap](#):
>
> Nitpick: “topography.”

Yeah, shortly after posting I realized I mistyped but missed the edit window and didn’t want to bump the thread for the correction, anticipating someone else might anyway. 🙂 (I use the word “topology” dozens of times a year and the word “topography” approximately never, so my fingers happily typed the wrong word.)

---

<div class="post-metadata">

**Author:** ![Digger11](https://avatars.discourse-cdn.com/v4/letter/d/838e76/32.png) [@Digger11](https://boards.straightdope.com/u/Digger11)\
**Post date:** [July 16, 2023, 3:21am UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/35 "2023-07-16T03:21:22Z")

</div>

> [@Pasta](#):
>
> A few years back I put my phone in a sealed bag that I then compressed it to see if the phone’s altimetric reading was based on air pressure or GPS. I was surprised that it was air pressure.

An altimeter is simply a barometer with a different face on it.

---

<div class="post-metadata">

**Author:** ![Pasta](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pasta](https://boards.straightdope.com/u/Pasta)\
**Post date:** [July 16, 2023, 4:12am UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/36 "2023-07-16T04:12:17Z")

</div>

> [@Digger11](#):
>
> An altimeter is simply a barometer with a different face on it.

Well, a pressure-based altimeter is, but that’s not the only way to measure altitude, which is why I was testing the principle of operation of this particular altimeter.

---

<div class="post-metadata">

**Author:** ![Johnny\_L.A](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/johnny_l.a/32/1084_2.png) [@Johnny\_L.A](https://boards.straightdope.com/u/Johnny_L.A)\
**Post date:** [August 3, 2023, 3:34pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/37 "2023-08-03T15:34:41Z")

</div>

As you may know, I put a new battery in my old iPhone 6s. I checked the compass, and it gave me my elevation. (I think it’s off by 10 or 15 feet.) I checked my iPhone SE, and it does not give me the elevation.

---

<div class="post-metadata">

**Author:** ![Robot\_Arm](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/robot_arm/32/18280_2.png) [@Robot\_Arm](https://boards.straightdope.com/u/Robot_Arm)\
**Post date:** [August 3, 2023, 4:35pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/38 "2023-08-03T16:35:34Z")

</div>

> [@bump](#):
>
> But that’s still only as accurate as your GPS receiver. Most receivers are only good to about 3-5 meters with regular old single-frequency GPS, if you’re not using some sort of differential assistance. I’m not feeling froggy enough to work out the exact amount, but you could be off by however much about 3 meters at either end translates to for a ship of whatever size. On a small boat, that could be very significant

I read something once (a couple decades ago) about how very busy harbors had a system that improved the accuracy of GPS. They would find a high position, like the top of a building, and survey the location very accurately. Then they put a GPS receiver there. By comparing its known location with where the GPS receiver thought it was, they could determine how much of an error the GPS receiver was experiencing. Then they would broadcast that error to the ships in the harbor, which were calculating their GPS position from the same satellite signals as the reference location. By applying that correction, they were accurate within centimeters, instead of meters.

All of which suggests to me that the inaccuracy of GPS isn’t purely random. Two receivers in close proximity, picking up signals from the same satellites, at the same time, will have the same positional error. If that’s true, then receivers at the bow and stern of a ship would be off by the same amount. That doesn’t help calculate your position, but you should be able to get an accurate orientation.

And, as pointed out, a smartphone is small enough that even a small error in either receiver is going to lead to a big error in orientation.

I may not be correct in how the GPS error works, or I may be out of date. Can anyone here fight my ignorance about how GPS works?

> [@Chronos](#):
>
> Alternately, a topologist is someone who can’t tell his ass from a hole in the ground, but can tell his ass from two holes in the ground.

Whoever wrote that was not a topologist. Unless you dig down, then sideways, then up (creating a tunnel), a “hole in the ground” doesn’t change the topology.

I think that’s right, but I’m not a topologist.

---

<div class="post-metadata">

**Author:** ![gnoitall](https://avatars.discourse-cdn.com/v4/letter/g/bb73d2/32.png) [@gnoitall](https://boards.straightdope.com/u/gnoitall)\
**Post date:** [August 3, 2023, 4:52pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/39 "2023-08-03T16:52:18Z")

</div>

> [@Robot\_Arm](#):
>
> I may not be correct in how the GPS error works, or I may be out of date. Can anyone here fight my ignorance about how GPS works?

Here’s a cool article from Penn State about sources of error in GPS position determination.

[https://www.e-education.psu.edu/geog160/node/1924](https://www.e-education.psu.edu/geog160/node/1924)

> [@Robot\_Arm](#):
>
> Unless you dig down, then sideways, then up (creating a tunnel), a “hole in the ground” doesn’t change the topology.

You can also keep digging until you emerge from the other side. Well, topologically you can. Reality is a little different.

---

<div class="post-metadata">

**Author:** ![Robot\_Arm](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/robot_arm/32/18280_2.png) [@Robot\_Arm](https://boards.straightdope.com/u/Robot_Arm)\
**Post date:** [August 3, 2023, 4:57pm UTC](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940/40 "2023-08-03T16:57:18Z")

</div>

> [@gnoitall](#):
>
> You can also keep digging until you emerge from the other side.

To paraphrase Winston Zeddemore, that’s a big donut.

[Previous page](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940.md?page=1)

[Next page](https://boards.straightdope.com/t/how-does-an-iphone-directional-compass-work/986940.md?page=3)
