Using an LDR as a sensor, this circuit from a 90s Hands-On Electronics triggers a relay in the presence of light. The supply must be according to the voltage of the relay used.

Using an LDR as a sensor, this circuit from a 90s Hands-On Electronics triggers a relay in the presence of light. The supply must be according to the voltage of the relay used.