# iPhone compass not being affected by current

As you probably know, electrical current and magnetic fields are close friends. In an iPhone there is a compass, however there are also lots of cables and in all of them, or at least in most of them passes a current. How come the current doesn't drive the compass away (and far) from the real north?

-
A part of me doubts that the iphone compass uses a magnet--it is probably finding true north using the GPS device in the phone. – Jerry Schirmer May 12 '13 at 2:21
@JerrySchirmer You just don't seem to know how a GPS works then. Direction detection isn't possible with GPS, at least not easily. – FunKy May 28 '13 at 13:45

1. If current flows one way in one wire, there's probably current flowing oppositely in a nearby wire. Engineers can arrange those wires next to each other, so magnetic fields cancel (mostly) except very close to the pair. For even better cancellation, they can use a twisted pair.

2. Even better, some cables could be coax - a core wire and a conductive outer shell. Currents flow in opposite ways through core and shell, cancelling even better than a close pair.

3. The currents in a smartphone or tablet are small. You're not making toast or illuminating the room with it, are you? Signals are probably microamps to milliamps, and power conductors maybe a few hundred milliamps typically when in use, at times an over one amp. To match the strength of the Earth's magnetic field, a loop of wire 1cm^2 area and 1cm away has to carry roughly one Amp or so current. Engineers try to place the magnetometer far from the heaviest current-carrying conductors.

4. The currents are varying at RF frequencies, CPU frequencies, $I2C$ frequencies, Bluetooth frequencies, audio frequencies, etc. anything but slow. The magnetometer doesn't respond to such fast changes - or least, such stray signals that are picked up, are snuffed out with a low-pass filter. Only the average magnetic field over, say, 100ms or one second, is measured.

About point #3: Try plugging numbers into this online magnetic field calculator: http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/curloo.html#c2

The Earth's magnetic field in places where Humans can be found, at least the non-astronauts, is about 1/4 to 1/2 Gauss.

In the final analysis, yes, the magnetometer is influenced by nearby circuitry, but steps are taken to reduce it, and just how much accuracy do we expect? The disturbance is within specs, whatever those specs are exactly. I wouldn't use a cell phone for life-or-death purposes, navigating huge sea vessels, etc.