This article is from the Misc Bicycles FAQs, by various authors.
Unless you know how to build electronic circuits, buy the Radio Shack
battery charger. Attach another 2-pin male connector to the end of the
wire from the charger. Remember that the POSITIVE terminal from the
charger should go to the smaller pin on the plug. For the battery that
I used, the charger should put out 14.4V @ 0.6 A .
If you know what you are doing, I suggest using an LM317 adjustable
regulator and following the circuits given the the National
Semiconductor "Linear Components Data Book" . These is one circuit
that uses an NPN transistor in the adjustment leg of the regulator
to limit the current. This circuit works quite well. Also, it is
important to put in all the protection diodes that the applications
notes recommend since it is very easy to connect the battery to the
charger without the charger connected to AC power. This will back
bias the regulator and destroy it.