How to do it:
A photosensor is a sensor that converts an optical signal into an electrical signal using a photosensitive element (photodiode) whose sensitive wavelength is close to the wavelength of visible light, including the infrared wavelength and the ultraviolet wavelength.
The photosensitive sensor is packaged in an antistatic bag. Should be avoided in wet environments, but also pay attention to surface damage and pollution, otherwise it will affect its photocurrent.
Photosensitive sensors are mainly used in the field of light automatic control of solar lawn lights, night light control lights, cameras, monitors, light control toys, sound and light control switches, cameras and other electronic products.