Electronic – Is either of the following circuits usable as a minimalist UPS

batteriesraspberry piups

I have been working on a NAS server, which I want to run on a Raspberry Pi 4, but I already got the SD card corrupted once by interrupting power to it when it wasn't shut down properly. I then thought that the same thing could happen in the case of a power outage so naturally I decided to make a UPS for it.

I have looked at several designs on the internet but they all seemed way too complicated for my purpose, so I started thinking how a minimalist UPS could be made and came up with two solutions.

Given, however, that I am only a hobbyist I thought it would be wise to ask someone with a deeper understandin of electronics about whether any of these circuits would function before even trying to build one of them. So here I am writing this post.

Schematic 1

In this first one I want to use a two relay relay board (such as this) as a DPDT switch to switch between the power supply and the battery. The idea here is that when the power supply goes out it unpowers the coils in the relays and thus switches them to their NC state, where the battery is connected (the power supply is connected to the NO terminals.)

The capacitor is there to supply the Pi with power until the switching happens (I don't know how many miliseconds it takes so I went with a 1F cap, the largest one I currently have at hand.) This is intended to work with a li-ion cell, thus a step up converter (set to 5V) is used. I would probably add a fuse (5-7A) to the battery too, just in case something went wrong.

The battery charger is meant to be turned on manually, though I might decide to automate it later with the help of an Arduino, which would monitor the battery voltage, too.

Here my question is whether this would work in practice as well as it does in theory or not? Also is there need for a diode anywhere? Could the capacitor cause some nasty backfeeding issues when the supplies are switched?

Schematic 2

Here the idea is that the power supply is set to the float voltage of the used lead-acid battery and a step-down converter brings its voltage down to 5V for the Pi. If the power is disconnected the battery should in theory just take its place. If I decided to use this one I would probably add an Arduino here too to monitor the battery voltage. Would this work in practice?

In fact would either of these two circuits work in practice? And if they did are they a good solution or should I be looking for a different, more complex one?

Best Answer

The second solution with lead acid would be the easiest solution, bare in mind that lead acid need to be refreshed after deep discharge, and maintenance charged.

Li-ion need extra care when charging and discharing, at least least dubble protection for OVP and over current i recommended preferable with a hard fuse aswell. Besides the charging circuit. Temperature monitioring is usually common to make sure the Li-ion doesn't get over heated and explode. Low temperature is probably not a problem in your case but it should be monitored as well otherwise.

For automation between UPS and line you could just use simple diodes and keep the charging always on for the battery and the Boost converter on as well with a lowever set voltage than the input.

You can also have circuit that charges the battery while also supplying the system, like a boost converter that supplies the rest of the circuit.