Picked up my S5 15 days ago and have had brightness sensor problems from the get go. My Galaxy Note 3 did not have this problem...ever.
I had the autobrightness turned off then switched it on during the test and found the results below.
I've run the sensor test mentioned above with what I consider inconsistent readings.
Initially in a low ambient lit room (sunrise with an led light bulb in a lamp) the sensor registered 0 lux and no more than 3 lux when placed near the light bulb (Yes it was turned on and lighting up the room) it wasn't "dark". As light was increasing due to sunrise and the lamp light, the ambient lux rating was slowly climbing from 0 to no more than 20; extremely low light conditions, much lower than should have been reflected.
While running the test I then selected the auto control box and enabled the sensor to control the brightness. The result was failure, no change in display brightness for a several 10's of seconds. The brightness adjustment control should work nearly instantly or within just a few 1's of seconds (less than 10).
I ran the sensor test three times by stopping and starting the sensor test application to record the results; which I have saved to my SD card.
On the second pass with auto sensor controls enabled (auto brightness checked "on") there was a point in the test where I covered the sensor of the device and then uncovered it and found there was no change in its result; 3 lux before and 3 lux after.
On the third pass of testing the sensor and results apparently started working correctly. The light in the room was typical of a cloudy day (we'll lit with shadows being cast by the light) and the lamp was fully bright. I then started the 3rd test result capture /recording and with the sensor reading less than 5 lux I placed the device, S5, right next to the light bulb for a few seconds. Bang! The sensor response jumped and the phone back lighting got much brighter, 300 lux. Then I moved the device away and around the room and the sensor appeared to be picking up light correctly; mostly in the 50 to 250 lux range. The brightness control is sluggish but "works" somewhat.
So what is the fix?... Unless Samsung fixes their software I don't think there is one that is consistent. This means the auto brightness feature is not a "feature" in the sense of usable.
The sensor should not stop working regardless of condtion, which it apears yo do. The auto control check box should only determine if the display brightness is to be scaled in response to tge lux thresholds or not. Any other adjustment of the brightness should be interrupted and it seems this may be part of a bug in their app.
I'll be sticking with manual brightness or getting a different device that actually works, like the Note 4; I'll make that choice this weekend.