Electrical – How to avoid infinite on/off loop of a voltage controlled (with a photoresistor) switch

switchesswitching

I have designed this circuit to switch on a light (R2) when it gets dark. The circuit works fine, however I have a small problem.

schematic

simulate this circuit – Schematic created using CircuitLab

As you can probably guess, when it gets dark the voltage at the gate drops and the mosfet is turned off, the relay is turned on and the light is turned on as well. Now as you might have guessed, the light shines on the photoresistor, makes its resistance drop, turns on the mosfet, turns off the relay and turns the light off. This is pretty much an infinite loop…

Of course I could put the photoresistor in a place that cannot be reached by the lamp's light, but I was wondering if one could devise a circuit to avoid such an infinite loop, perhaps a circuit "with memory". What possible solutions could I try?

I thought of a timer that prevents temporarily the mosfet to change state after it has just changed its state, say for the next 12 hours, but I'm not sure how to do such a thing or if simpler options exist.

Then again I might be overthinking things and I could just put the photoresistor in a place not reached by the light of the lamp…

Best Answer

Issue with twilight is ambient + lamp = oscillation. It needs to get a lot brighter to turn back on. I think I would have designed it like this with some added hysteresis.

schematic

simulate this circuit – Schematic created using CircuitLab

Of course if the light is bright and close to the sensor even that will not work. Some shielding from the light may still be warranted. Note, the light should not go on and off when a cloud passes by either so some playing with values is warranted. Maybe add some trim-pots till you get it the way you need it.

Related Topic