You need to build a charge controller circuit. The skill level involved is moderate to advanced, depending on how much adaptation is required. If you want a circuit diagram, search for "free schematics" online and start digging.