Solar cells convert sunlight directly into electrical energy through the photovoltaic effect. They are constructed of two layers, an n-type and p-type semiconductor, creating a p-n junction. When light hits the solar cell, photons are absorbed and electrons are released, generating an electrical current. The current can be converted to AC power for applications. The main types of solar cells are monocrystalline, polycrystalline, and amorphous silicon cells, which have different efficiencies depending on their material purity.