Android OS Forum banner

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

26100 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
41 - 60 of 71 Posts
"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.
Doesn't seem to work with ssx2.1 but it was working with miui.
I'm not sure if I caused this or it was the script but all of sudden my sensor reads -1. It doesn't change the brightness anymore.

Sent from my DROIDX using Tapatalk
insuusvenerati said:
I'm not sure if I caused this or it was the script but all of sudden my sensor reads -1. It doesn't change the brightness anymore.

Sent from my DROIDX using Tapatalk
what script did you installl?
"insuusvenerati said:
I'm not sure if I caused this or it was the script but all of sudden my sensor reads -1. It doesn't change the brightness anymore.

Sent from my DROIDX using Tapatalk
I had this issue when I updated miui to the latest version. I had to wipe data/cache to fix it. I restored everything but system settings with miui backup.
@droidxchat All of them . I have the 3g booster and the hard to kill launcher.

Edit: oh my bad. These script were from a different thread. The data wipe worked.

Sent from my DROIDX using Tapatalk
I don't know if anyone knows it, but if you hold menu and volume up it makes your screen brighter, it voids the auto levels until your screen shuts off again. does on my phone anyway.
droidxchat said:
correct, if you have no need for auto brightness, then this thread won't be useful to you
This is not entirely true. The settings can still mean something valuable, and this thread can be useful.

AFAIK, the advanced auto brightness settings in CM74DX are the only way to consistently override the default minimum brightness value and the default dim value. There may be a settings file adjustment somewhere that lowers the minimum, but I don't know enough to find it and I've never found an app that could do it successfully.

So there are two benefits. 1) You use these settings to set the "dim" level, which is effective whether you have auto brightness turned on or not. More importantly, 2) read below...

In my setup, I use rather complex profiles, rules and conditions in the paid version of the Setting Profiles app. I have several profiles, many of which activate automatically based on location, docking state, time, etc. The homescreen widget allows me one- or two-click access to manually switch to a profile as needed, too.

As you've shown, there are only 4 levels of auto-brightness available on the DX, and for me, they aren't very useful. The sensor reads 10 everywhere from pitch black to soft shadows in a lighted room, and reads 100 in almost any other indoor light, including a brightly-lit room. So in practicality there are only 3 available brightness modes - dark/shadows, indoor light, and outdoor light. The profiles I have set up are actually better at auto-brightness than auto-brightness is! Like, I have a level set for when I'm at work, at home, in my car, etc. I have 5 or 6 different static brightness levels set in different profiles, and most of those profiles set themsleves automatically based on conditions that end up being more useful to me than the light sensor.

Anyway, here's the point: whenever I try to set a static brightness level below 20, even when creating a profile in the Setting Profiles app, it defaults back to 20. This is WAY too bright for one of my most important profiles - the one I use for bed and movie theaters. I need a screen as dark as possible, one that isn't even visible in lighted areas but that still allows me some quick, basic interfacing as needed. I'm guessing this is the point of some of the lower custom levels in your option 2. So, for me, this "bed" profile is the only one that I've set to turn on "automatic brightness" in the stock Android settings. This prompts my CM7 custom levels kick in.

Well, custom level, anyway. 2 levels, 0 - 3400 and 3401 - infinity, both of them 2, 0. No filter, no hysteresis, allow decrease. The custom levels won't let you set a brightness lower than your dim level (sort of makes sense, because then dim wouldn't be dim), so I had to set dim to 2 first before I could set it this way. But I don't want my dim at 2, because in any light I can't tell the difference between dim and off. So after setting the custom level, I go back and put dim at 4 or 5 or so.

Effectively, I'm not using any "auto" brightness at all. I'm enabling auto-brightness with a single custom level as a hack to enable a static brightness level of 2, because it's the only way I think I can do that. If there's an easier way, I'd like to know, but this works great. I just have to remember not to allow the screen to dim, becuase dim is actually brighter at this level. But even that is a big help, because occassionally I find the bed/theater profile still active after I'm in the light, and I can't see the screen at all. Waiting a few seconds for it to "dim" is my failsafe so I can see enough to switch the profile. Another option I've tried is setting 100 to also be 2 , 0, but then setting 3600 and 8600 to be 20 or 50 or so. But I feel better knowing that I've hard-set it to 2, so right now I'm on the one level.
See less See more
BuRNiN_BoNeS said:
I don't know if anyone knows it, but if you hold menu and volume up it makes your screen brighter, it voids the auto levels until your screen shuts off again. does on my phone anyway.
yup just pointed this out one page back, its a cool feature
Thanks OP this is much snappier IMO on my X, auto-brightness lagged trying to find the "g-spot" for a stable light sensor haha. With this guide and values it is more responsive. Plus not to mention you really dumb ed it down so I could understand it. Still sorta new with this whole scene.
Very useful.

I want to add that the CM7 Auto-Dim-40-100 toggle appears to be using fixed values of 26 (Dim - 10%), 102 (40%), and approximately 224 ("100%" -- maybe closer to 230, but definitely NOT 255.).

As it's been pointed out, the screen can't keep up with either 3600 or 8600, so there's almost no value in differentiating between them.

I used these values:

0-99 16 255
100-3599 80 255
3600-8599 224 0
8600+ 255 0

This way my dimmest auto is actually lower than "dim" on the widget.
I found the 100-3599 level often not bright enough to light the keys, so I left backlighting on.
Any kind of daylight goes to the widget's version of "max," but in direct sunlight it actually pushes the display to 255 ("true" 100%).
This way I know that auto is both the dimmest and brightest that I have, and the widget's only useful for overriding in conditions where it might actually make a difference.

For such a sophisticated device, this would seem to be a surprisingly primitive system. But the display's actually quite good in anything less than bright daylight.

EDIT:
I spent some time with this, and found that 16 was just too dim for many of the conditions below 100. Same with the second one -- it has to hold a long way to make it to 3600. So I changed the first two levels:

0-99 42 255
100-3599 96 255
3600-8599 224 0
8600+ 255 0

I figure 96 is the level it'll spend most time at, and that's not going to seem overly bright in office space. We'll see.
See less See more
Anyone else have issues with a stuck sensor? Mine sticks at high settings, so if I'm outside in bright sunlight, it'll stay at 8600 when I come back in, and the only way to reset the sensor is to reboot.
Wuffpack99 said:
Anyone else have issues with a stuck sensor? Mine sticks at high settings, so if I'm outside in bright sunlight, it'll stay at 8600 when I come back in, and the only way to reset the sensor is to reboot.
Is "Allow light decrease" checked? If it is not, the result will be exactly as you describe.
cygnusloop said:
Is "Allow light decrease" checked? If it is not, the result will be exactly as you describe.
Yes it is. It's an intermittent problem, so I know the settings are usually right. But there are times when it just sticks.
"Wuffpack99 said:
Yes it is. It's an intermittent problem, so I know the settings are usually right. But there are times when it just sticks.
I've had this issue also. Never found a permanent fix but rather than rebooting you should be able to turn auto brightness off and back on to get it unstuck.
Wuffpack99 said:
Anyone else have issues with a stuck sensor? Mine sticks at high settings, so if I'm outside in bright sunlight, it'll stay at 8600 when I come back in, and the only way to reset the sensor is to reboot.
Mine sort of does the same. When indoors it stays stuck at 0 unless it's close to the light source. As a result my screen is almost always at 6 (changed it from 2 suggested in OP).

Edit: lol now it's stuck at 100 and wont adjust down. Sensor, at least on my device, doesn't seem to react well, if at all to changes in lighting conditions.
If your sensor ever gets stuck, you can hit settings + vol up. it will go to max brightness. then turn your screen off and then back on, from there it should be unstuck. let me know if this works.
  • Like
Reactions: 1
droidxchat said:
If your sensor ever gets stuck, you can hit settings + vol up. it will go to max brightness. then turn your screen off and then back on, from there it should be unstuck. let me know if this works.
Settings??
left-most hardkey
thanks DXC...your work on MIUI is gr8...glad to see you onboard as i know Framework is just to busy,with school and all the projects hes into..miui on my X is just awesome:grin3::tongue3::wink2:
thx for info. definitely helped demystify this area of CM. would be interested in anything
on button levels, beside on/off.
41 - 60 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