LDR always showing maximum value (1023) - HELP ME!

Hello!

I'm using an LDR photoresistor to control two LEDs. The coding is simple: above one value the red LED lights up and below one value the green LED lights up (never on simultaneously).

But the LDR is always showing the maximum value (1023) even in low light, preventing me from control the LEDs correctly.

What can I be doing wrong?

(I'm using a 10kOhm resistor on the LDR terminal 1).

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html .
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Have you got your LDR and resistor wired as a potential divider?
Do you have a DMM?

Thanks.. Tom... :slight_smile:

gabriel_alves14:
What can I be doing wrong?

Most likely in issue in your wiring or your code. So... as so often... the problem is in the part you didn't post.