LDR failure (damage to track)

I have build a chicken coop controller currently it is only set up to open close the door.

Let me first say I dont really know what I am doing but am good with logic and can stumble my way through things.

Everything seems to work perfectly for several days or weeks and then the LDR fails. The track looks physically burnt. The resistance of the LDR drops permanently and the door stay open. (this is about the 6th time it has failed this year.)

I just went out to the coop and the readings on the LDR are (as long as I am measuring correctly)
It is displaying on the LCD 120 (it usually reads between 0=dark 600 bright)

The multimeter reads
3.7v
.6ma

I have attached a picture of the latest damaged LDR and where the ldr is connected to the Arduino on A0 (blue and red wires)

It is covered under the roof of the coop in a piece of translucent pex plumbing pipe (No rain or direct sunlight)
Entire system is running off of a Car battery being trickle charged with a 1 amp charger.

door is controlled by a 12v linear actuator.

Any ideas what might be causing them to fail?
I have googled ldr failure / photo resistor failure and found nothing and no pictures that show the damage I am getting.

Thanks
Thor

arduino coop1.JPG

How much resistance do you have in the LDR circuit? Can you post a wiring diagram? The photo is too small & blurry to tell anything. You should have at least 1000 Ohms in the LDR circuit.

That device doesn’t look rated for external use. Was it exposed to the elements?

^ Seems to be a common problem with LDRs used outside. Try the solar cell of a cheap garden light, with a burden resistor. No pullup resistor. http://forum.arduino.cc/index.php?topic=370506.0 Leo..

It is outside but under the roof of the coop, and in a piece of plastic pipe. The sensor leads are just “plugged into” a connector.
I was going to seal it in silicon or epoxy but I didn’t want to do that if it was going to keep failing.

Here is my best attempt at a diagram

I’m not sure where to measure the resistance in the DLR circuit.
The pulldown is 1K and a working DLR is also about 1k on a cloudy day.

Wawa: ^ Seems to be a common problem with LDRs used outside. Try the solar cell of a cheap garden light, with a burden resistor. No pullup resistor. http://forum.arduino.cc/index.php?topic=370506.0 Leo..

I might have to go that way. I have a couple old solar lights laying around. I assume I just measure the voltage being produced by the panel and set a level based on that to trigger the door. It is just irritating having to redesign things when you think you have it figured out.

Thanks for the suggestion. I will read up on the link. Thor

Your Wiring looks OK, I agree with MarkT on the appearance of the LDR, also with Wawa on the solar cell, you may be able to salvage a small one from a toy or old calculator. One thing I did notice, appears you are powering the relay coils from the Arduino 5 volt regulator, those coils draw around 70 mA each and may shorten the life of your Arduino, they also cause a voltage dip that might throw your light reading off, better to use a separate supply for the coils.

outsider: Your Wiring looks OK, I agree with MarkT on the appearance of the LDR, also with Wawa on the solar cell, you may be able to salvage a small one from a toy or old calculator. One thing I did notice, appears you are powering the relay coils from the Arduino 5 volt regulator, those coils draw around 70 mA each and may shorten the life of your Arduino, they also cause a voltage dip that might throw your light reading off, better to use a separate supply for the coils.

I am aware of the relay board being powered by the arduino might be an issue, especially if I add any more relays. currently only 1 relay will be powered at a time. there may be a brief time (1 second) where 2 relays might be powered at the same time to brake the actuator if a direction change happens while it is moving.

After things are working well, the plans are to rewire it permanently and power the relay board separately. After that I plan on having the coop lighting also controlled by the relay board.

Thanks for looking it over and the suggestions.

Do you think it will help if I epoxy and silicon the LDR? They already look like they are coated in epoxy and I don't see any breaks in that seal?

Thor

As long as the coating does not cloud or darken with age, it might be worth a try. I still like the solar cell scheme. Also, you might consider increasing the 1k resistor, 5 mA is a small current but constant flow may cause deterioration, of course you would have to recalibrate but it might be worth while. Another thought, you could power the LDR with a digital output pin and only apply power during a reading (just a few milliseconds).

Wawa: ^ Seems to be a common problem with LDRs used outside. Try the solar cell of a cheap garden light, with a burden resistor. No pullup resistor. http://forum.arduino.cc/index.php?topic=370506.0 Leo..

Ok so seems I need some educating.

Burden Resistor? From what I read it goes across the + - of the supply to prevent the voltage from possibly going too high?

Am I way off base?

If I directly hook up a small 2v solar from a kids toy to ground and A0 without a burden resistor what are the consequences?

(not saying that I have done that but: if I did, it would be reading aprox 200 on A0, and does drop when the solar cell is covered up. ) (I'm waiting for the sun to shine so I can see how high it goes. my calculations say around 400.)

Thor

If I directly hook up a small 2v solar from a kids toy to ground and A0 without a burden resistor what are the consequences?

Should be OK.

However, if there is any chance that the solar cell voltage could exceed 5V, put a 10K Ohm resistor between the + terminal and the analog input, to limit the current into the input pin.

Th0r_H: Burden Resistor? From what I read it goes across the + - of the supply to prevent the voltage from possibly going too high?

Am I way off base?

You have more light/dark difference with a load resistor across the solar cell. The cell might produce 2volt in full sun, and 1.8 volt in moonlight. With burden resistor that could be 1.8volt and 0volt.

A resistor between cell+ and analolgue input might be wise if the cell is big. 10k is a good value. That also prevents phantom powering. A 100n cap from analogue input to ground prevents noise problems. Leo..

Just an update.

Everything is working just as I want it to. I have a small toy solar cell that reads aprox 200 in daylight and 0-1 in darkness.

I didn't even need to change my code.

Also I have not added a burden resistor yet, and everything seems to be stable and working well.

Some day when I have time I plan on some additions to the coop. Until then I think I will leave it as it is.

Thanks for all the help.

Thor

Another update after a couple months.

I made a couple changes to the trigger value for dusk and dawn.

Other than that, no changes, and everything has worked perfectly every morning and night for 2 months.

So glad everyone convinced me to use a solar panel for a light sensor.

Thor

I was thinking you are sampling the LDR on A0 without a series resistor. Is it possible that during startup or during other parts of the code, the A0 goes low and then short circuits the LDR from the 5V line? Why not add a series resistor say 10K before A0 ?

Other than that the LDR looks corroded and looking at the LDRs I have here they seem to be covered by some sort of varnish from the factory, maybe you could add a drop of superglue on it to seal it even better. Or even a touch of clear polyurethane/yacht varnish? That would ensure the LDR is weather proof. Chicken poop is probably acidic, and maybe in close proximity that helps the LDR get corroded.

I use my LDRs in my summer house. During the summer there is no problem. I leave for winter and when come back at spring the LDR is dead. I think it is the problem of the cheap Chinese LDRs from EBAY. This is the second year, during the winter the corrosion happens exactly like Th0r_H described. Already thrown out two sensors, one at the end of each winter.

Somebody suggested epoxy, but this time I dipped mine in polyester. three thick layers, one after the other one dries. Will see the result next spring. But at the same time bought better quality ones, more expensive naturally :-), from Mouser, in case the polyester remedy also fails..