LED is a particular diode which generates photons (light) when a stream of electrons passes trough it.
To build a diode we use a crystal (electric insulator) which is doped by atoms which have one more electron on their valence band (N doping) or missing one electron on their valence band (P doping).
2.1.1 N doping
We use an electron donor an atom which has 5 electrons on its valence band. Four electrons will participate to the crystal structure the fifth will stay free capable of moving in the crystal as a negative charge.
2.1.2 P doping
We use an electron acceptor element which has 3 electrons on its valence band. These will participate in the crystal struture but is fails one electron which creates a fixed hole like a positive charge.
Examples of P-doping elements: boron (B), aluminium (Al), gallium (Ga), indium (ln).
2.1.3 Working principle
The LED is a diode that restricts the direction of movement of charge carries. The current can flow from the P-type side (the anode) to the N-type side (the cathode), but not in the opposite direction.
In a diode a n-type semiconductor is brought into contact with a p-type semiconductor creating a p-n junction.
When a p-n junction is first created, mobile electrons from the N-doped region diffuse into the P-doped region where there is a large population of holes (places for electrons in which no electron is present) with which the electrons ?ecombine?? When a mobile electron recombines with a hole, the hole vanishes and the electron is no longer mobile. Thus, two charge carries have vanished. The region around the p-n junction becomes depleted of charge carries and thusbehaves as an insulator. However, the depletion width cannot grow without limit. For each electron-hole pair that recombines, a positively-charged dopant ion is left behind in the N-doped region, and a negatively charged dopant ion is left behind in the P-doped region. As recombination proceeds and more ions are created, an increasing electric field develops through the depletion zone which acts to slow and then finally stop recombination. At this point, there is a ?uilt-in??potential across the depletion zone (source Wikipedia).
If an external voltage is placed across the diode with the same polarity as the bult-in potential, the depletion zone continues to act as an insulator preventing a significant electric current. This is the reverse bias phenomenon. However, if the polarity of the external voltage opposes the built-in potential, recombination can once again proceed resulting in substantial electric current through the p-n junction