LDR on long cable run

Hi folks,

Got a curious one and wonder if anyone has any pointers.
I've got an off-the-shelf cheap LDR

And enclosed it in a transparent plastic box outdoors. I've got it on a long pair of wires (approx 30 metres) back to where the Arduino Uno is, there I have a 10k resistor in the following very simple (standard) circuit:

However I'm getting very strange results that don't seem to vary according to light levels at all. There seems to be variance in the output (and when I disconnect the sensor it drops to 0) but not varying.

Could this be because of the 30metre cable run I have from the LDR back to the arduino+resistor? (Resistor is beside the Arduino) or is there some other factor potentially involved here?

Any ideas please!

Could this be because of the 30metre cable run I have from the LDR back to the arduino+resistor?

Yes it could. Try a 0.1uF cap on the Arduino end between analogue input and ground.

Yes, its varying according to light levels. 750 = daytime cloudy? 980 = daytime sunny? Put a piece of black tape completely over the sensor, then nighttime <= 500?

With the sensor disconnected, the reading is supposed to be 0 due to the pulldown resistor.

Thanks Mike, that would make sense, I'll give that a go later on.

dlloyd, it's not giving varying results, as you can see on the graph it never drops below 700 (The drop in the graph you see is me disconnecting the sensor to confirm the Arduino reacts and drops to 0), as on my graph at midnight here in the UK it's pretty dark and LDR is still showing 800!

Will give the capacitor and see if it helps.

You'll need to change R1 to a lower value for your sensor. Try 1K.

You can fine tune the dark reading to around 100 or so by putting a piece of black tape over the sensor and testing with lower resistance values. Then double check the high reading with tape removed. This "calibration" will allow you to get maximum performance (range) from your specific sensor.

Great! Thanks for the info, will give that a try to get the right readings out from it.

Will post back with results, tonight hopefully weather permitting.

Just to tie up the ends here, I tried adding a capacitor to see if this helped with the long cable run, and no difference.
I then varied the resistor, doing the calibration dlloyd suggested, covered the sensor in tape and adjusted resistor down to around 200, then went and uncovered it, it only went up to about 350.

Still puzzled over what was wrong, I went and swapped the LDR itself. Guess what, it jumped and varied. So I adjusted the resistor values again (4k7 is what I ended up on) and this now gives me a great variance between light and dark (This is just for a dusk to dawn light sense).

So it looks like it was a faulty LDR all along. Thanks for the help though guys, helped me track it down and sort it.

For info, here is the faulty LDR.

Not sure if you can make it out but there looks like a crack/line from the bottom left to the middle right, which I'm going to suspect was the issue.

Thanks again for helping out :slight_smile:

Seems that those pictures can only be seen if you have a Google account. :frowning:

There have been several posts that LDRs have a very short life outside.
Probably due to moisture ingress past the wires..

A small solar cell (from a cheap garden light) is a better solution.
The 2-3volt they produce can be read direcly by an analogue pin.
Wise to use a (~3k3) resistor between solar cell and pin.
And a (~10uF) cap from analogue pin to ground.