Principle and Working:
The photon energy by Einstein equation E=hv is equal to energy gap Eg between the valence and conduction bands. The energy Eg is equal to the energy barrier eV0, that electron have to overcome in going from n-doped side of diode junction to p-doped side when no external voltage V is applied to the diode.
In the p-doped side, electron recombine with holes releasing the energy Eg in the form of photon emit given by equation
Eg = eV0