charging the battery

Recharging can be done either manually - by a switch that can reverse the connections (I do not remember its name, but is used to reverse the motors) or automatically:
a) detection of lower voltage module
b) electronic switch module
c) power supply unit.

I think one may want to use LiIon units. Then is is very handy to look into their datasheets. For instance, this one: