As you can see in this schematic circuit this battery charger has extreme few components, but is doing a very good job. When power is applied to the circuit the SCR1 is off, so there is no bias-current path to ground. The LM317 is connected to the battery through diode D1, limiting resistor R1, and bias resistor R2. The D1 diode is used to preve
nt the battery from discharging through the LED and the SCR when power is removed from the circuit. When LED1 is on, the circuit is in the voltage-regulating mode and when LED1 is off, the circuit is in the current-regulating mode.