Checking the sensors is one thing you should try before taking your phone in for repair because there are several options to fix the problems for free.
Diagnosing Sensor Issues
If you are using an app, such as a racing app, that reacts to the ways you move your phone, and the app doesn’t respond correctly, there’s probably an issue with one of the sensors. You might also notice that the phone’s screen doesn’t turn off when you are talking on it or that the screen doesn’t dim or brighten automatically. If you think there is a problem with one of the sensors, test another app that uses the same sensor. If the other app works, then it is a problem with the application itself and not the sensor. But if the other app does not work correctly either, then it is most likely a sensor issue.
How to Calibrate the Sensors
Secret Codes
Android devices have secret codes that allow you to get more information about your phone. Secret codes are a series of symbols and numbers that open menus not available in any other place on the phone. For example, on a Samsung Galaxy, the user can type the code #0# into the phone keypad. This sequence opens a HwModuleTest mode where you can find a choice to test the sensors. Here are some generic secret codes that may work on other Android devices. Each brand of phone works differently, but with a little research, you can find the codes you need.
##0589## – Light sensor test*##2664##* – Touch screen test*##0588##* – Proximity sensor test
Built-in Sensor Tests
Some smartphones have a setting where you can test some of the sensors. For example, on some LG devices you can calibrate the motion sensor by going to Settings -> General tab -> Motion. Check your particular model to see if these are available to you.
Third-Party Apps
You can find specific apps that are designed to calibrate one particular sensor. For example, to calibrate the gyroscope, you can try Accelerometer Calibration Free or Physics Toolbox Sensor Suite. Or, if your proximity sensor is giving you problems, you could try Proximity Sensor Reset (Calibrate and Repair). If after restarting your phone and trying several of these apps and tricks the phone still does not respond correctly, you may need to reset it to factory settings. That is pretty much guaranteed to fix the issue. Just make sure to back up your phone first.