How do solar panels produce electricity?

The unique design of solar panels causes them to be able to convert light energy from the sun into electricity. The top layer of the panel, which is exposed to sunlight, is given an excess of electrons while the layer underneath has a lack of electrons. When a photon from the sun is absorbed by the panel, its energy is transferred to an electron in the top layer of the solar cell. The extra energy given to the electron creates a flow of electrons though the bottom layer and into the wiring which connects your panels to the desired energy destination.