[Q] Proximity sensor is always "On". Can I calibrate it?

machx0r

Senior Member
May 7, 2011
215
145
63
San Marcos, CA
ccswe.com
Just got my Galaxy S3 a few days ago and today when I answered a call the screen immediately went blank and I could not turn it back on until the caller hung up. I've had other calls prior to today and cannot recall if the phone behaved the same way. I've been searching for a solution and everything points to a faulty proximity sensor. I've worked around the problem by disabling "Auto screen off during calls" under "Call settings". This works but it's not perfect since if I forget to manually turn off the screen I'm likely to press buttons with my face.

Under *#0*# -> Sensor -> Proximity Sensor: The PROXIMITY always reads 1.0. The ADC field increases as I get closer to the proximity sensor but never drops below 1 (should it?). Are PROXIMITY and ADC both readings from the same sensor?

Under *#7353# -> Proximity Sensor: It always says "Working" and vibrates. From the other tests in this menu I assume this is the "On" state and that the correct behavior would be to not vibrate and display a different message when the sensor is "Off" (ie: nothing is close to the sensor).

Several test apps (Android Sensor Box, Proximity Sensor, Sensor Test) also report 0cm or something similar indicating that something is close to the sensor.

Thanks in advance for any help :good:
 

topherk

Senior Member
Nov 16, 2010
778
503
0
Los Angeles
Just got my Galaxy S3 a few days ago and today when I answered a call the screen immediately went blank and I could not turn it back on until the caller hung up. I've had other calls prior to today and cannot recall if the phone behaved the same way. I've been searching for a solution and everything points to a faulty proximity sensor. I've worked around the problem by disabling "Auto screen off during calls" under "Call settings". This works but it's not perfect since if I forget to manually turn off the screen I'm likely to press buttons with my face.

Under *#0*# -> Sensor -> Proximity Sensor: The PROXIMITY always reads 1.0. The ADC field increases as I get closer to the proximity sensor but never drops below 1 (should it?). Are PROXIMITY and ADC both readings from the same sensor?

Under *#7353# -> Proximity Sensor: It always says "Working" and vibrates. From the other tests in this menu I assume this is the "On" state and that the correct behavior would be to not vibrate and display a different message when the sensor is "Off" (ie: nothing is close to the sensor).

Several test apps (Android Sensor Box, Proximity Sensor, Sensor Test) also report 0cm or something similar indicating that something is close to the sensor.

Thanks in advance for any help :good:
This may be a stupid question, but do you have a case that might be covering the proxy sensor? I'm also assuming you have cleaned the area where the sensor is. Other than that you might be able to take the phone into the Sprint store and get it replaced. If they won't take it back, call up Samsung customer service. If it's a faulty sensor, they might replace the phone free of charge (others have had good experiences with Samsung customer support)

Hope you get it fixed!
 
  • Like
Reactions: machx0r

machx0r

Senior Member
May 7, 2011
215
145
63
San Marcos, CA
ccswe.com
This may be a stupid question, but do you have a case that might be covering the proxy sensor? I'm also assuming you have cleaned the area where the sensor is. Other than that you might be able to take the phone into the Sprint store and get it replaced. If they won't take it back, call up Samsung customer service. If it's a faulty sensor, they might replace the phone free of charge (others have had good experiences with Samsung customer support)

Hope you get it fixed!
Thanks for the response. No screen protector or case. I did clean the entire screen this morning and the behavior didn't change. Was hoping I wouldn't have to take the phone back but then again if this was a common problem with a simple solution my searching this morning probably would have turned up an answer :)
 

CNexus

Senior Member
May 17, 2012
9,009
13,993
263
~/android
Thanks for the response. No screen protector or case. I did clean the entire screen this morning and the behavior didn't change. Was hoping I wouldn't have to take the phone back but then again if this was a common problem with a simple solution my searching this morning probably would have turned up an answer :)
Lol yeah, this is the first time I've seen anything about this, and I respond to literally almost every thread, or at least read through each one. But like topherk said, its probably a hardware issue. Would you be able to check to see if the "1.0" value is present on another S3? Maybe its a default of some kind (i would check myself, but my S3 took a 4 story dive recently and is out of service)
 

machx0r

Senior Member
May 7, 2011
215
145
63
San Marcos, CA
ccswe.com
Lol yeah, this is the first time I've seen anything about this, and I respond to literally almost every thread, or at least read through each one. But like topherk said, its probably a hardware issue. Would you be able to check to see if the "1.0" value is present on another S3? Maybe its a default of some kind (i would check myself, but my S3 took a 4 story dive recently and is out of service)
I don't know anyone else with an S3 but if anyone wants to check their *#0*# -> Sensor screen and tell me what the PROXIMITY and ADC values are when you aren't close to the sensor I'd appreciate it. Maybe I'll hit up the Sprint store and test it on a display model :laugh:

That said the page I discovered the *#0*# menu on has a screenshot and the PROXIMITY is showing 0.0 (I assume he's away from the sensor):



Where as this is mine when I'm away from the sensor:

 

Attachments

machx0r

Senior Member
May 7, 2011
215
145
63
San Marcos, CA
ccswe.com
After digging a little deeper it appears that the G3 uses the same IC (a GP2A from Sharp) for both the proximity and light sensor. From looking at the GP2A kernel module code it appears that the ADC values are from the light sensor output and the PROXIMITY value is from the proximity sensor output (0.0 = nothing within 5CM, 1.0 = something within 5CM). The ADC values definitely change and the interpreted light sensor lux values change when I cover it or shine a flashlight into it.

So now I'm not so sure if it's possible for it to be a hardware issue or if it's a software issue caused by some weird state. Think I'll try a factory reset and see if the situation changes...
 

xblackvalorx

Senior Member
Oct 27, 2011
841
317
0
After digging a little deeper it appears that the G3 uses the same IC (a GP2A from Sharp) for both the proximity and light sensor. From looking at the GP2A kernel module code it appears that the ADC values are from the light sensor output and the PROXIMITY value is from the proximity sensor output (0.0 = nothing within 5CM, 1.0 = something within 5CM). The ADC values definitely change and the interpreted light sensor lux values change when I cover it or shine a flashlight into it.

So now I'm not so sure if it's possible for it to be a hardware issue or if it's a software issue caused by some weird state. Think I'll try a factory reset and see if the situation changes...
Have you ever installed a flip cover app?

Sent from my SPH-L710 using xda premium
 

CNexus

Senior Member
May 17, 2012
9,009
13,993
263
~/android
After digging a little deeper it appears that the G3 uses the same IC (a GP2A from Sharp) for both the proximity and light sensor. From looking at the GP2A kernel module code it appears that the ADC values are from the light sensor output and the PROXIMITY value is from the proximity sensor output (0.0 = nothing within 5CM, 1.0 = something within 5CM). The ADC values definitely change and the interpreted light sensor lux values change when I cover it or shine a flashlight into it.

So now I'm not so sure if it's possible for it to be a hardware issue or if it's a software issue caused by some weird state. Think I'll try a factory reset and see if the situation changes...
Interesting...
Lol, i would recommend going to the Sprint store (if its not a hassle) and testing it out with their S3 on display, surefire way of knowing if something got borked with yours
I dont know whether they would charge for this or not, hopefully they dont, but you could also ask the reps to check it over for you and say you've been having some weird behavior with your incoming calls and the screen on/off events
 

Xiamen

Member
Mar 15, 2011
7
0
0
I don't know anyone else with an S3 but if anyone wants to check their *#0*# -> Sensor screen and tell me what the PROXIMITY and ADC values are when you aren't close to the sensor I'd appreciate it. Maybe I'll hit up the Sprint store and test it on a display model :laugh:

That said the page I discovered the *#0*# menu on has a screenshot and the PROXIMITY is showing 0.0 (I assume he's away from the sensor):



Where as this is mine when I'm away from the sensor:

Exactly what's been happening with my Samsung Galaxy Note 2 running stock firmware (rooted) with no screen protector. Been searching the internet for months and tried several proximity screen off apps to no avails. After countless tests and trials I am convinced that the proximity sensor when activated is stuck "near" (PROXIMIY = 1.0 at ADC level <= 12) unless there is bright enough ambient light. If some gurus could shade some lights on how to set the proximity threshold "prox_thresh" to be greater than 12 (say 30) (and that setting will stick after restart) that would be great!
 

esdwa

Senior Member
Oct 9, 2010
123
13
0
www.eskwadrat.com
I have the same problem with my brand new TMobile Galaxy Note 2 where proximity sensor does require a lot of ambient light in order to switch the screen on and off during the call. I noticed that the screen protector is part of the problem so I removed it and it helped a bit but not always. I was afraid the sensor is broken itself and requested for replacement phone however I tried the *#0*# combination to test the sensor and found that ADC (analog to digital converter) output changes as I approach the sensor. With no proximity ADC shows value of between 11 and 15 and it is increasing smoothly to 140 as I move closer and furthermore reaches 190 as I press my finger against the screen. So the proximity sensor hardware actually works just fine it is the software layer including driver that possibly creates a problem which results in Proximity value being always equal 1.0 despite of ADC output precisely following the actual proximity. Several applications available call play market follows the Proximity value therefore making sensor based ofperation difficult or useless. I hope that upcoming system update will address the flaw making sensor based functions to work finally as they should.

Sent from my SGH-T889 using Tapatalk 2
 
  • Like
Reactions: dyrnych

keeperjones

New member
Jun 20, 2013
2
2
0
Galaxy S3 proximity sensor replacement

Same issue here. A few things that may be of interest. My issue did not start after an update, it just started happening out of the blue. It is not because of being dirty or a because of a case. When I get into the diagnostic screen, the proximity sensor reads 0 and then goes to 1 when you get in proximity. It then stays at 1 and won't go back to 0. The ADA changes values, apparently correctly. The one thing that I thought was interesting, if I flash a bright LED flashlight on it, it does go back to zero. It is almost like it is not as sensitive to light all the sudden. This light trick works no matter how far away the light is. I am thinking the sensor is going bad.

I see several options to replace it on eBay, I changed out the screen last year, so I know how to change out the front camera and sensor. The only OEM ones I see are used or from China. Has anyone ever tried any of these, OEM or otherwise? They are cheap, I think I will give it a shot.
 
Last edited:
  • Like
Reactions: thecensor

keeperjones

New member
Jun 20, 2013
2
2
0
SOLVED

Just a heads up, I fixed my problem with a new front facing camera and sensor off of ebay. It took less than 10 minutes to put it in and it works great now. It was $5.99 shipped.
 
Last edited:
  • Like
Reactions: thecensor

Gryncc

Senior Member
Oct 18, 2010
51
4
0
Detroit
try this

I have the same problem with my brand new TMobile Galaxy Note 2 where proximity sensor does require a lot of ambient light in order to switch the screen on and off during the call. I noticed that the screen protector is part of the problem so I removed it and it helped a bit but not always. I was afraid the sensor is broken itself and requested for replacement phone however I tried the *#0*# combination to test the sensor and found that ADC (analog to digital converter) output changes as I approach the sensor. With no proximity ADC shows value of between 11 and 15 and it is increasing smoothly to 140 as I move closer and furthermore reaches 190 as I press my finger against the screen. So the proximity sensor hardware actually works just fine it is the software layer including driver that possibly creates a problem which results in Proximity value being always equal 1.0 despite of ADC output precisely following the actual proximity. Several applications available call play market follows the Proximity value therefore making sensor based ofperation difficult or useless. I hope that upcoming system update will address the flaw making sensor based functions to work finally as they should.

Sent from my SGH-T889 using Tapatalk 2
On Samsung devices like i9100 (Galaxy S3) or N7100 (Note II) you can do the following if you have root permissions:eek:n Android Terminal App or adb shell do:Code:$ su $ echo 0 > /sys/class/sensors/proximity_sensor/prox_cal $ echo 1 > /sys/class/sensors/proximity_sensor/prox_calThe zero resets the actual calibration offset.The one does an auto calibration (read sensor value, set offset to this sensor value, write calibration offset to "/efs/prox_cal" which is read while device is booting).Best for calibrate your sensor is to keep it dark, the glass have to be clean and the sensor free (so that the sensor doesn't measure anything).*The calibration offset is stored in efs, thats why you can make full wipe and use other ROMs without the need of recalibration.You can check the running config by:Code:$ cat /sys/class/sensors/proximity_sensor/stateThe first value is the calibration Offset, the second one is the sensor threshold (threshold is set at compile time).Open *#0*# to see "sensors" and check if your proximity sensor is now working properly.*
This work on the first try for me try it and c if it help u
 
Last edited:

sea2summit

New member
Aug 15, 2012
1
0
0
I can now stop pulling out my hair...

On Samsung devices like i9100 (Galaxy S3) or N7100 (Note II) you can do the following if you have root permissions:eek:n Android Terminal App or adb shell do:Code:$ su $ echo 0 > /sys/class/sensors/proximity_sensor/prox_cal $ echo 1 > /sys/class/sensors/proximity_sensor/prox_calThe zero resets the actual calibration offset.The one does an auto calibration (read sensor value, set offset to this sensor value, write calibration offset to "/efs/prox_cal" which is read while device is booting).Best for calibrate your sensor is to keep it dark, the glass have to be clean and the sensor free (so that the sensor doesn't measure anything).*The calibration offset is stored in efs, thats why you can make full wipe and use other ROMs without the need of recalibration.You can check the running config by:Code:$ cat /sys/class/sensors/proximity_sensor/stateThe first value is the calibration Offset, the second one is the sensor threshold (threshold is set at compile time).Open *#0*# to see "sensors" and check if your proximity sensor is now working properly.*
This work on the first try for me try it and c if it help u
Worked like a charm! Original values were evidently not properly calibrated, but the above approach reset the values such that the display now switches off (in phone calls) at approximately 8 cm, and following hang up, immediately powers on.

Thank you
 

UltimateByte

Senior Member
Dec 6, 2010
139
56
0
terageek.org
On Samsung devices like i9100 (Galaxy S3) or N7100 (Note II) you can do the following if you have root permissions:eek:n Android Terminal App or adb shell do:Code:$ su $ echo 0 > /sys/class/sensors/proximity_sensor/prox_cal $ echo 1 > /sys/class/sensors/proximity_sensor/prox_calThe zero resets the actual calibration offset.The one does an auto calibration (read sensor value, set offset to this sensor value, write calibration offset to "/efs/prox_cal" which is read while device is booting).Best for calibrate your sensor is to keep it dark, the glass have to be clean and the sensor free (so that the sensor doesn't measure anything).*The calibration offset is stored in efs, thats why you can make full wipe and use other ROMs without the need of recalibration.You can check the running config by:Code:$ cat /sys/class/sensors/proximity_sensor/stateThe first value is the calibration Offset, the second one is the sensor threshold (threshold is set at compile time).Open *#0*# to see "sensors" and check if your proximity sensor is now working properly.*
This work on the first try for me try it and c if it help u

Worked like a charm! Original values were evidently not properly calibrated, but the above approach reset the values such that the display now switches off (in phone calls) at approximately 8 cm, and following hang up, immediately powers on.

Thank you
God, i've been looking for that information for dozens of years (felt this way at least).

And i find it the day i put my phone back to stock for an RMA !


I went back to root, and tried those lines in the ROM Toolbox Pro's terminal, it says " can't create /sys/class etc. permission denied", what's wrong please guyz ?? I tried several ways to re root, root checker says "status : rooted, ID : uid=0(root) gid=0(root), SuperUser (can't find), BusyBox : /system/xbin/busybox, Su : /system/xbin/su => maybe that's the issue, am i badly rooted ?


Isn't there a no root solution, a very simple way to calibrate ? While looking for a solution, I heard about Als-Ps calibration, doesn't it exist on the N7100 ?

Any help would be very appreciated.


EDIT : OK, i typed "su" to get the terminal to get the SU request, and typed the command, rebooted the phone : the issue's still there.

I'm a noob to Android Terminal, so i tried putting
do:Code:$ su $ echo 0 > /sys/class/sensors/proximity_sensor/prox_cal $ echo 1 > /sys/class/sensors/proximity_sensor/prox_cal
into it, but it didn't work, then i tried
"$ su $ echo 0 > /sys/class/sensors/proximity_sensor/prox_cal $ echo 1 > /sys/class/sensors/proximity_sensor/prox_cal"
and it didn't work, so i had to remove the first "$" to get it to work
(so it looks like "su $ echo 0 > /sys/class/sensors/proximity_sensor/prox_cal $ echo 1 > /sys/class/sensors/proximity_sensor/prox_cal")

Am I doing something wrong ?
 
Last edited:

julianbl

Senior Member
Jun 1, 2007
97
17
28
On Samsung devices like i9100 (Galaxy S3) or N7100 (Note II) you can do the following if you have root permissions:eek:n Android Terminal App or adb shell do:Code:$ su $ echo 0 > /sys/class/sensors/proximity_sensor/prox_cal $ echo 1 > /sys/class/sensors/proximity_sensor/prox_calThe zero resets the actual calibration offset.The one does an auto calibration (read sensor value, set offset to this sensor value, write calibration offset to "/efs/prox_cal" which is read while device is booting).Best for calibrate your sensor is to keep it dark, the glass have to be clean and the sensor free (so that the sensor doesn't measure anything).*The calibration offset is stored in efs, thats why you can make full wipe and use other ROMs without the need of recalibration.You can check the running config by:Code:$ cat /sys/class/sensors/proximity_sensor/stateThe first value is the calibration Offset, the second one is the sensor threshold (threshold is set at compile time).Open *#0*# to see "sensors" and check if your proximity sensor is now working properly.*
This work on the first try for me try it and c if it help u
Thank you Gryncc!!! it worked for me in im i9500. I did it with ADB Shell... the comands where...
su
echo 1 > /sys/class/sensors/proximity_sensor/prox_cal


the 0 did nothing, so I tried 1 and after reset, the sensor worked again!

Regards,
Julián