This simple circuit can be used as an automatic bathroom lamp controller. It disables the bathroom lamp at daytime and enables it at night. The circuit is built around a light-dependant resistor (LDR), reed switch, LM358 IC, a 12V 1-change over (C/O) relay The working of the circuit is based on the opening/closing of the bathroom door. When the bathroom door is closed, magnet comes near the reed switch and shorts its terminals. Then bulb will be not glowing. When bathroom door is opened, magnet moves away from the reed switch and opens its terminals relay energizes and lamp glows. When bathroom door is opened, lamp remains on.
After entering the bathroom do not close the door completely. If the bathroom door is completely closed, lamp is switched off. During daytime, lamp operation is not necessary due to the presence of sunlight so LDR is used. Fit LDR near the bathroom window where it can receive sunlight (reflected sunlight is enough). At daytime if you open the bathroom door, resistance of LDR reduces Relay does not energies and lamp remains off. At night, if you open the bathroom door, resistance of LDR is high, the lm358 IC gives high signal. Relay energizes and lamp is switched on.