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.
Can someone point me in the right direction?