Streetlights, emergency lights, and security lights must automatically turn on when it gets dark. You base the control circuit on the resistance of a photoresistor or another LDR (light-dependent resistor) that varies with light intensity. An LDR’s resistance of several megohms in darkness decreases to a few hundred ohms in bright light (Figure 1). This feature allows a circuit to distinguish between one light bulb and two, direct sunlight or total darkness, or anything in between.
|Figure 1.||The resistance of a photoresistor falls dramatically as you illuminate it.|
You can use an LDR in a circuit that detects darkness and turns on an LED (Figure 2). The circuit uses a high-voltage threshold-detector IC that features a current output and operates as a comparator. The LDR and potentiometer R3 form one side of a Wheatstone bridge. Fixed resistors R1 and R2 form the other side. You can operate the circuit from a 5 to 65 V battery because the bridge excitation comes from an on-chip 2.4 V series regulator that is referenced to the supply voltage. The chip keeps the 2.4 V regulation voltage below the supply voltage. Resistors R1 and R2 form a fixed reference voltage at the noninverting input of internal comparator A1. The LDR and R3 form a variable voltage at the inverting input. When the light level falls, the voltage on the inverting input falls below the reference voltage until the comparator trips, activating the relay and the LED. The total voltage across the resistors is always 2.4 V. Choose the values for these resistors based on your desired threshold voltage using the equation
where VTH is the threshold voltage.
|Figure 2.||This night-light circuit turns on as the illumination on the photoresistor dims.|
You can reverse the position of the LDR and potentiometer R3 to switch on the relay when the light exceeds a preset level. You can adjust the potentiometer to preset the switch to any light level, making it an ideal light sensor. The IC’s output current is less than 100 nA when the negative pin’s value is greater than that of the positive pin. The output current goes to 1 mA when the positive pin’s value is greater than that of the negative pin. This current drives a ground-referenced resistor to develop a logic-level signal at DOUT. The logic signal is buffered with the NPN transistor that then drives relay switch S1. You should use a latching relay, which uses permanent magnets to hold the armature in place after the drive current is removed.
When you turn on the LED, the resistance of the LDR may decrease dramatically, and the comparator will switch off, cutting back the output current to nanoamps while the latching relay keeps the light on.