Under the presence of an optical stimulus , photons are absorbed to create electron hole pairs . Pairs that are generated with in a diffusion length of the depletion region will be swept by the built in potential across the depletion region . Consequently , being excited by light , a current is produced due to the optical genearation of carriers . Including this generation current in equation [1]