I used the following circuit to control the outdoor light, and it works as I wanted.

I am trying to understand the circuit and it looks like a comparator circuit, but I don't understand the use of 100 kOhm feedback resistor. Also how to choose the resistor values 100 kOhm, 15 kOhm and 100 kOhm pot?

circuit schematic

  • 2
    \$\begingroup\$ The resistors picked depend on the LDR used and what you want to achive. About the feedback resistor : the comparator has Hysteresis so at the treshold point the RL1 doesn't switch on and off for multiple times. \$\endgroup\$ – Baciu Vlad-Eusebiu Dec 17 '18 at 11:40

The point of the 100k feedback resistor is to provide hysteresis. Without it, if the LDR was very close to the threshold, it could switch on and off rapidly. Adding the feedback resistor will change the voltage level of the non-inverting input when the comparator is activated. This will mean that the LDR will have a bit of headroom to once again reach the threshold voltage.

enter image description here

This picture shows how the hysteresis helps. You can see that once the non-inverting input has reached the lower threshold, the OUT changes LOW. Only when it reaches the upper threshold will it go back high again.

Without hysteresis, you could end up with an unstable output, especially if the light level is very close to the threshold

enter image description here

Some further reading on this can be found in a nice application note by Maxim Integrated: Application note 3616

This application note goes through the math required to select values for your resistors. The only one it cannot select is your LDR. You can, however, calculate a fixed resistor, then choose a suitable LDR from that.

  • \$\begingroup\$ Without the hysteresis, you can also get a stable, oscillating output as the lamp's light is reflected back to the photo cell -- switching the lamp off. This is a very common problem for many porch lights (even with hysteresis and time delays). \$\endgroup\$ – Brock Adams Dec 17 '18 at 21:46

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.