I will be doing the same thing rather soon. I have done much research and thinking on how to do this. I will need to detect Sun, Shade, and Dark. I'm not as concerned about gray clouds as I am about black shade.
If you are looking to modify the circuit to prevent the sensor from saturating, then you are out of luck. Changing the resistor will have nothing to do with this fact. The circuit in the link will work as a voltage divider.
Where (see link):
Min Cds R = 5k-10k
Max Cds R = 200k
In full sun: Vout = 5 * R / (R + Min Cds R)
In dark: Vout = 5 * R / (R + Max Cds R)
For the configuration the link, the most effective value of the resistor will be R = Min Cds R. If the resistor and Cds are reversed (Cds connected to ground and resistor connected to 5V), then the most effective value for the resistor is R = Max Cds R.
As drawn in the OP link:
If:
R=10K
Min Cds R = 10k
Max Cds R = 200k
Then
Full Sun = 2.5V
Dark = 0.238V
This is the widest input range possible with the UNO.
To increase the sensitivity (make the voltage swing fit the ADC better) you need to realize the circuit will only ever work with one-half of the voltage range. Therefore it would be best to have the ADC reference at or just above the maximum input voltage.
With an UNO that can be accomplished one of two ways:
- Use an external voltage reference in the 2.6V range and power the Cds-resistor circuit with 5V
- Use an the default built-in voltage reference (5V) and power the Cds-resistor circuit with 10V
I just learned of this feature if you are lucky enough to be using a Mega (like I am) then you have third option:
3. Use the 2.56V built-in reference and and power the Cds-resistor circuit with 5V
With that said, if you need to (try to) prevent the sensor from saturating, then you need to work with the sensor itself. To prevent the sensor from saturating then you need to reduce its input. You could try shading the sensor, either with a pin hole or with a tinted film.