The sun provides the earth with its main source of energy. In terms of renewable energy, solar energy is the most promising direction for producing electrical energy. For the efficient use of solar energy it is necessary to understand how electrical energy is produced from the sun. This document describes the principle of solar energy to generate electrical energy. Analyze the relationships between voltage, current and power output of photovoltaic cells and how to maximize the efficiency of solar panels. The document will give greater emphasis to the generation of electrical energy from photovoltaic solar panels, due to its economic advantages compared to the conversion of thermal solar energy.