Solar streetlights function independently without the requirement of an external power supply, as they contain p-n junctions within their solar cells. A p-n junction is formed by adding pentavalent impurities to a thin p-type silicon sheet, converting part of it into n-type silicon. The concentration gradient of charge carriers on both sides of the silicon sheet leads to the diffusion of holes from the p-side to the n-side and electrons from the n-side to the p-side, generating a diffusion current. The region near the junction becomes devoid of free charge carriers, forming the depletion region. Also, net bound positive and negative charges remain in this region, creating an electric field and potential difference across the junction. The electric field drifts the minority carriers in the p-n junction, generating a drift current that counteracts the diffusion current. This electric field also opposes any further diffusion of majority carriers across the junction. At equilibrium, the total current across the junction is the same in magnitude in both directions and is indicated by constant Fermi energy.