I'm sure someone else also will have a need for UPS for the Raspberry Pi in their intended use, so I thought to share this idea.

So what it is and what it does?

This circuit uses the LM317s to limit the voltage and current for charging the battery wired to it's output. It charges battery at a set current untill a set voltage is reached, after that it starts to limit the current so that voltage doesn't rise anymore (CC/CV charging, suitable for li- and lead batteries).

Values for resistors are calculated using the following formulas:

R1= 1,25/Maximum amperes (in A)

R2= (96 x output voltage) - 120

C1 could be around 1uF and C2 ~10uF when using 1A max currents (it works without these, but may shorten the life expectancy of your battery).

For R1 use 5W resistor, R2 can be 1/4W.

It has it's limitations (max ~1,5A, Watts are wasted, system load needs to be roughly known...) but it's cheap 'n simple, maybe even something that could be assembled by students themselves.