[Nexus S General] obsanity:
Our Nexus S has been blessed with the release of ICS 4.0 in which the light sensor values have been significantly improved over GB. In GB we had about 5 or 6 light sensor values which would decide how bright to set the screen. This created an opportunity for the CyanogenMod team to code the Automatic backlight settings with filtered values in between to try to help the community with correct brightness levels. Still it was a far cry from what is now possible because of the fine increments in light sensor delivered in with the 4.0 binaries.

These settings are a good starting point and can serve well as default values for most. However, depending on your eyes and Voodoo settings you might have to adjust them to your own comfort. So lets get started.

Open the CyanogenMod Settings (if you don't have them in your app menu, ask your ROM developer to integrate them)

Go to Display-> Automatic backlight

Enable - obviously turn this on

Window length - set as low as possible. 2 is the lowest currently. Since our sensor values degradation is very fine now, this is less of use

Reset threshold - set to disabled. Again, this depends on the window length

Sample interval - set to 2s. This will ask the processor to check the brightness level every 2 seconds. You can set it based on what you feel is correct but obviously low values can improve accuracy but uses more cpu and drains your battery quicker

Use custom - check this. we'll set our own values

Screen dim level - this is the default setting for your screen lowest dim level. I use 10 but you might have to use more or less depending on the quality built of your screen and voodoo settings.

Edit other levels... - skip this to the last step

Allow light to decrease - check this.

Decrease hysteresis - set to 0%

Now tap on "Edit other levels..."

Scroll down and tap "set number of levels" set it to 25. Now set the "Lower" value and a "Screen" value for it. The first "Lower" value is set to 0 and can't be modified. "Upper" value is set automatically based on the two values of "Lower" and "Screen". "Buttons" value never worked on the Nexus but with proper kernel support they can change based on light sensor conditions. For now, set all button values to 255.

All values can be set from 0 to 255. Here are my default values:

Lower | Screen
0 | 10
5 | 20
10 | 30
15 | 40
20 | 50
30 | 60
40 | 70
50 | 80
60 | 90
80 | 100
100 | 110
120 | 120
140 | 130
180 | 140
220 | 150
260 | 160
300 | 170
380 | 180
460 | 190
540 | 200
620 | 210
1240 | 220
2480 | 230
4960 | 240
10000 | 255

Go up and hit "save and apply" after setting it up.

If you're wondering why these values, I doubled the last increment every 4th value. Since the lowest values are the most important for us because we usually are indoors with different lightning conditions, the higher values can be quickly set to max 255 screen brightness when anything over 10,000 hits the sensor such as sitting too close to a powerful light bulb or if you happen to find yourself on Mercury during the day (might want to bring a suit also :)).

Modifications and adjustments:

If the screen seems too bright or too dim at any time, go back to the "light sensor levels" screen and look up the current screen value. It's the 2nd line after "Sensor (filtered/raw)". Then scroll down and find a "Screen" setting which is equal to that value and modify it. Try not to move around and make sure the "Sensor (filtered/raw)" values stay the same. What you are doing is simply adjusting your phone's brightness to fit current light sensor level so if it changes while you set it, you wont know if it worked. Also, you can adjust all "Screen" values by 5 or more (down or up) if it feels like it's all off your comfort level.

If you really want to get down and dirty and understand all the fuzz in details byrong over at HTC Droid Incredible forums posted a great explanation and all the science behind it. Just remember that their phone is limited to just a few light sensor values where ours has virtually thousands and that's why I chose to almost eliminate the filtered value to control flicker. But it's up to you if you want to play with that. Also, he has a great post on CPU usage titled "Effects of CPU Frequency and Screen Brightness on Power Consumption". Make sure to check it out.

And one last note regarding the voodoo settings... your screen is different than other phones. I have 4 Nexus S phones and none of them can be set to the same voodoo settings to create the same colors. Depending on screen fabrication quality and possibly date of manufacture, it will vary slightly and sometimes greatly. So if you post your voodoo settings and someone says they suck now you know why.