# Why is the band offset of an LED equal to the band gap?

I am doing an experiment where we have to use the threshold voltage of LEDs to determine Planck's constant given the following relation

$$eV_0 = E_g = \frac{hc}{\lambda}$$

where ## V_0 ## is the threshold voltage, ## \lambda ## is the wavelength of emitted light and ## E_g ## is the band gap.

After reading up, it is my understanding that ## eV_0 ## is the energy offset between the conduction band in the p-type and n-type regions of the p-n junction, which is caused by the electric field set up in the depletion layer. The right hand side is obviously the energy of the photon emitted by the LED when an electron transitions from the conduction to the valence band on one side of the junction. These two regions are separated by the band gap.

I am really struggling to see how the energy offset and the band gap can be equal like this. Any help would be much appreciated. Thank you.