I'm doing a hobby project with an electronic panel. The panel is going to have some white LEDs under switches names. Since im going to use the panel at all times of the day I want the LEDs to be regulated, but i dont want to regulate the brightness by hand with a potentiometer. I have been thinking that a LDR will be a perfect solution for me, but unfortunetely the LDR is working in the oposite way, than i actually need it to work. Can you guys please tell me if the circuit in the topic bellow is going to work for me, or can you advice me a solution for my problem. Please help me, i have spend on this problem like a day and only what i found are arduino solutions or on/off ne555 switches.

Sumarry, I need a circuit like a PWM steered by a LDR, The darker it is outside the lower the brightness of the LEDs is. Aditionally the panel is going to be powered by a battery so energy afficency is also important.

How to adjust LEDs brightness with photoresistor?

  • 1
    \$\begingroup\$ Please post the schematic into your question. Use the image upload button. \$\endgroup\$
    – Transistor
    Commented Jun 5, 2021 at 16:46

1 Answer 1


The part of the circuit which controls the duty cycle in the referenced circuit is this potentiometer:

enter image description here

Moving the wiper higher increases the resistance of the lower leg of the voltage divider and increases the voltage at the CTRL pin. This has the effect of increasing the duty cycle.

You can replace that potentiometer with one of the following two schemes:


simulate this circuit – Schematic created using CircuitLab

In the left LDR arrangement, decreasing light will increase the resistance of the LDR and thus increase the voltage of the CTRL pin.

In the right LDR arrangement, decreasing light will increase the resistance of the LDR and thus decrease the voltage of the CTRL pin.

So you'll want to substitute the potentiometer in the 555 circuit with the left LDR arrangement pictured above.

For the resistor, I would measure the resistance of the LDR in bright light. Then use 10 times that value for the upper leg as a starting value. You'll have to do some experimentation to find a suitable resistor value.

Note that LDRs are very non-linear devices so I think you'll find it very difficult to achieve the kind of response you want. Most LDRs are used simply to detect if there is sunlight or not (like in PIR outdoor motion lights).

I would recommend the solution given by another answer in that thread -- just use a microcontroller:


You can program the response to be exactly the way you want it including a minimal amount of darkness before the lights are turned on.

  • \$\begingroup\$ Thank you very much, I will go along with your advice and make it with an arduino nano, since they are really cheap, and as you wrote I will be able to control the output as I wish. \$\endgroup\$ Commented Jun 5, 2021 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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