I'll just use a photoresistor. Keep it simple. With the random ldr I have, I measure approx
1 ohm (raw 633) outside on a bright but overcast day (should give 100 % brightness)
2k ohm (raw 540) in a bright room (should give 100 % brightness)
10k (raw 350) ohm in a medium bright room (should probably give less than 100 % brightness)
above 2M ohm (raw 36) in a really dark room with no lights on (should give minimum brightness)
So it seems that with a circuit like [3v3]---[ldr]---[Vmeas]---[10K]---[gnd] and the ldr I have, a good starting point is: max brightness above Vmeas = 2.44 V (500 raw analog with Vref = 5v) and minimum brightness below Vmeas = 0.73 V (150 raw analog).
[x] Get suitable photoresistor.
[x] Figure out suitable fixed series resistor. --> 10k
[ ] Test separately (write a small program that outputs 0-100 depending on ambient light).
I'll just use a photoresistor. Keep it simple. With the random ldr I have, I measure approx
So it seems that with a circuit like
[3v3]---[ldr]---[Vmeas]---[10K]---[gnd]
and the ldr I have, a good starting point is: max brightness aboveVmeas = 2.44 V (500 raw analog with Vref = 5v)
and minimum brightness belowVmeas = 0.73 V (150 raw analog)
.