A photodiode is a semiconductor device that converts light into electrical current. The current is generated when photons are absorbed in the photodiode. It is based on a p-n junction or p-i-n structure. When a photon of sufficient energy strikes the diode, it excites an electron thereby creating a mobile electron and a positively charged electron hole.