Smart photoresistor timer needs few components
Smart photoresistor senses darkness and then turns off.
Abel Raynus, Armatron International Inc, Malden, MA; Edited by Martin Rowe and Fran Granville -- EDN, 9/3/2009
An application required a photo timer with some unusual functions. It had to switch on the load, a lamp, an hour after sunset. After working for three hours, the timer should turn the load off, which had to remain off until an operator manually reactivated the timer. The timer had to reside between the main 110/220V-ac line and the load. And, as with any other consumer product, it had to be cost-effective. You can achieve these goals by using a voltage comparator and dual timers with an RC-timing network, but an inexpensive, 8-bit microcontroller with a built-in ADC provides a more elegant approach. You can perform all the functions in firmware. Listing 1 contains downloadable source code.
Figure 1 shows the circuit, which uses an eight-pin MC68HC908QT2 microcontroller from Freescale Semiconductor. Reference 1 describes a microcontroller’s power supply. Q1, an L2004F31 logic triac from Littelfuse, switches the load on and off; the type you use depends only on the load current and main voltage. The L2004F31 requires only 3 mA of dc-gate-trigger current, and it conducts 4A rms at 200V ac. The VT90N1 photoresistor from PerkinElmer has a dark resistance of 200 kΩ, which drops in light to 10 kΩ or less. The LED indicates the status of the timer: It is on when the timer is ready for work and waits for darkness. It blinks during the delay, and it is off when the timer waits for reactivation (Figure 2). The W934GD5V LED from Kingbright has a built-in resistor that minimizes the number of necessary components. To reactivate the timer, press the pushbutton reset switch. All time delays are set in firmware, and you can easily change them.