This design arose from a requirement for a sunrise detector with low power consumption, reliable light detection, and a real sleep mode during darkness. The sleep mode of the microcontroller with a 32-kHz clock draws about 1 mA, which was too great. The circuit described here can keep the microcontroller and following circuits completely shut down during darkness, while drawing only about 8 µA (Fig. 1).
One key challenge in creating a sunrise detector is handling the long, slow signal change from the sensor, often ramping from off to full on over tens of minutes. The use of two NAND gates in a preset RS latch configuration helps add stability and signal integrity to the sensor output. U1 is from the CMOS 4000 seriesin particular the HCF4011BEbecause these gates draw less quiescent current in static mode than the 74HC00 logic series.
The sensor itself consists of two green LED diodes (D1 and D2) that act as a light detector. These diodes come in clear transparent plastic, which makes them more sensitive to incident light than red LEDs. The current generated by the LEDs is a fraction of a microamp, but it’s enough to switch the CMOS logic. During darkness, the LED leakage current pulls the RS input low. As the sun rises, the diodes generate a photovoltaic voltage that raises the RS input, driving the output low. This turns on Q1, which pulls down the gate of Q2, powering up any following circuitry.
The circuit can be modified to detect darkness rather than daylight by using a photoresistor and modifying the circuit as shown in Figure 2. The sensitivity of the circuit is about 10 lux, which means that a single white LED light source activates the switch in darkness from 30 feet. The photosensor’s resistance is 2 M in the off state and about 39 k in the on state.