I have a few 12v alarm batteries and i always use them for small projects and never have a proper way to charge them. So i dived in and built my own smart charger controlled by an ATmega328 microcontroller. Simply put the charger starts off with a constant current charge of 250mA depending on the battery size, it is adjustable, then it measures the charging voltage every 10seconds. once the charging voltage becomes 14.1v it switches to constant voltage charge and charges the battery at 14.1v. it then monitors the current going into the battery, once this drops to approximately 10% of the batteries capacity. Once the current drops to this level a relay switches the power to the battery off and it stops charging.
Basically two LM317's are used in series, first a constant current source followed by a constant voltage source. for feedback i have a voltage dividing circuit that is monitored by an analog pin and a 1 ohm resister that is also monitored by an analog pin for current. to switch from constant current to constant voltage i have a transistor that switches on and basically lowers the resistance on the R2 resistor of the constant voltage circuit. another transistor switches the relay on and off.
Here are some pictures, im still going to put it in a nice case and maybe add a fan to cool the heat sink. the heat sink is so huge i dont even think i will need it but i will see.
Thank to everyone that helped me especially CROSSROADS.