Are the batteries arranged in series like your drawing shows? If
If so your discharged voltage will be around 15V and your charged voltagevoltages will be about 16.8V (1.25V/cell discharged, 1.4V/cell charged).
- ~15V (1.25V/cell discharged - reference Roomba chargers)
- ~16.8V (1.4V/cell charged)
LM317 reference is 1.25V across the 68 ohm resistor for charge current of (1.25/68) 18mA charge current. Dropout voltage on the LM317 is for that rate is never more than 2V (page 6 from the datasheet tyblu linked to, very conservative estimate).So minimum input voltage needs to be (conservatively) 2V + 1.25V + 16.8v = 20.05V
How did you choose the value for the resistor? A safe charge rate (if you're watching it to turn it off) is C/10 which should be (100-mAh/10) 100mA charge current. That gives a resistor value of (1.25V/.1A) 12.5 ohms with power rating of (.1^2*12.5) .125W. Are these 12 cells in series or parallel?