pn diodes are diodes in which there is a junction between a positive (p) and a negative (n) doped semiconductor.
The positive semiconductor has an excess of spurious electrons (holes), while the negatively doped semiconductor has an excess of electrons. The semiconductor is doped by ion implantation, diffusion or epitaxy.
pn junctions are used in all semiconductor devices - diodes, transistors, LEDs, etc. - and in integrated circuits. At this junction, the actual electronic action takes place when the holes are recombined by electrons. While the pn diode has one pn junction, bipolar transistors have two pn junctions connected in series. Either as pnp or as npn transistor.
Since solar cells are made of semiconductor material and are constructed like photodiodes, these components also have pn junctions. A pn junction is formed between the two doped semiconductor layers, one of which is positively doped and the other negatively doped. At this pn junction, the doping changes from poseitive (p) to negative (n). A space-charge zone, also known as a junction, is formed, which allows current to pass in only one direction when a voltage is applied.