user69319: I'm a newcomer to Arduino, trying to read analog values from a circuit with a photoresistor. I believe I am using a 1-ohm resistor
The problem I am having is that my photoresistor does not seem to be working, or my circuit is wrong. When I run the below code on my Nano, my Serial monitor constantly prints 1023. When I cover the photoresistor completely with my finger, the value dips down to 900-950, but then jumps back up to 1023. It dips down to 900-950 again, and jumps back to 1023. This happens continuously.
Here is my code:
void setup()
{
  Serial.begin(9600);
}

void loop()
{
  int value = analogRead(A0);
  Serial.println(value);
  delay(20);
}

Here is an image of the circuit I am using. In my case, I am using a Nano instead of Uno.

I ran the above code on the virtual circuit above, and it works as expected. However, on my physical device, the phenomenon I explained above occurs.
Is there something wrong with my circuit? Could it be an issue with my photoresistor?

user20245: If you pealed the backing off the bread board you will find that you have plugged in your green, red and photo resistor wires into one piece of metal.  This means they are shorted together and as such do not work as you might expect.

Also, be aware that photo resistor or cadmium sulfide cells are slow to react to changes in light.  Sometimes taking about a second to fully change to a new resistance.  If you need a faster response consider using a photo diode or photo transistor.

69319: <p>I'm a newcomer to Arduino, trying to read analog values from a circuit with a photoresistor. I believe I am using a 1-ohm resistor</p>
<p>The problem I am having is that my photoresistor does not seem to be working, or my circuit is wrong. When I run the below code on my Nano, my Serial monitor constantly prints 1023. When I cover the photoresistor completely with my finger, the value dips down to 900-950, but then jumps back up to 1023. It dips down to 900-950 again, and jumps back to 1023. This happens continuously.</p>
<p>Here is my code:</p>
<pre><code>void setup()
{
  Serial.begin(9600);
}

void loop()
{
  int value = analogRead(A0);
  Serial.println(value);
  delay(20);
}
</code></pre>
<p>Here is an image of the circuit I am using. In my case, I am using a Nano instead of Uno.</p>
<p><a href="https://i.stack.imgur.com/A3rDT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A3rDT.png" alt="enter image description here" /></a></p>
<p>I ran the above code on the virtual circuit above, and it works as expected. However, on my physical device, the phenomenon I explained above occurs.</p>
<p>Is there something wrong with my circuit? Could it be an issue with my photoresistor?</p>
 20245: <p>If you pealed the backing off the bread board you will find that you have plugged in your green, red and photo resistor wires into one piece of metal.  This means they are shorted together and as such do not work as you might expect.</p>
<p><a href="https://i.stack.imgur.com/yB9UT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yB9UT.jpg" alt="enter image description here" /></a></p>
<p>Also, be aware that <a href="https://en.wikipedia.org/wiki/Photoresistor" rel="nofollow noreferrer">photo resistor or cadmium sulfide cells</a> are slow to react to changes in light.  Sometimes taking about a second to fully change to a new resistance.  If you need a faster response consider using a photo diode or photo transistor.</p>
