When a photon with sufficient energy (i.e. of the correct wavelength range) is incident upon and becomes absorbed by the semiconductor, a mobile electron and an electron hole are generated. The electric field present in the junction acts upon the electron, creating a photocurrent. This current will be proportional to the irradiance at the detector.