user4912: I have build a simple voltage divider with a light resistor and a 5.6k resistor. I am reading the input on A0 on my arduino board but it is almost always at 1023, independent of light. If I cover it it might go down to 1020 but not more than that.
Do I have to use a greater resistor than 5.6k to achieve more difference in the sensor?
The light sensor is similar to this: http://www.ebay.com/itm/20x-5549CDS-Photo-Light-Dependent-Sensitive-Resistor-Photoresistor-LDR-Photocell-/281425650814?pt=LH_DefaultDomain_0&hash=item418646a47e
I think that the resistance is pending between 1k-10k.
The circuit is like this image:

Where Vin is 5V from the arduino. R1 is the light sensor, R2 is 5.6k and Vout is connected to A0.

user313: What have you selected as the analog reference? And if 'external', what is connected to the Vref pin? 
For the LDR resistances of 10K and 1K, you  Vout should be ~ 1.8v at 10K, and ~ 4.2v at 1K, and giving A/D readings of somewhere around 370 counts and 860 counts, respectively, with a 5v analog reference. 
If your analog reference selected to the 1.1v internal reference, either LDR resistance should give you the max reading, but an LDR = 20K could give just over a volt and pretty close to the reading you're getting.

user10794: Judging by a datasheet (that I found on the web) that has a resistance of:

100 k to 200 k in the light
1 M in the dark

Given that Vout =  Vin * R2 / (R1 + R2) we can work out:
Light:
Vout = 5 * 200000 / (200000 + 5600) = 4.86 V

Dark:
Vout = 5 * 1000000 / (1000000 + 5600) = 4.97 V


Do I have to use a greater resistor than 5.6k to achieve more difference in the sensor?

Yes, I would measure the resistance in the light, and choose a similar resistor for the other side of the voltage divider. So if you measure 100 k on the sensor, another 100 k will at least divide the voltage in two nicely.

4912: <p>I have build a simple voltage divider with a light resistor and a 5.6k resistor. I am reading the input on A0 on my arduino board but it is almost always at 1023, independent of light. If I cover it it might go down to 1020 but not more than that.</p>

<p>Do I have to use a greater resistor than 5.6k to achieve more difference in the sensor?</p>

<p>The light sensor is similar to this: <a href="http://www.ebay.com/itm/20x-5549CDS-Photo-Light-Dependent-Sensitive-Resistor-Photoresistor-LDR-Photocell-/281425650814?pt=LH_DefaultDomain_0&amp;hash=item418646a47e" rel="nofollow noreferrer">http://www.ebay.com/itm/20x-5549CDS-Photo-Light-Dependent-Sensitive-Resistor-Photoresistor-LDR-Photocell-/281425650814?pt=LH_DefaultDomain_0&amp;hash=item418646a47e</a></p>

<p>I think that the resistance is pending between 1k-10k.</p>

<p>The circuit is like this image:</p>

<p><img src="https://i.stack.imgur.com/AXZiT.png" alt="Voltage divider"></p>

<p>Where Vin is 5V from the arduino. R1 is the light sensor, R2 is 5.6k and Vout is connected to A0.</p>
 313: <p>What have you selected as the analog reference? And if 'external', what is connected to the Vref pin? </p>

<p>For the LDR resistances of 10K and 1K, you  Vout should be ~ 1.8v at 10K, and ~ 4.2v at 1K, and giving A/D readings of somewhere around 370 counts and 860 counts, respectively, <em>with a 5v analog reference</em>. </p>

<p>If your analog reference selected to the 1.1v internal reference, either LDR resistance should give you the max reading, but an LDR = 20K could give just over a volt and pretty close to the reading you're getting.</p>
 10794: <p>Judging by a datasheet (that I found on the web) that has a resistance of:</p>

<ul>
<li>100 k to 200 k in the light</li>
<li>1 M in the dark</li>
</ul>

<p>Given that V<sub>out</sub> =  V<sub>in</sub> * R2 / (R1 + R2) we can work out:</p>

<p>Light:</p>

<pre><code>Vout = 5 * 200000 / (200000 + 5600) = 4.86 V
</code></pre>

<p>Dark:</p>

<pre><code>Vout = 5 * 1000000 / (1000000 + 5600) = 4.97 V
</code></pre>

<blockquote>
  <p>Do I have to use a greater resistor than 5.6k to achieve more difference in the sensor?</p>
</blockquote>

<p>Yes, I would measure the resistance in the light, and choose a similar resistor for the other side of the voltage divider. So if you measure 100 k on the sensor, another 100 k will at least divide the voltage in two nicely.</p>
