The primary component used to construct solar cells is semiconductor silicon.
Photoelectric elements that can transform energy are known as solar cells, which are composed of p-type and n-type semiconductors. The essential component of semiconductors is "Silicon," which has low conductivity. However, when various impurities are doped into semiconductors, they can be transformed into p-type and n-type semiconductors, making them more useful for energy conversion.
When light energy from the sun hits a solar cell, the electrons in the silicon atom get excited and start moving, creating an electron and a hole. A p-type semiconductor has one fewer negatively charged electron, which can be seen as one extra positive charge. As a result, the potential difference between the p-type and n-type semiconductors now has an additional free electron to generate current. This current is what powers the solar cell and enables it to convert sunlight into electricity.
As the sunlight falls on the solar cell, it releases electrons and holes within the semiconductor material. These electrons will move towards the n-type semiconductor, whereas the holes will be attracted by the p-type semiconductor. The built-in potential, in turn, affects the movement of these electrons and holes. This process leads to the accumulation of electrons at one end and holes at the other. To generate electricity from this energy, a circuit can be created by connecting the electrodes outside. Hence, this is how solar cell power generation works based on this principle.

