Where would a charge controller be placed when solar energy is used? Is it on the roof, on the outside of the house, where exactly?

And where do the batteries go?