This is the circuit diagram of a light activated switch based on National Semiconductors comparator IC LM 311 door alarm circuit projects pdf a LDR. The circuit is based on a voltage comparator circuit wired around IC 1. The non inverting in put of IC1 is given with a reference voltage of 6V using resistors R3 and R4.
At darkness the resistance of the LDR will be high and so do the voltage across it. When the LDR is illuminated ,its resistance drops and so do the voltage across it. This makes transistor Q1 on and it drives the relay.
As a result we get a relay switching according to the intensity of the light falling on the LDR. Light Activated Switch Circuit Diagram with Parts List . Adjust POT R1 to set the desired light intensity for switching the relay. For this illuminate the LDR with the desire intensity light.