Android OS Forum banner

Light Sensor Values Information (Updated 8/22/2011)

26102 Views 70 Replies 34 Participants Last post by  radiok
This is for the DROID X

Hey guys, this isn't anything new, a lot of people have mentioned it here and there but I thought starting a thread about it would help some people. I'm on MIUI so i'll be talking from that perspective, but I think CM people will be in the same boat.

Basics of the Light Sensor:
So the light sensor works by detecting the brightness of the environment and changing the screen brightness based on that. You're able to edit these values and tell the phone what brightness to set the screen when it detects an environmental brightness within a certain range. Obviously, its a lot more complicated than that, but I will try to make it simple.

So MIUI has set some default values for us:

-From 0 - 19 environmental, it sets the screen to 16. Buttons have backlight on.
-From 20 - 99 environmental, it sets the screen to 50. Buttons have backlight on.
-From 100 - 1499 environmental, it sets the screen to 70. Buttons have backlight off.
-From 1500 - Infinity environmental, it sets the screen to 240. By the way, 255 is max screen brightness. Buttons have backlight off.

Why these values aren't the best for the Droid X:
Here's the issue.... the Droid X only has the ability to detect 4 different environmental values: 10, 100, 3600, and 8600. So the screen will essentially never go to 50. It will start at 16 and then jump to 70, and then it'll go to 240 for both 3600 and 8600. You'll want to go in and change this so that you can make use of all 4 of our detected values.

Optimizing these values for the Droid X:
Here's how to set these values: Go to Settings > Display Settings > make sure Auto Brightness is turned on > click Advanced Mode. This is where you see all the confusing options. I'm going to make it simple for you.

Light Sensor Filter:
Light sensor filter is used to detect an "average environmental brightness". This is pretty much useless to us, since our phone can only detect 4 values, so why would we need to take the average value of 100+100+100+100+100 etc. Having Light Sensor Filter turned on is only going to waste battery, processing time, and make it take longer for the phone to change brightness. Just turn it off.

Some people have pointed out that technically, since light sensor takes an average, having it on will allow you to hit values other than 10/100/3600/8600. Here's why you shouldn't bother:
-A reset threshold of anything other than "disabled" is going to make all of your extra levels (those not including 10, 100, 3600, or 8600) useless except for the ones between 10 and 100. Why? Think about it, if you go from 100 to 3600, the change is too great, and your reset threshhold (which has a minimum allowed value of 400lux) is going to reset your filter, meaning you won't average in those 100 readings.
-Your extra levels are only going to be active for a maximum of your window length. They don't have the ability to be persistent because of the huge deviation between the Droid X's discrete detected values. Your filtered level is also going to drop drastically to a plateau in the first few seconds of the window length.
-You're going to change brightness much more slowly, and I don't even mean because of the extra brightness levels in between, I mean because the extra CPU usage will cause your phone to adjust slower.
-If you move to a different environment, you're going to be using a screen brightness based partially on where you were rather than entirely on where you are for a period of time equal to your window length.
-You're going to drain more battery and use up processor allotment in real-time, meaning 100% of the time your screen is active.

Light Levels:
-Use custom: ON. We'll set these custom values in a sec.
-Light level to dim: 2. If you have your screen set to turn off after a certain amount of time (i.e. a minute) of not using it, this is the value that the screen dims to a few moments before turning off.
-Edit Other Levels: Skip it for now.
-Allow lights to decrease: ON. Of course, if we're going from a bright room to a dark room we'll want the screen to get darker as well right?
-Decrease hysteresis: 0%. This is useless unless you want option 2 (below).

Now go back to the one we skipped.

Edit Other Levels:
Here's what I was talking about before with the redundant default values. Now click the boxes and edit them to look like this:

Lower::::Upper:::::Screen:::Buttons
0............99............8............255
100........3599.......23..........255
3600......8599.......50..........0
8600......infinity.....255........0

Explanation:

0-99: This is just the brightness at an environment of 10, since like we mentioned, 10 is the only value our phone can detect within a range of 0-99. It's going to be what you're seeing when you're laying in bed, using your phone in a dimly lit restaurant or bar, or outside at night. Since web browsers often have white backgrounds, you'll want to use a brightness that doesn't strain your eyes from this. So I set my screen to 8, feel free to change it to your liking. Buttons is simple, if it's 0, then the backlight for your bottom 4 buttons is off. If it's anything else (i.e., anything from 1 to 255), then they're turned on. They have no brightness levels (none which we can adjust here anyway), just on or off.

100-3599: The brightness you set for 100 is probably going to be your most common screen brightness.

3600-8599: The brightness you set for 3600 will be what you get in a bright room or outside on nice days.

8600-Infinity: The brightness you set for 8600 will be what you get when you're standing outside on a really sunny day, at the beach, etc.

P.S., here's a cool trick I just found by accident... If you press settings + vol up, it will set your brightness to max. I guess this is a quick way to get there if you are in a bright area and dont want to wait for your phone to auto adjust.

I hope that helps. Good luck.

8/18/2011 --New Comparison:
I was asked to do a comparison to some previously suggested settings for CM people. Here is a thread that some have relied on for their settings: http://rootzwiki.com/showthread.php?t=913

These are the settings they suggest:

Lower::::Upper:::::Screen:::Buttons
0............10............2............0
11..........14...........25..........255
15..........49...........25..........255
65..........100.........50..........255
101........2999.......96..........0
3000......5999.......208........0
6000......7999.......246........0
8000......infinity.....255........0

And a few noticeable differences: the thread says set reset threshold to 1000lux, which also means to have filter turned on, and it wants you to set "Decrease hysteresis: 70%".

Analysis:
1) Ok, if you read and understood my little tutorial above, then you should already be able to spot a problem here. You've got reset threshold set to 1000lux, so it is now literally impossible to even hit the 5th or 7th levels. To explain - for level 5, if the sensor is going from (10 or 100) to (3600 or 8600) or vice versa, it would detect that the difference is greater than 1000lux, and would then reset the filter. For level 7, if the sensor is going from (10 or 100 or 3600) to (8600) or vice versa, it would again detect a difference greater than 1000lux and reset the filter. If the filter is reset, it wouldn't be averaging in the values from where you just were, and therefore you will not be able to hit a number within either of the two ranges in levels 5 or 7.

2) The rest of the levels that do not contain either 10, 100, 3600, or 8600 can be achieved BRIEFLY (for a time period equal to or less than your window length) by having light filter turned on, but having light filter on has many poor side affects (see above).

3) Buttons are turned off at an environmental level of 10, when it is darkest. In my opinion, this is when I want the those lights to be on the most. However, I'm going to assume that he has them off for this reason - they're even brighter than the screen at 2, and therefore can be distracting. I can't blame him here, I guess that is just up to preference.

4) He does something kind of cool with the "Decrease hysteresis: 70%" option. It can be hard to find a screen brightness for an environment of 10, since you may find yourself straining with too bright a screen in a dark room but wanting the screen brighter in a dimly lit room, both of which would probably be detecting an environment of 10. The thread's author suggests turning Decrese hyseresis to 70%. This allows the following: If you're at a screen brightness associated with your 100 level settings, you might find you prefer this setting in a dimly lit room where the phone would have otherwise set the brightness to the level associated with 10 environmental. Then if the environment gets darker and you want it to readjust to a lower brightness, you can simply turn off and back on the screen and it will set itself to that lower brightness corresponding to 10 environmental. This seems to also be the reason he has two levels with the same screen brightness, to make this solution functional. In my opinion, this is only good in rare conditions, but it is a cool concept that you might find you prefer.

Update 8/22/2011 -- Option 2

I thought a bit more about the above comparison, and the cool trick the guy did with decrease hysteresis, and I optimized it and labeled it "Option 2". Option 2 differs in this way: If you turn on your screen, your brightness levels will be 2/23/50/255 for environments of 10/100/3600/8600 respectively. As soon as your phone detects an environment of 100 or more, your brightness levels will become 8/23/50/255, meaning you will have the exact same settings as I suggested above. It will stay this way until your screen turns back off.

This is good for anyone who thinks that a brightness of 8 is too much for them in a pitch black room, but who doen't want to decrease it at risk of having it be too low for a dimly lit room. However, the option also has a distinct disadvantage: if you want your brightness level to be 8 in a dimly lit room, your phone must first detect an environment of 100 or higher, otherwise you will get a brightness level of 2 in that room. Put simply, if you turn on your screen in a dimly lit room, you'll get a brightness of 2, which is too dim. You'll have to go into an environment of 100 or higher, then back to the dimly lit room to get a brightness of 8. Additionally, if you travel into a pitch black room from an environment of 100 or higher, you will not get a brightness of 2 (it'll be at 8) unless you turn the screen off and then back on again.

If this sounds like what you want, then make "Decrease Hysteresis: 10%" and set your levels to look like this:

Lower::::Upper:::::Screen:::Buttons
0............10............2............255
11..........99............8............255
100........3599.......23..........255
3600......8599.......50..........0
8600......infinity.....255........0

Let me know if you have questions.
See less See more
  • Like
Reactions: 5
21 - 40 of 71 Posts
jbrock98 said:
Just curious if you never have auto brightness on then these settings mean nothing right? I just use my power widget to turn brightness up when I need it but mostly I have it defaulted to the dim setting

Sent from my DROIDX
correct, if you have no need for auto brightness, then this thread won't be useful to you
Where are the default values for a given firmware called out? I am assuming these values can be set to better suit our device by default. All custom roms I've used had default values that stunk and I've never used auto brightness (until reading this thread that is).
These are probably somewhere in the classes.dex of the Settings.apk. We could change them so that they are incorporated by default, but it would be up to Rom developers to implement this change.
"droidxchat said:
These are probably somewhere in the classes.dex of the Settings.apk. We could change them so that they are incorporated by default, but it would be up to Rom developers to implement this change.
That's what I'm saying. I'm trying to learn as much as possible about how the system works. If I ever build my own custom this will be included :p
"SaurusX said:
I have to disagree about you saying that the screen will never get set to 50. When the filtered sensor reading is between 20 and 99 the screen will be set to 50. Of course, it's only transitioning between two different raw sensor readings when in that range, but you can make the changes in brightness progress more smoothly by having those extra intervals. That's why I feel it's useful to have my eight intervals.
Exactly why I have my settings that I have posted
SaurusX said:
I have to disagree about you saying that the screen will never get set to 50. When the filtered sensor reading is between 20 and 99 the screen will be set to 50. Of course, it's only transitioning between two different raw sensor readings when in that range, but you can make the changes in brightness progress more smoothly by having those extra intervals. That's why I feel it's useful to have my eight intervals.
BMc08GT said:
Exactly why I have my settings that I have posted
OK two huge reasons you should reconsider. Let's consider a situation to use as an example: Say you're outside where its reading 3600. Then you move inside where its reading 100.

1) Even though your in an area where your phone is reading 100, since it's taking an average based on the past as well, it's going to be basing its value partly off of where you just were (outside) rather than basing the brightness entirely on where you are now. The deviation between our 4 descrete detected values is so great, that having the light sensor filter on will actually decrease the accurate correlation between environment and screen brightness.

2) Having the filter on can make you hit a point within a range as you said, but you need to realize it doesn't have the ability to last. Even if you set your window length to 60 seconds, your filtered brightness is going to quickly dive and then slowly plateau, finally hitting a flat 100 after 60 seconds has passed and that last 3600 reading is out of the picture.

And BMc08GT, I saw your settings... you have your Reset Threshold at 400lux. That right there means that your filter is only "good" for 2 values: 10 and 100 and only when they change between each other. If you go from 10 to any number beside 100, or from 100 to any number beside 10, your filter is going to instantly reset anyway. I'm only trying to help you when I tell you this, because its painful to see those settings in a thread dedicated to saving battery, having the filter on is a huge waste of cpu especially since you are only using it in 2 out of a possible 6 scenarios, and even then it only lasts for your window length of 30s, and even then it is causing you to have a reading that isn't entirely based on where you are. And anything that wastes cpu is wasting battery.
See less See more
"droidxchat said:
OK two huge reasons you should reconsider. Let's consider a situation to use as an example: Say you're outside where its reading 3600. Then you move inside where its reading 100.

1) Even though your in an area where your phone is reading 100, since it's taking an average based on the past as well, it's going to be basing its value partly off of where you just were (outside) rather than basing the brightness entirely on where you are now. The deviation between our 4 descrete detected values is so great, that having the light sensor filter on will actually decrease the accurate correlation between environment and screen brightness.

2) Having the filter on can make you hit a point within a range as you said, but you need to realize it doesn't have the ability to last. Even if you set your window length to 60 seconds, your filtered brightness is going to quickly dive and then slowly plateau, finally hitting a flat 100 after 60 seconds has passed and that last 3600 reading is out of the picture.

And BMc08GT, I saw your settings... you have your Reset Threshold at 400lux. That right there means that your filter is only "good" for 2 values: 10 and 100 and only when they change between each other. If you go from 10 to any number beside 100, or from 100 to any number beside 10, your filter is going to instantly reset anyway. I'm only trying to help you when I tell you this, because its painful to see those settings in a thread dedicated to saving battery, having the filter on is a huge waste of cpu especially since you are only using it in 2 out of a possible 6 scenarios, and even then it only lasts for your window length of 30s, and even then it is causing you to have a reading that isn't entirely based on where you are. And anything that wastes cpu is wasting battery.
I was referring to the statement of the eight levels. I see the reasoning behind the light sensor and have thus set it to off. Thanks for the tip.
BMc08GT said:
I was referring to the statement of the eight levels. I see the reasoning behind the light sensor and have thus set it to off. Thanks for the tip.
OK cool, but you know that having 8 levels is useless too right? You can have as many levels as you want but you will only ever use a maximum 4 of them.
"droidxchat said:
OK cool, but you know that having 8 levels is useless too right? You can have as many levels as you want but you will only ever use a maximum 4 of them.
I tried 8 levels a while back and I can say from experience they don't work. They actually seemed to cause my phone not to adjust brightness correctly.
Money Mike said:
I tried 8 levels a while back and I can say from experience they don't work. They actually seemed to cause my phone not to adjust brightness correctly.
I'm going to have to disagree with you. I have eight levels and they work just fine for me. Though I can see the logic of only having four... there are only four different reading of the light sensor. However, if you have the filter on, then it takes an average light sensor reading over the last 10 seconds (or whatever) and gets a filtered sensor score. I understand that the filtered score is only transitioning from one sensor reading to another, for example 100 to 3600, and will eventually settle at 3600. It's just a personal preference to include some ranges in between there with gradually increasing screen brightness. It looks "cooler" to me.
SaurusX said:
I'm going to have to disagree with you. I have eight levels and they work just fine for me. Though I can see the logic of only having four... there are only four different reading of the light sensor. However, if you have the filter on, then it takes an average light sensor reading over the last 10 seconds (or whatever) and gets a filtered sensor score. I understand that the filtered score is only transitioning from one sensor reading to another, for example 100 to 3600, and will eventually settle at 3600. It's just a personal preference to include some ranges in between there with gradually increasing screen brightness. It looks "cooler" to me.
I just wanna point out one more time in case you didn't see what I said.

If you have light filter set to on:

-A reset threshold of anything other than "disabled" is going to make all of your extra levels (those not including 10, 100, 3600, or 8600) useless except for the ones between 10 and 100.
-Your extra levels are only going to be active for a maximum of your window length (10s on your settings). They don't have the ability to be persistent because of the huge deviation between the Droid X's discrete detected values.
-You're going to change brightness much more slowly, and I don't even mean because of the extra brightness level in between, I mean because the extra CPU usage will cause your phone to adjust slower.
-If you move to a different environment, you're going to be using a screen brightness based partially on where you were rather than entirely on where you are for a period of time equal to your window length (10s for you).
-You're going to drain more battery and use up processor allotment in real-time, meaning 100% of the time your screen is active.

If this is worth the "cool" look to you then you have nothing to worry about, just want to make sure you know the details.
See less See more
Running against older data now. Post results when in a day or two.
"droidxchat said:
I just wanna point out one more time in case you didn't see what I said.

If you have light filter set to on:

-A reset threshold of anything other than "disabled" is going to make all of your extra levels (those not including 10, 100, 3600, or 8600) useless except for the ones between 10 and 100.
-Your extra levels are only going to be active for a maximum of your window length (10s on your settings). They don't have the ability to be persistent because of the huge deviation between the Droid X's discrete detected values.
-You're going to change brightness much more slowly, and I don't even mean because of the extra brightness level in between, I mean because the extra CPU usage will cause your phone to adjust slower.
-If you move to a different environment, you're going to be using a screen brightness based partially on where you were rather than entirely on where you are for a period of time equal to your window length (10s for you).
-You're going to drain more battery and use up processor allotment in real-time, meaning 100% of the time your screen is active.

If this is worth the "cool" look to you then you have nothing to worry about, just want to make sure you know the details.
+1 to this. I had the reset threshold enabled and it took forever for my phone to change brightness. It was most annoying in my truck in the dock. Now that I've disabled this my screen changes almost instantly when going from shade to direct sunlight.
I can't access or find the advanced levels...I've been there before but not known what to do...now they aren't there
Settings->Personal tab->display settings->autobrightness and advanced should be there for ya
Been running with these settings for a while, must say i love that the flicker between settings is gone. Haven't tested in a bright scenario yet. Dark rooms no longer leave me blind after looking at my phone though!
I've added option 2 to the OP, inspired by gpaulu's settings, which I analyzed in the OP.
droidxchat said:
I've added option 2 to the OP, inspired by gpaulu's settings, which I analyzed in the OP.
Great work
Here's a cool trick I just found by accident...

If you press settings + vol up, it will set your brightness to max. I guess this is a quick way to get there if you are in a bright area and dont want to wait for your phone to auto adjust.
G
droidxchat said:
Here's a cool trick I just found by accident...

If you press settings + vol up, it will set your brightness to max. I guess this is a quick way to get there if you are in a bright area and dont want to wait for your phone to auto adjust.
Nice! The auto adjust doesn't take that long, but the settings + volume up is extremely useful when needing to check something fast.
21 - 40 of 71 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top