Photodiodes are devices that produce current when light is incident on them. The photons in the light promote electrons into the conduction band. These are useful whenever you need to measure an amount of light, since the current will depend on the number of incident photons. They are also useful even just to detect some light (say, you want to tell when it's daytime, etc.)