In the figure we have an application of a voltage comparator in a circuit that fires with the sensor (LDR) stops receiving light. P1 makes the trigger point adjustment. The relay is of the sensitive type with a maximum current of 50 mA, and another type of load can also be directly excited, such as solenoids and small motors. For higher current loads, a PNP power Darlington can be used. To excite the circuit with light, just invert the positions of P1 / R1 and the sensor.