1
\$\begingroup\$

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?

Power Supply Selector Circuit

\$\endgroup\$

migrated from raspberrypi.stackexchange.com Mar 22 '17 at 23:46

This question came from our site for users and developers of hardware and software for Raspberry Pi.

  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – Milliways Mar 22 '17 at 22:58
  • 1
    \$\begingroup\$ @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. \$\endgroup\$ – vaha Mar 27 '17 at 20:02
  • \$\begingroup\$ 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! \$\endgroup\$ – Milliways Mar 27 '17 at 22:58
  • \$\begingroup\$ @Milliways, I got it. Then I connect the capacitor to the output of the step up converter (always 5V) in parallel, LOL. \$\endgroup\$ – vaha Mar 28 '17 at 8:04
  • \$\begingroup\$ 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. \$\endgroup\$ – Jeroen3 Jul 25 '17 at 9:08
2
\$\begingroup\$

Why not use couple of relays? While power is available, charge the power pack and power the Pi, and when it's out - power Pi from the power bank. I've made a similar setup for my dashcam: http://blog.nagimov.com/uninterruptible-5v-usb-power-supply

enter image description here

\$\endgroup\$
  • \$\begingroup\$ While this may answer the question, please note that promoting your site in posts here, without disclosing your affiliation in the post, is prohibited, and is subject to removal as spam. \$\endgroup\$ – gparyani Mar 1 '18 at 14:21
  • 2
    \$\begingroup\$ Affliation is very clear. And the image shows most of what's needed. Its a little odd, but.... eh... its actually kinda neat in a davecad kinda way. \$\endgroup\$ – Journeyman Geek Mar 1 '18 at 14:24
2
\$\begingroup\$

Instead of the relay I would use a p-channel MOS-FET with a pull-down resistor, because it's probably cheaper, smaller and faster than the relay. Also the charging board you are showing does not have any explicit battery protection, so unless your battery has some circuitry on it, I would not recommend using it. There are also boards with the TP4056 that have said protection and also a separate output for your load.

Since I already went through all this trouble designing my own UPS circuit for Raspberry Pi's I recommend checking out my Instructables on it. There I have the full schematic and a video, where I explain everything and how the circuit works. But here is the schematic: enter image description here

\$\endgroup\$
  • \$\begingroup\$ The charging board is TP4056 in the schema, its image is just misleading. Also, I would be happy, if you could explain how to replace the relay with a p-channel MOSFET by stating the connection points. Thanks. \$\endgroup\$ – vaha Mar 23 '18 at 21:04
  • \$\begingroup\$ @vaha if you you look at your schematic drain should connect to v2, source to the step-up converter and gate to the 5V input with a 10k resistor to ground. Then you also need a diode that goes from the 5V input to the step-up converter bridging the MOSFET. The same as in the part "Voltage source selector" in my schematic. \$\endgroup\$ – enwi Mar 24 '18 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.