How the compass works in the Xiaomi smartphone: device, configuration and troubleshooting

Xiaomi’s modern smartphones are equipped with a variety of sensors, including an electronic compass (magnetometer), a small but important module that allows you to determine the direction of the world, navigate in space and improve the operation of navigation applications, but not all users understand how it functions, why it sometimes shows incorrect data and how to set it up correctly.

Unlike a classic magnetic compass, the digital counterpart in a smartphone works on the basis of microelectromechanical systems (MEMS) In this article, we will discuss in detail how the compass works in Xiaomi devices, consider the features of its implementation in different models (from the budget Redmi to the flagship Mi), and give practical recommendations for improving the accuracy of readings. Particular attention will be paid to typical problems – for example, when the compass needle β€œjumps” or shows the wrong direction.

If you have ever encountered the fact that maps in Google Maps or Yandex.Navigator incorrectly determine your position, or the compass arrow in the Compass application behaves chaoticly - this article will help to understand the causes and troubleshoot without contacting the service center.

How is an electronic compass in Xiaomi smartphones

The electronic compass in Xiaomi smartphones is a complex of several sensors that work synchronously:

  • 🧲 The magnetometer is the main sensor that measures the strength of the Earth's magnetic field, and it determines the direction northward.
  • πŸ“± Accelerometer – fixes the acceleration and tilt of the device, helping to correct the compass readings when changing the position of the smartphone.
  • πŸŒ€ Gyroscope – tracks angular rotation speeds, which is necessary to stabilize the compass needle when moving.

Most Xiaomi models use a magnetometer from the company AKM Semiconductor (e.g., Semiconductor, AK09918 or AK8963), integrated into a common sensor chip (IMU β€” Inertial Measurement Unit: This chip combines all three components into a single package, saving space on the board and reducing power consumption.

It's important to understand that the compass in a smartphone is not a stand-alone device, and it depends on:

  • πŸ”‹ Battery states (at low charge, sensors can shut down to save energy).
  • πŸ“Ά Signal quality GPS (correcting).
  • πŸ› οΈ Correctness of calibration (without it, the accuracy drops significantly).

⚠️ Note: In cheap Redmi models (e.g. Redmi) 9A or Redmi 10A) There may be no separate magnetometer, and in this case, the compass runs through software emulation based on the GPS and gyroscope, which significantly reduces the accuracy.

The principle of operation: how the smartphone determines the directions of the world

The directional algorithm in Xiaomi smartphones consists of several stages:

  1. Data collection: The magnetometer measures the vector of the Earth's magnetic field in three axes (X, Y, Z). The accelerometer and the gyroscope record the position of the device in space.
  2. Adjustment of readings: The system takes into account the tilt of the smartphone, its rotation and external interference (for example, metal objects nearby).
  3. Calculation of azimuth: Based on the corrected data, the angle of deviation from magnetic north is calculated.
  4. Display the result: An application (like a standard Compass or Google Maps) visualizes an arrow or a card rotation.

Xiaomi’s compass uses machine learning algorithms to filter noise, such as the Snapdragon 8 Gen 2 processor (such as the Xiaomi 13 Pro) that handles the data, using a specialized Qualcomm Hexagon coprocessor that reduces the error to a low level. Β±1Β°.

However, even the most advanced algorithms can’t save you from external interference: metal cases, magnets in cases or close-up electronic devices (for example, wireless headphones) can distort the readings of the magnetometer, in which case the smartphone will either show the wrong direction or completely refuse to display the compass data.

πŸ“Š How often do you use a compass on your smartphone?
Permanently (for example, for orienteering in the forest)
Sometimes (for navigation in the city)
There was no magnetic interference around.
Never used it.

How to check the compass on Xiaomi

Before you set up or calibrate the compass, make sure it works at all.

  1. Open the standard Compass app (if you don’t have one, download any similar app from Google Play, such as Compass Galaxy).
  2. Put your smartphone on a flat surface and rotate it in a circle.
  3. If the arrow is moving smoothly, the compass is good, and if the arrow is twitching, sticking, or showing random values, calibration or diagnosis is required.

For a more detailed check, use the engineering menu:

  1. In the phone app, type ##4636##.
  2. Select the Testing item β†’ Sensors.
  3. Find the Magnetic Field (Magnetic Field) in the list.
  4. Turn the device - the values along the X, Y, Z axes should change smoothly.

If the values are unchanged or 0.0, this may mean:

  • πŸ”§ Hardware fault of the sensor (requires repair).
  • πŸ“± Disabling the sensor by the system (for example, due to charge savings).
  • πŸ›‘οΈ Blocking access to the sensor at the OS level (for example, in some firmware) MIUI China).

⚠️ Note: In some Xiaomi models (e.g, POCO F5) You can lock the menus, and in this case, you can use an application like Sensor Test to check the sensors. CPU-Z.

Calibration of the compass: step-by-step instructions

If the compass shows incorrect data, the first thing to do is calibrate it, and on Xiaomi smartphones, you can do this in two ways: through standard settings or using third-party apps.

Method 1: Calibration using Google Maps

  1. Open Google Maps and wait until your location is determined (blue dot).
  2. Touch the blue dot and a menu will appear with accuracy information.
  3. Press Calibrate Compass.
  4. Follow the instructions on the screen: rotate the smartphone on the figure of β€œeight” 3-4 times.

Method 2: Calibration through the engineering menu

  1. Type ##6484## (not available on all models)
  2. Select the Magnetic Sensor Test.
  3. Press Calibrate and rotate the device in different planes.

For more accurate calibration, use the app. GPS Status & Toolbox:

Open the application and go to the Compass tab

Press Calibration (circular arrow icon)

Rotate your smartphone on all axes until the scale is filled with green.

Repeat the procedure in an open space (away from metal and electronics)

-->

After calibration, check the compass accuracy in real-world conditions.

  • πŸ“ Face a known landmark (for example, the sun at noon – it is about south).
  • 🧭 Compare the compass readings to the real direction.
  • πŸ”„ Repeat the check in different places (such as at home and on the street).
Xiaomi modelType of magnetometerPrecision after calibrationFeatures
Xiaomi 13 UltraAK09918CΒ±1–2Β°Support for hardware interference correction
Redmi Note 12 Pro+AK8963Β±3–5Β°Sensitive to metal covers
POCO X5 ProYAS539Β±4–6Β°Requires frequent recalibration
Redmi 10CSoftware emulationΒ±10–15Β°Low accuracy, depending on the GPS

Typical problems and their solutions

Even after calibrating the compass in smartphones, Xiaomi may not work properly. Let's look at the most common problems and how to fix them.

1. The compass arrow twitches or rotates chaotically

Reasons:

  • πŸ”Œ Effects of electromagnetic interference (for example, from a charger or headphones).
  • πŸ“± Sensor malfunction or poor contact with the board.
  • πŸ”„ Failure to work MIUI (especially after updates).

Decisions:

  • πŸ”Œ Disable all peripherals and check the compass away from electronics.
  • πŸ”„ Restart your smartphone in Safe Mode (hold the power button) β†’ Safe regime).
  • πŸ› οΈ If the problem remains, reset the sensor settings through Settings. β†’ Annexes β†’ Application management β†’ Three points. β†’ Resetting application settings.

2. the compass shows the wrong direction (e.g. north instead of south)

Reasons:

  • 🧲 Strong magnetic interference (for example, a speaker or metal object is nearby).
  • πŸ“ Incorrect calibration or reset of sensor data.
  • 🌍 Using true north instead of magnetic north (the difference can be as high as 10-15).Β° depending on the region).

Decisions:

  • 🧲 Make sure there are no magnets or metal objects nearby.
  • πŸ”„ Calibrate again (see section above).
  • 🌍 In the compass settings, enable the option to use true north (if available).

πŸ’‘

If the compass only shows incorrect data in one app (like Google Maps), try clearing its cache: β†’ Annexes β†’ Google Maps β†’ Warehouse β†’ Clear the cache.

3.The compass doesn't work at all.

Reasons:

  • πŸ”§ Hardware breakdown of the sensor (for example, after falling or getting moisture).
  • πŸ“± Disabling the sensor at the system level (for example, in ultra-low power mode).
  • πŸ›‘οΈ Blocking access to the sensor due to security policies (e.g. in corporate firmware).

Decisions:

  • πŸ”§ Check the sensor through the engineering menu (see the section "How to check the compass workΒ»).
  • πŸ“± Turn off energy saving modes: Settings β†’ Battery β†’ Energy saving regime β†’ Shut down.
  • πŸ”„ Reset your smartphone settings to factory (pre-return backup!).

⚠️ Attention: If after a fall or impact the compass stopped working, and in the engineering menu the sensor does not display any values - most likely there was a break in contacts or damage to the chip.

How to improve compass accuracy in the field

If you use a compass for nature orientation (such as hiking or fishing), follow these guidelines:

  • πŸ“΅ Turn off mobile data and Wi-Fi. Electromagnetic radiation can affect magnetometer readings.
  • πŸ”‹ Charge your smartphone to 100%. With a low charge, the system can turn off the sensors to save energy.
  • 🧲 Remove the case. Many cases contain metal inserts or magnets for attachment.
  • 🌳 Hold your smartphone horizontally. Slope over 30Β° increases the margin of error.

For maximum accuracy:

  1. Calibrate your compass in an open area (away from power lines, cars, and other sources of interference).
  2. Compare the readings with a mechanical compass (if any).
  3. Use gyrocompass-enabled applications (e.g. Compass Steel) 3D), which combines data from a magnetometer and a gyroscope.

In Xiaomi models with Snapdragon 888 and later processor (for example, Xiaomi 12 Pro), the compass accuracy can be improved by enabling High Accuracy mode in the location settings: β†’ Location β†’ Regime. β†’ High accuracy. This mode uses all sensors available (GPS, GLONASS, Galileo and magnetometer, which reduces the error to Β±1–2Β°.

Why does the compass in a smartphone point to magnetic north instead of geographic?
Magnetic north (where the compass arrow points) and geographic north (the Earth's axis of rotation) are not the same, the difference between them is called magnetic declination, and can be as high as 20.Β° Modern Xiaomi smartphones automatically adjust this slope if the option to use true north in the compass settings is enabled.

Comparison of compasses in different Xiaomi models

The accuracy and reliability of the compass depend on the model of the smartphone, and the table below shows the key differences:

CharacteristicsFlagships (Xiaomi 13/14, Mix)Mid-segment (Redmi Note 12, POCO F5)Budget (Redmi) 10/12, POCO M5)
Type of magnetometerAK09918C (precision)AK8963 or YAS539software emulation or MMIC2140
precisionΒ±1–2°±3–5°±10–20Β°
Support for gyrocompassYeah (hardware)Yes (programmatic)No.
Sensitivity to interferenceLow.MediumTall.
SizingAutomatic + manualOnly handheld.Not supported

If you need a smartphone with the most accurate compass, pay attention to Xiaomi’s flagship models with Snapdragon processors. 8 Gen 2/3 or Dimensity 9000+. They use multiaxial magnetometers with hardware interference compensation, which is especially important for professional orientation.

In budget models (e.g. Redmi) 12C or POCO C55) The compass often works through emulation, relying on data. GPS This leads to significant errors, especially in conditions of weak satellite signal (for example, in a forest or a city with tall buildings).

πŸ’‘

For accurate navigation on a hike or trip, choose Xiaomi smartphones with a separate magnetometer (for example, the Xiaomi 13 series or Redmi Note 12 Pro).+). In budget models, the compass may not work properly or may not be at all.

FAQ: Frequent questions about compass in Xiaomi

Can I use a compass in a Xiaomi smartphone without the Internet?
Yes, the compass works autonomously, as it relies on magnetometer data, not on the data of the machine. GPS However, the calibration may require the Internet (for example, to download magnetic declination data in your region).
Why does Xiaomi’s compass show the wrong direction in the car?
In a car, the compass is influenced by the machine's metal body, electronics (such as speakers) and moving metal parts (such as the engine). GPS, a) the compass is disabled or recalibrated after stopping.
How to turn off the compass on Xiaomi if you do not need it?
It is impossible to completely disable the magnetometer, but you can limit the access of applications to it: Go to Settings β†’ Annexes β†’ Permits β†’ Sensors. Select an app (like Google Maps) and turn off access to the Magnetometer. It won't turn off the sensor itself, but it will reduce battery consumption.
Can a cover affect the compass?
Yeah, especially if there's a case in it: 🧲 Magnets (for example, for fastening or folding). πŸ”‹ Metal inserts or pockets for cards. πŸ“± Built-in antennas or RFID-To check, remove the case and recalibrate the compass.
Which apps are best to use to work with a compass on Xiaomi?
Recommended annexes: 🧭 Compass Steel 3D β€” It supports gyrocompass and has a minimalist interface. πŸ—ΊοΈ GPS Status & Toolbox – allows you to calibrate the compass and check other sensors. πŸ“± Sensor Test - displays raw data from a magnetometer for diagnostics. MIUI It often works unstable, so it is better to use third-party solutions.