Abstract:
An electronic device may be provided with an electronic compass. The electronic compass may include magnetic sensors. The magnetic sensors may include thin-film magnetic sensor elements such as giant magnetoresistance sensor elements. Magnetic flux concentrators may be used to guide magnetic fields through the sensor elements. To reduce offset in the electronic compass, the magnetic flux concentrators may be demagnetized by applying a current to a coil in the housing. The coil may be formed from loops of metal traces within a printed circuit or other loops of conductive paths. Magnetic flux concentrators may have ring shapes. A ring-shaped magnetic flux concentrator may be formed from multiple thin stacked layers of soft magnetic material separated by non-magnetic material.