Calibration of the compass on Xiaomi Mi 9: a complete guide with nuances

Even the most advanced Xiaomi Mi 9 smartphone with its flagship Snapdragon 855 chipset and GPS module can give inaccurate location data if the compass sensor (magnetometer) is not calibrated. The problem is the β€œjumping” arrow in applications like Google Maps, Yandex.Navigator or 3D Compass, when the phone shows north where there is none, or refuses to identify the directions of the world. 80% of the time it is not the hardware fault, but the downed sensor settings – and this is easy to fix yourself.

In this article, you’ll find 3 proven calibration methods (including hidden engineering mode), deal with common errors (such as why a compass is β€œcrazy” next to metal), and learn how to check the sensor’s performance without third-party software. And also - a unique life hack for owners of Mi 9 with firmware MIUI 14+, Which is not available in official Xiaomi documentation.

Why the compass on Xiaomi Mi 9 lies: 5 main reasons

Before you start calibrating the sensor, you need to know what caused the failure, and here are the most common reasons.

  • 🧲 Magnetic field exposure: Even a simple magnetic lock case or wireless charging can knock the readings off, and if you put your phone next to a speaker or microwave, the compass will stop working.
  • πŸ“± Software failure MIUI: After the system updates, especially MIUI 12β†’14) the sensors are sometimes dropped. This is treated by recalibration.
  • πŸ”§ Mechanical damage: a fall in a phone can displace a magnetometer inside the case, in which case calibration won't help - you need repairs.
  • 🌍 Incorrect data GPS: The compass relies on satellite data for accuracy. GPS slugs (for example, due to disconnected A-GPS), shooter will walk".
  • πŸ”„ Reset to factory settings: after a hard reset, all sensors return to factory values, and they need to be reconfigured.

Usually, the first two causes are self-medicated, but you'll have to go to the service for mechanical damage or GPS problems. To diagnose the problem, try running the standard Compass app (if it's removed, install any of Google Play) and rotate the phone in your hands. If the arrow is smoothly following the movement, the sensor is good, but requires calibration. If the arrow is twitching or standing still, there may be a hardware malfunction.

πŸ“Š Do you often have a compass on Xiaomi?
Yeah, all the time.
Sometimes.
It used to be, it's not now.
Never noticed.

Method 1: Calibration through the standard application "Compass"

The easiest way to do this is to run on 90% of Xiaomi Mi 9 devices with any version of MIUI. You don’t need root rights or third-party software.

  1. Open the Compass app (if not, download Compass 3D or Digital Compass from Google Play).
  2. Place your phone on a flat surface (like a table) and wait until the message β€œRotate the calibration device” or similar prompt appears on the screen.
  3. Slowly rotate the phone on all three axes (as if you were drawing a sphere in the air), holding it in your hands. It is important to do this smoothly - sudden movements will reset the process.
  4. When the calibration scale is 100 percent complete, the compass needle should stabilize. If not, repeat the procedure.

If the compass is lying after calibration, check:

  • πŸ“Ά Whether it's on GPS: Go to Settings. β†’ Location and activate High Accuracy.
  • πŸ”„ Whether the data are updated A-GPS: For this, use the app. GPS Status & Toolbox (available on Play Market).
  • πŸ›‘οΈ Keep your phone away from metal objects, magnets and electronics.

Remove the magnet case |

Close all metal objects within a radius of 1 meter |

Turn on GPS in settings |

Charge your phone at least 30% |

Reset the device-->

Method 2: Calibration through the engineering menu (for experienced)

If the standard method didn’t work, you can use the hidden engineering menu Xiaomi Mi 9. This method requires caution – wrong actions can bring down other settings of the phone.

  1. Open the Phone app and type the combination: ##6484## (some firmware may run ##64663##).
  2. You will be taken to the MIUI Sensor Test menu. Find the Magnetic Sensor tab (or Magnetometer).
  3. Press Calibrate and follow the instructions on the screen: usually put the phone on the table and rotate it in a circle 2-3 times.
  4. Once completed, restart the device.

⚠️ Warning: Do not change other parameters in the engineering menu unless you know their purpose! For example, resetting the gyroscope or accelerometer data can lead to problems with autorotating the screen.

If #6484## does not work, try it.

  • πŸ”§ Install the application MTK Engineering Mode (for MediaTek processors) or Qualcomm Engineer Mode (for Snapdragon).
  • πŸ“± Use the alternative code: ##4636### - in the Testing menu, find the Sensors section.
What to do if the engineering menu is not opened?
Some MIUI 14+ firmwares block access to the engineering menu, in which case: 1. Install Activity Launcher from Google Play. 2. Find activity com.android.settings.TestingSettings. 3. Run it, and it will open the hidden sensor settings.

Method 3: Calibration with GPS Status (for fine-tuning)

If the first two methods fail, use the third-party GPS Status & Toolbox app, which not only calibrates the compass, but also updates the A-GPS data, which improves navigation accuracy.

  1. Download and install GPS Status from Google Play.
  2. Open the app and go to the Compass tab.
  3. Press Calibrate and follow the hints: usually turn the phone in the shape of an eight or in a circle.
  4. After calibration, go to the GPS tab and press Manage A-GPS state β†’ Reset, then Download. This updates the satellite data.

The advantage of this method is that GPS Status shows the signal/noise (SNR) of each satellite and the strength of the magnetic field, and if the magnetometer values (in microteslas) jump strongly after calibration, the sensor is defective.

ParameterNormal value.What to do if you don't.
Magnetic field (X/Y/Z)-50 to +50 ΞΌT (indoors)Remove the source of interference or recalibrate
Number of satellitesMore than 8 (in open areas)Update the A-GPS or check the antenna
GPS accuracyLess than 10 meters.Enable High Accuracy in the settings
Compass deflection angleLess than 5Β° when turningRecalibrate or check the sensor

Typical calibration errors and how to avoid them

Many Xiaomi Mi 9 users complain that the compass doesn’t calibrate or crashes quickly, and 99% of the time it’s due to errors:

  • πŸ“΅ Indoor calibration with interference: metal structures, appliances or even reinforced walls distort the magnetic field. Solution: go out into the open (balcony, park).
  • ⚑ Battery discharge: at a charge level below 20%, the system may not save sensor settings.Solution: charge the phone to at least 30%.
  • πŸ”„ Interrupted calibration: if you close the application or lock the screen during the process, the data will reset. Solution: do not interrupt the process until it is completed.
  • 🧭 Using magnet covers: even a thin magnet in a bookcase knocks down a compass.Solution: remove the case before calibrating.

⚠️ Note: If the compass still shows incorrect data after 3-4 attempts to calibrate, check the sensor for hardware damage. To do this, install the Sensor Test application (for example, AndroSensor) and compare the magnetometer readings with other devices. A difference of more than 20% indicates a fault.

πŸ’‘

If the compass only works unstable in a particular application (like PokΓ©mon GO or Google Maps), try clearing that app's cache in Settings β†’ Apps β†’ [Title] β†’ Storage β†’ Clear cache.

How to check if the compass is calibrated correctly

After calibration, you need to make sure that the sensor is working correctly.

  1. Real-world test: Go outside and run Google Maps. Compare the direction of the blue dot (your location) to the real landmarks (e.g., the sun at noon should be south). If the dot turns smoothly as it changes direction, the compass works.
  2. AndroSensor check: Install the AndroSensor app. Open the Magnetic Field tab. Turn your phone, X, Y, Z should change smoothly. The jumps are about interference.
  3. Comparison to a physical compass: Take a normal tourist compass. Put it next to your phone and compare it. Permissible deviation is up to 10.Β° (because of the electronics in the phone).

If the compass has passed all the tests, but the navigation applications still have a malfunction, the problem may be:

  • πŸ“‘ Bad signal. GPS (check in GPS Status).
  • πŸ“² Errors of the application itself (update it or reinstall it).
  • πŸ”§ Incorrect settings MIUI (Enable high accuracy in location).

πŸ’‘

If the compass after calibration works correctly, but after a few days it gets knocked back down again, it's a problem in the software. Try updating MIUI to the latest version or resetting (but not data!) to Settings β†’ About Phone β†’ Reset.

Frequent questions about the compass on Xiaomi Mi 9

Can I calibrate a compass without the internet?
Yes, the calibration itself doesn't require the Internet, but updating the A-GPS data (which improves the accuracy of GPS and compass) will require a network connection, and if there's no Internet, the compass will work, but less accurately.
Why does the compass point north in the other direction after calibration?
This may be due to: Magnetic interference at the calibration site (repeat the process in open areas); improper calibration (follow the instructions carefully, especially when rotating the phone); hardware sensor malfunction (check through AndroSensor).
Do I need to calibrate the compass after the MIUI update?
Not always, but it is recommended. With major updates (e.g., from MIUI 12 to MIUI 14), the system can reset the sensor settings. If you notice that navigation is less accurate after the update, calibrate again.
Can a cover affect the compass?
Yes, especially if it has magnets (like lid fixing), metal inserts or mounts, a thick layer of material (like armored covers with aluminum plates), and to check, remove the case and recalibrate.
What to do if the engineering menu is not opened?
Possible reasons and solutions: Firmware blocks access: use applications like Activity Launcher or MTK Engineering Mode. Wrong code: for Xiaomi Mi 9, try ##4636## or ##64663##. MIUI restrictions: some versions of the firmware have hidden engineering menus. In this case, use methods 1 or 3 from this article.