A solar charge controller is needed in virtually all solar power systems that utilize batteries. The job of the charge controller is to regulate the power going from the solar panels to the batteries. Overcharging batteries will at least significantly reduce battery life and at worst damage the batteries to the point that they are unusable.
The most basic charge controller simply monitors the battery voltage and opens the circuit, stopping the charging, when the battery voltage rises to a certain level. Older charge controllers used a mechanical relay to open or close the circuit, stopping or starting power going to the batteries.
More modern charge controllers use pulse width modulation (PWM) to slowly lower the amount of power applied to the batteries as the batteries get closer and closer to fully charged. This type of controller allows the batteries to be more fully charged with less stress on the battery, extending battery life. It can also keep batteries in a fully charged state (called “float”) indefinitely. PWM is more complex, but doesn’t have any mechanical connections to break.
The most recent and best type of solar charge controller is called maximum power point tracking or MPPT. MPPT controllers are basically able to convert excess voltage into amperage. This has advantages in a couple of different areas.
Most solar power systems use 12 volt batteries, like you find in cars. (Some use other voltages and the same advantages apply to these systems as well.) Solar panels can deliver far more voltage than is required to charge the batteries. By, in essence, converting the excess voltage into amps, the charge voltage can be kept at an optimal level while the time required to fully charge the batteries is reduced. This allows the solar power system to operate optimally at all times.
Another area that is enhanced by an MPPT charge controller is power loss. Lower voltage in the wires running from the solar panels to the charge controller results in higher energy loss in the wires than higher voltage. With a PWM charge controller used with 12v batteries, the voltage from the solar panel to the charge controller typically has to be 18v. Using an MPPT controller allows much higher voltages in the wires from the panels to the solar charge controller. The MPPT controller then converts the excess voltage into additional amps. By running higher voltage in the wires from the solar panels to the charge controller, power loss in the wires is reduced significantly.
MPPT charge controllers are more expensive that PWM charge controllers, but the advantages are worth the cost. If you can afford it, you should definitely use an MPPT charge controller.
The final function of modern solar charge controllers is preventing reverse-current flow. At night, when solar panels aren’t generating electricity, electricity can actually flow backwards from the batteries through the solar panels, draining the batteries. You’ve worked hard all day using solar power to charge the batteries, you don’t want to waste all that power! The charge controller can detect when no energy is coming from the solar panels and open the circuit, disconnecting the solar panels from the batteries and stopping reverse current flow.