The way solar cells work to generate electricity is by absorbing energy from the sun (which constitutes tiny particles called photons).
This energy from the sun strikes the solar cells thereby resulting in electrons being knocked out from their normal position and then being allowed to move freely, resulting to be the current that flows through our circuits or light bulb at home.
But there is more physics behind how solar cells work to generate electricity so let’s look into that.
At the fundamental level, materials in physics are considered to be of 3 types.
Conductors – this type of material conducts electricity, in other words, allowing electrons to move freely when energy or voltage is applied. Example of conductors are copper, aluminium, nickel e.t.c.
Insulators – this type of material is the opposite of conductors because they don’t conduct electricity hence don’t allow the flow of electrons. Example of insulators are plastics, wood, paper, or glass.
Semiconductors – as the name implies, lies between the conductors and the insulators which means they are partially conductive.
This type of material is very useful and it is the most used material in the world of physics and electronics because without semiconductors, there will be no diodes or transistors (which is a useful electronics component) and without diodes or transistors, there will be no modern computers or smartphones.
Semiconductor materials are the materials that solar cells constitute.
Silicon and germanium are some examples of semiconductors.
But silicon is widely used due to fact that the number of shells in the silicon atom is 3 which means it has it outer-most shell close to the nucleus as oppose to germanium that has 4 shells which means the outer-most shell is quite far from the nucleus.
So at slight increase in temperature, germanium will become unstable as compared to silicon.
Silicon is an element with an atomic number of 14 on the periodic table which made it have 4 valence electrons at the outer-most shell.
Due to these 4 valence electrons, silicon is said to not be in a stable state because for an atom to be in a stable state, its outer-most shell must be complete (i.e. have 8 valence electrons at its outer-most shell.)
Another thing about silicon is that, in its pure form which is called (intrinsic state), it doesn’t conduct well. To increase the conductivity of a silicon semiconductor, an impurity must be added which involves a process called doping.
These impurities are of two types; those with pentavalent (or 5 valence electrons) and those with trivalent (or 3 valence electrons).
A doped silicon semiconductor is referred to as an extrinsic semiconductor.
When a silicon semiconductor is doped with a pentavalent element or atom (e.g. phosphorus - which has an atomic number of 15 and valence electron of 5), the 4 valence electron of the silicon combines with the 5 valence electrons of phosphorus which results in an extra electron from the phosphorus.
As an electron that is considered to be negative is the excess, it is referred to as an n-type semiconductor.
But in the case that a trivalent atom (e.g. boron with an atomic number of 5 and a valence electron of 3 at its outer-most shell) is doped with silicon with a valence electron of 4, this results in an extra hole (or space that the silicon has).
But a hole which is considered positive is the excess here, it is referred to as a p-type semiconductor.
The idea of electrons and holes is a little bit complex to understand but it is useful in electronics.
It is just as saying, rubbing a rod with a cloth is the same as rubbing a cloth with a rod because they both interact with each other.
So both hole or electron flow constitutes electricity basically.
After doping the silicon with either a pentavalent or trivalent impurity, it is cut into little or light sheets. These light sheets (also called wafers) are what a solar cell is made up of. But the solar cells don’t just have a p-type or n-type sheet only but rather both.
This joining of the p-type sheet and the n-type sheet yields a PN – Junction.
As the sheets are joined together, there is some dispute or interaction between the p-type and n-type semiconductor which results in some of the electrons from the n-type escaping to the p-type side, and holes from the p-type also escape to the n-type side which results in a depletion region been formed.
The depletion region or layer is the driving force that causes electrons (from the n side) to move to the holes (at the p side) as photons or energy from the sunlight strikes the sheets or cells.
In the depletion region, electrons and holes stick together, and also the electrons in the depletion region align themselves near the p-type side while the holes in the depletion region align themselves near the n-type side.
Now you might think that since the electrons in the depletion region lie near to the p-type, or the holes in the depletion region lie near the n-type, they will attract each other according to the principle that like charges repel and unlike charges attract.
The answer here is that the electrons and holes stick to themselves and doesn’t allow more electron or hole to join them. Also, these electrons and holes that align themselves to the ends of the depletion region form an electric field which as stated above is the driving force.
The n-type sheet is heavily doped hence, it is a light sheet and has a small depletion region why the p-type is lightly doped hence, has a larger depletion region.
The reason why the n-type side is heavily doped and is made to have a small depletion region is that an electron is what current or electricity constitutes and the sunlight energy needs to penetrate through the n-type side, down to the depletion region in order to split up the electrons and holes that stick themselves together to form a depletion region.
But as soon as the energy source is no longer striking the solar cell, everything goes back to its initial position thereby forming a depletion layer again hence no current flow.
Hope this gives you some glimpse of the physics behind how solar cells work to generate electricity.