Solar energy is generated from sunlight using photovoltaic cells or concentrated solar power systems. Photovoltaic cells use the photovoltaic effect to directly convert sunlight into electricity, while concentrated solar power systems use lenses or mirrors to focus sunlight onto a receiver to generate electricity. Solar energy can be used to power buildings, vehicles, and electric grids, providing a renewable alternative to fossil fuels. However, the intermittent nature of sunlight presents challenges for energy storage and solar only produces electricity when the sun is shining.