R4 needs to be in series with the LM317 output to limit the current.
Note that using the transistor base-emitter voltage as a reference to stop the charge, gives about a 0.3%/°C change in that voltage.
Better to use a programmable reference, such as the 1.25V TLV431.
Note that using the transistor base-emitter voltage as a reference to stop the charge, gives about a 0.3%/°C change in that voltage.
Better to use a programmable reference, such as the 1.25V TLV431.



