Twilight sensor with a miniature lens ideally suited for built-in installation. The sensor can be used for automatic control of electrical devices, eg. LED illumination.