Hooking up a photocell to turn lights off or on...

Hello,

I have a photocell I purchased from Adafruit. I have it wired like the diagram here:

https://learn.adafruit.com/assets/459

I have it connected to A1 on an Arduino pro mini.

the issue is that at FULL brightness it reads 1023 (as expected) but at FULL DARK it reads around 800 (not expected)

and outside, where I am using it, it reads 1020 where I want it too shut off although that is way way darker than full bright.

I have it connected to +5v and the promini is running @5v

This one ? Photo cell (CdS photoresistor) : ID 161 : $0.95 : Adafruit Industries, Unique & fun DIY electronics and kits

Adafruit says 5-10k in light and 200k in dark.
I have a few with different resistance, but they are below 1k in full (sun)light and above 1M in full darkness.
Do you mean "full dark" really as "full dark" ? Putting your finger on it is not enough.

Suppose it is 200k and the resistor is 10k.
V = 10k / (10k+200k) * 5V = 0.238V = 48.
It should be 48 and not 800.

Could you make a photo ?
Show us your sketch. Are you sure you have "A1" in the sketch (and not A0) ?

Do you have another LDR ? Perhaps in an old toy or small night lamp. They cost 4 dollarcents at Ebay (if you buy 20).
Have you seen the alternative : Adafruit ALS-PT19 Analog Light Sensor Breakout : ID 2748 : $2.50 : Adafruit Industries, Unique & fun DIY electronics and kits

To get more range out of my LDR I don't use a single resistor of 10k. I use two output pins, one with 1k to the LDR and one with 100k to the LDR. The other pin of the LDR to GND. Then I power it with the 1k and I power it with the 100k and I average both results.

sketch:

int photocell = 0;



void setup()

{
  Serial.begin(9600);          
}

void loop()
{

  photocell = analogRead(A1);
  Serial.println(photocell);       

}

I have it inside of a black tube the same diameter as the photocell with some black tape over the front of it... full dark.

Measure the resistance of the sensor with a DMM in the light conditions you want to use it in.

e.g. if you want to use it as a dusk/dawn sensor, measure it at that light.
Then pick a fixed resistor of about that value.
You might find that 100k works better in dim light situations, while 10k is better for bright light detection.
Leo..