The DC voltage is connected to the Vin of the LM317 in between we have connected the capacitors will be opened but if it had any AC noise it will remove it.
The Vout of the LM317 is given to the battery which is to be charged, pin1Adjustment pin of the LM317 is connected to the transistor Q1, Resistor R1, R2, R5 which will help to adjust the regulator.
The output of regulated voltage and current is controlled by the transistor Q1, resistor R1 and R2 and potentiometer R5.potentiometer which is used to set the charging current. Resistor R2 will have more current when the battery is getting charged. This will help to conduct the transistor Q1. The conduction of Q1 will help to adjust the voltage of LM317.
TRICKLE CHARGE MODE: in this mode if the battery is charged the reverse current will flow. If the LED has glown then we can say that battery is charged. The diode D2 will protect the LM317 from the reverse current. When the battery is fully charged it will reduce the charge current. If the charge current the transistor will get off so the voltage regulator cannot be adjusted.