I'm making an interactive art project and I'd like to have an LED that turns on when someone puts their hand in front of a light sensor (photoresistor). I got that working. Next step is that I'd like to have the LED fade back to off after a second after it turns on.

What I'm after is:

  • When photoresistor goes from uncovered (low resistance) to covered (high resistance), turn LED on immediately, then fade to off over ~1 second.
  • When photoresistor is not covered, the LED should be off.
  • I don't care too much what happens if the photoresistor becomes uncovered while the LED is fading, but the best would be if it keeps fading to off.

Here's my circuit attempt. It works the first time but there's no path to discharge the capacitor so it won't turn on a second time.

circuit attempt

Can someone point me in the right direction?

  • \$\begingroup\$ Once the LED's turned off, how long can the circuit take to recover before it's back to the initial state? \$\endgroup\$
    – Andy aka
    Jan 28 at 18:14

1 Answer 1


Circuit below:

Discharging path ensure two 10k resistors.

The right PNP creates a monostable circuit to not stop fade if hand is out of LDR.

470k trimpot sets the LDR trigger point according what LDR is used and light conditions around. Better use lower resistance LDR like 10k.

enter image description here

  • \$\begingroup\$ The circuit works great! Thanks for creating it! \$\endgroup\$
    – monkbroc
    Jan 29 at 14:10

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.