At a p-n junction made of a direct-bandgap semiconductor, injected electrons and holes recombine and emit a photon. The light's wavelength is set by the material system's bandgap (e.g., InGaN for blue, AlGaInP for red). Quantum well structures in the active region significantly boost the efficiency of this recombination.
How does a laser diode work?
As with an LED, light is generated by recombination at a p-n junction, but here inside an optical resonator that reflects the light back and forth repeatedly. Above a threshold current, stimulated emission dominates over spontaneous emission — population inversion occurs and coherent laser light is produced. Depending on the resonator design, this yields Fabry-Pérot, DFB, or VCSEL lasers, among others.
How does a solar cell work?
When light hits a solar cell's p-n junction, photons with sufficient energy generate electron-hole pairs in the semiconductor. The junction's built-in electric field separates these charge carriers before they can recombine and drives them into the external circuit. This photovoltaic effect converts light energy directly into electrical energy.
How does a photodiode / image sensor work?
In a photodiode, incoming photons generate electron-hole pairs in the p-n junction, which are separated by the built-in electric field and measured as photocurrent. An image sensor consists of a grid of such light-sensitive cells, with CMOS sensors giving each pixel its own readout electronics. Color information is usually created through a Bayer color filter pattern of red, green, and blue filters placed over the individual pixels.