# DIY uninterruptable power supply (UPS) for Raspberry Pi Zero with power supply selector

Foreknowledge: This post is the extension of a previous post (DIY uninterruptable power supply (UPS) for Raspberry Pi Zero), but due to the community rules I ask it as a new separate question. It is good to read the previous post.

I have several pi-zero boards and I utilize them to monitor environmental conditions (such as humidity, temperature and intrusion) of each room in home.

For continuous operation, I want to eliminate power blackouts. So, I decided to make a basic UPS for pi-zero boards. (need to be as small as possible)

I can not use combo boards of battery charger and booster, because they are expensive and hard to collect (for me).

Here is my new design: The relay selects the power supply dynamically depending on the status of the main power supply (which is AC/DC adapter).

• AC/DC adapter powers the battery charger and the relay coil.
• Also the adapter's (+) output pin (named as V1) is connected to the relay's normally open (NO) pin.
• The battery charger charges the 3.7V battery.
• Also the charger's (+) output pin (named as V2) is connected to the relay's normally closed (NC) pin.
• The relay's common (COM) pin is connected to the step-up converter's (+) input pin.
• The pi-zero is powered with the output of the step-up converter.

My questions are;

1. Is there any unsafe point similar to the issue stated in the previous post?
2. Even the relay is not driven by any NPN or PNP transistor, is it required to connect a diode to the relay coil in parallel?
3. What kind of capacitor should be connected to the load in parallel to prevent momentarily power cuts at power supply changes?

• This is an EE question, which is unrelated to the Pi. You may get opinions, but no answers. Ask on the EE site. My opinion (as an EE) is that you don't use relays in UPS. This is also an XY problem . You are asking about your misguided solution, not your problem. – Milliways Mar 22 '17 at 22:58
• @Milliways, yes are right about the XY problem thing; but I don't get what you mean by misguided solution. Line interactive UPSs utilize one or more relay contacts. – vaha Mar 27 '17 at 20:02
• Just for the record, I was referring to the capacitor you asked about. Your circuit would charge this to 5V, then switch the charged capacitor to the battery! – Milliways Mar 27 '17 at 22:58
• @Milliways, I got it. Then I connect the capacitor to the output of the step up converter (always 5V) in parallel, LOL. – vaha Mar 28 '17 at 8:04
• You can't order something like the Zero Lipo? If you can order all the other boards, you most likely can acquire one of those rpi ups boards. – Jeroen3 Jul 25 '17 at 9:08