Batteries are used to store excess energy generated by solar panels for later use, such as during periods of low sunlight or at night. Common types of batteries used in solar PV systems include lithium-ion batteries, lead-acid batteries, and saltwater batteries.