Low cost power switchover device
Total parts cost is about $16 for the circuit with switcher supply and $18 for a gel-cel battery. I have been able to buy the gel-cel for $100 for 10 of them using Amazon. Perhaps you can replace the gel-cel in one of your UPSs and use it's old gel-cel for this circuit.
This schematic at the bottom of this page shows a simple battery floater circuit and switchover to power a USB power supply. The purpose of this is to keep the Raspberry PI up through power drop-outs and while moving the network cabinet. A 4 amp gel cell should run the raspberry PI for several hours or more. With my circuit it would take a day or more to recover the battery after a couple of hours of outage. That's ok because I don't expect to be on battery very often.
The resistor should be such that even if the battery was a dead short, it wouldn't draw enough power to hurt anything. I figured about 200 ohms was good. Anything above 200 up to 1k is probably adequate but 200 is a good lower limit. 200 ohms will get you about 70mA of current flow even if the battery were shorted. 70mA at 14v is about 1 watt of power so you need at least 1 watt of resistor rating. I took several 3.3Kohm 1/4watt resistors and used them in parallel. Larger resistor values will cause the gel cel to charge slower but will also generate less heat.
My later implementation uses a 50 ohm power-resistor with 10 watts rating.
Important: The voltage from the main power supply should be 14.2v, not 13 as shown, because at 13.8 the float voltage at the gel-cel wasn't high enough.
The schematic needed 3 diodes. The nice thing about the bridge rectifier is that it gave me the diodes I needed in a single package and it had a screw mounting hole. I mounted the bridge to the wooden wall of my cabinet. If you get a bridge rectifier with 1 amp diodes or larger, this is fine.
This 12v to USB supply device is available for $15 on Amazon.
The description is
"DC-DC DROK Power Supply Module LM2596"
Here is a link to the device with plastic box which was available in early Oct 2019:
The USB supply is multi-purpose and we only need it as a power supply. The right hand multi-turn pot is used to limit the current output. You'd use the current limit if running the device in the capacity of a battery charger. The multi-purpose display can show the current and, I think, the charge current limit. In our application we do not use the right hand blue power terminals. Plug the Raspberry PI into the USB socket on the buck converter device.
|These power sources output to a USB socket. You will need a USB A to micro-B cable to connect from the USB socket to your Raspberry PI (or USB C cable for Raspberry PI 4B or later). I recommend a very short cable if you can get away with it. 6 inches is a good length if it fits in your chassis. Stay away from 3 foot and 6 foot cables unless you can't help it. In that case, make sure the power conductor in the cable is 24 gauge or under (smaller is bigger). Otherwise you'll lose too much voltage and the Raspberry PI won't like it. If you see a lightning bolt during boot, you are under-volts.|
The Bridge rectifiers come from Parts-Express and are 400V 6A Bridge Rectifier -- Part # 050-030
The resistors (I usually buy them in quantity and keep some in stock) come from Parts-Express and are 47 Ohm 10W Resistor Wire Wound 5% Tolerance -- Part # 016-47
The gel cells I've used so far run from 2 to 4.5 amp-hour. Here is my favorite model because it fits in the housings we've been using:
Parts Express has Power-Sonic PS-1220 Sealed Lead Acid Battery 12V 2.5Ah -- Part # 140-360
Below is shown with a short micro USB cable attached.
Make sure you adjust the output voltage to 5.2 or so before plugging in the Raspberry PI. You'll power up the system by attaching the red/black powerpole to the 12v source, then click the right and left buttons on the DROK until it shows the 12v and the right red LED near the button closest to the output terminals is on telling you that you are measuring the output voltage. Now adjust the multi-turn pot closer to the INPUT terminals counterclockwise about 8 turns maybe. The voltage won't drop for several turns and then it moves quickly.
Now you should be able to put a current meter across the orange powerpole pins and watch the current flow into the battery. If you then unplug the main supply you should see power coming from the battery.
Click to Embiggen