Describe the function of a charge controller in solar power systems.
A charge controller in solar power systems regulates the voltage and current coming from the solar panels to the battery. It prevents overcharging and over-discharging of the battery, thereby enhancing battery life and ensuring efficient operation of the solar power system.