Solar panels are mainly to obtain the sun's energy in the form of radiation to generate electrical energy. To capture the sun's energy, photovoltaic cells are used that work almost like a battery. The received sunlight separates the electrons so that they form a layer of positive charge and another negative charge in the solar cell. This potential difference generates an electrical current. These panels are in turn connected to a battery that stores the electricity generated and it is this charge that is used. These panels are in turn connected to a battery that stores the electricity generated and it is this charge that is used.