# My light-dependent resistor gives a fluctuating serial output

I'm a high school student trying to make a light tracking single axis solar panel. I am using an Arduino Uno rev3 board.

When I first finished building it, the system failed to operate. I spent a few hours figuring out the problem. Then I decided to test my LDRs again (already once checked before building). Then something weird happened. One of my LDRs gives around 50-59 serial output, whereas the other one goes from 0 - 300 - 0 - 300. I thought my LDR was faulty but I had once tested it and it worked fine.

Another thing, when I cover the LDR with my hand it outputs a steady 0. Then theoretically, it's still detecting light right?

Here's the code:

int sensorPin = A0;

void setup()
{
Serial.begin(9600);
}

void loop()
{
Serial.println(sensorValue);
delay(60);
}


Here's the circuit diagram I used to test the LDR:

New contributor
ElevenBits is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
• What is the source of light? Fluoros will give you a fluctuating signal at mains frequency. Leds may give you a fluctuating signal at high frequency. Daylight will be continuous and incandescent should be similar. Nov 23 at 3:39
• Try putting a filter capacitor or just do a software average. Why not simply use the panel output which is about the largest light sensitive component in existance? Nov 23 at 7:11
• If swapping that one LDR in and out of the circuit causes and removes the problem, that's probably it. Try to get your hands on a few more to see if others match your good one. Also try measuring the "bad" one with a multi-meter.
– Drew
Nov 23 at 7:52
• Just to be clear on terminology: what you posted is not a circuit diagram. That's a drawing (made probably with Fritzing or similar software) that illustrates the physical layout of the circuit. A circuit diagram, or schematic, is a different thing. Don't call that a circuit diagram in presence of an electrical engineer, someone could be pissed off. Nov 23 at 23:22