radioactive321
Posts: 3
Joined: Thu Oct 17, 2019 9:23 am

Use battery as a back-up when main power goes down

Fri Oct 18, 2019 7:31 am

Hi all,

I wanted to ask about a way which I can use a battery as a backup if the main power goes down?

And Second question how large should the battery be to keep it lets say up to 24 hours for a Raspberry Pi 4


Thank You in Advance

deepo
Posts: 697
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: Use battery as a back-up when main power goes down

Fri Oct 18, 2019 9:38 am

A really simple solution would be to get a power bank, and power your RPi from that, and then connect a charger to the power bank.
Edit: See below

This page lists power consumption of RPi's:
https://www.pidramble.com/wiki/benchmar ... onsumption

Example: RPi 3B+ at idle: 350 mA
24 h * 350 mA = 8400 mAh
But I guess you can't get all power out of such a power bank so go for double and get a 16000 mAh power bank or even larger.

/Mogens
Last edited by deepo on Fri Oct 18, 2019 9:13 pm, edited 1 time in total.

User avatar
B.Goode
Posts: 11168
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Use battery as a back-up when main power goes down

Fri Oct 18, 2019 10:17 am

A commercially available solution:
https://uk.pi-supply.com/products/pijuice-standard


The Raspberry Pi people have their own documentation regarding power requirements: https://www.raspberrypi.org/documentati ... /#pi-power

renice123
Posts: 290
Joined: Tue Oct 15, 2019 3:56 pm

Re: Use battery as a back-up when main power goes down

Fri Oct 18, 2019 12:03 pm

Autonomous power supplies for computers are a headache. Of all that I saw, I liked the solution from http://www.mini-box.com/OpenUPS
But there are many such boards and you need to check how well they work.
Rpi4 does not consume a lot of current in the “normal” mode, but it should be borne in mind that after switching to stand-alone power, computers should “lose power”, for example, twice. Unfortunately, I do not yet know how to do this effectively with Rpi4, but several solutions were proposed for RPi 3B + that would greatly reduce consumption (turning off wi-fi, even usb, working at a lower processor frequency, etc.). I suspect that Rpi4 may also work with low current consumption.
I would categorically not buy Chinese uninterruptible power supplies. As a rule, in such devices there are no controllers monitoring the work, balancing for recharging and low quality of elements and simple circuitry.
Since it is planned to work with a capacious battery, you should carefully approach the choice of equipment - lithium power sources are by no means

drgeoff
Posts: 11486
Joined: Wed Jan 25, 2012 6:39 pm

Re: Use battery as a back-up when main power goes down

Fri Oct 18, 2019 5:09 pm

deepo wrote:
Fri Oct 18, 2019 9:38 am
A really simple solution would be to get a power bank, and power your RPi from that, and then connect a charger to the power bank.
/Mogens
Er, no.

Many, possibly the majority of, USB powerbanks cannot be charged and supply power at the same time. (They have one chip which does both the charging function and the conversion of cell voltage to 5 volts output, but only one of those at a time.)

Many, possibly the majority of, such powerbanks' adverts and outer packaging make no mention of that. If stated at all it will almost always only be on the instruction slip inside the packaging and you don't see that until after you have made the purchase.
Quis custodiet ipsos custodes?

Andyroo

Re: Use battery as a back-up when main power goes down

Fri Oct 18, 2019 6:36 pm

The other drawback of powerbanks is that some of them drop power when they switch between live and battery...

Often that’s not mentioned in any document :o and to be fair it’s not a requirement for a power bank.

deepo
Posts: 697
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: Use battery as a back-up when main power goes down

Fri Oct 18, 2019 9:13 pm

OK, sorry - bad idea.

/Mogens

klricks
Posts: 7532
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Use battery as a back-up when main power goes down

Fri Oct 18, 2019 10:14 pm

jcyr wrote:
Fri Oct 18, 2019 9:28 pm
deepo wrote:
Fri Oct 18, 2019 9:13 pm
OK, sorry - bad idea.

/Mogens
Actually, not such a bad idea.

This one will do what you need, if 2.1 amp 5 volt output is enough:

https://www.amazon.com/dp/B01K702S66
I don't think this is a good choice. The first 2 Q&A says the unit cannot charge itself and run a device at the same time and there is a 2 second outage when AC power is removed.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

Andyroo

Re: Use battery as a back-up when main power goes down

Fri Oct 18, 2019 11:20 pm

Go either with a real UPS solution or the PiJuice solution.

If the task is so vital you need it running with no power then why scrimp in the core requirement?

Power banks are really designed for charging phones - there are many many posts here about not using mains based chargers for day to day power why should this be any different?

User avatar
Imperf3kt
Posts: 4218
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia
Contact: Twitter

Re: Use battery as a back-up when main power goes down

Sun Oct 20, 2019 10:33 pm

Allow me to point out the obvious that has eluded everybody; the Pi isn't the only thing that requires power. Unless your monitor works on magic blue smoke or equivalent alternative, you're going to need to power it as well.
Do you want internet? Your modem will need magic blue smoke also.

Speak to your local computer store about a UPS and forget about using it for 24hours...
55:55:44:44:4C
52:4C:52:42:41

Rose tinted glasses are difficult to see through.

User avatar
neilgl
Posts: 2662
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near The National Museum of Computing

Re: Use battery as a back-up when main power goes down

Mon Oct 21, 2019 11:15 am

I an using a UPS to power a pi3 and a modem/router for my pi running 24/7.
It is a "Back-UPS 700" from APC by Schneider Electric. It has 4 mains outlets that are battery backed.
However, when power goes out it only runs my gear for about an hour, so you may need a bigger one.

jbudd
Posts: 1641
Joined: Mon Dec 16, 2013 10:23 am

Re: Use battery as a back-up when main power goes down

Mon Oct 21, 2019 12:49 pm

A battery backup has to:

1 Switch from mains to battery power with no downtime.
2 Switch from battery power to mains with no downtime.
3 Tell the Pi to shutdown when battery is low.
4 If the battery is exhausted, reboot the Pi when mains comes back.
5 Provide stable 5V output.

Some power packs can do 1 and 2
Cheap UPS solutions can't do 3 (?)
The PiJuice can do all 5.

User avatar
neilgl
Posts: 2662
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near The National Museum of Computing

Re: Use battery as a back-up when main power goes down

Mon Oct 21, 2019 4:34 pm

Yes for (3) my cheapish UPS has a USB output for the status, remaining battery charge, power consumption, etc. but that is Windows only. One day I will write a script on the pi to check it and shutdown pi gracefully if needed.
And that PiJuice with a 12000mAh extra battery looks good for powering just the pi.

pfletch101
Posts: 634
Joined: Sat Feb 24, 2018 4:09 am
Location: Buffalo, NY, USA

Re: Use battery as a back-up when main power goes down

Tue Oct 22, 2019 12:48 am

neilgl wrote:
Mon Oct 21, 2019 11:15 am
I an using a UPS to power a pi3 and a modem/router for my pi running 24/7.
It is a "Back-UPS 700" from APC by Schneider Electric. It has 4 mains outlets that are battery backed.
However, when power goes out it only runs my gear for about an hour, so you may need a bigger one.
Your modem/router is almost certainly drawing more power than your Pi, but I think that a bigger problem may well be that the circuitry of these UPSes is designed for maximum efficiency at 25-75% of their rated load. I suspect that a lot of battery power is wasted in the inverter circuitry when they are powering a load which is only drawing a small fraction of their rating. I don't have a better solution - my 'workhorse' Pi is on a similar UPS, which also supports my main Windows system. The latter gets shut down reasonably quickly if it is on and the power fails, and we don't (fortunately) tend to have frequent, long, outages here, so I have never had to find out how long the Pi will be supported.

W. H. Heydt
Posts: 14375
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Use battery as a back-up when main power goes down

Tue Oct 22, 2019 5:06 am

neilgl wrote:
Mon Oct 21, 2019 11:15 am
I an using a UPS to power a pi3 and a modem/router for my pi running 24/7.
It is a "Back-UPS 700" from APC by Schneider Electric. It has 4 mains outlets that are battery backed.
However, when power goes out it only runs my gear for about an hour, so you may need a bigger one.
I pretty much default to 1.5KVA UPSes, though for a couple of cases dedicated to Pis, I use much smaller ones, 350VA.

On the general topic of UPS ratings. The manufacturers are--implicitly--lying to you. The ratings are in "volt-amperes". For AC power, that is not the same as Watts. You have multiply by about 0.7 to get the equivalent wattage figure (it's a Root Mean Square--RMS--thing). So a 1KVA UPS should handle about 700W. If you check the ratings carefully, it will be somewhat less than that.

The biggest capacity issue I see is that once you get past 1.5KVA, the prices skyrocket. However, a Pi, monitor, router and possibly a switch doesn't draw a lot of power. At lest, not compared to, say, a gaming PC.

W. H. Heydt
Posts: 14375
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Use battery as a back-up when main power goes down

Tue Oct 22, 2019 5:11 am

pfletch101 wrote:
Tue Oct 22, 2019 12:48 am
neilgl wrote:
Mon Oct 21, 2019 11:15 am
I an using a UPS to power a pi3 and a modem/router for my pi running 24/7.
It is a "Back-UPS 700" from APC by Schneider Electric. It has 4 mains outlets that are battery backed.
However, when power goes out it only runs my gear for about an hour, so you may need a bigger one.
Your modem/router is almost certainly drawing more power than your Pi, but I think that a bigger problem may well be that the circuitry of these UPSes is designed for maximum efficiency at 25-75% of their rated load. I suspect that a lot of battery power is wasted in the inverter circuitry when they are powering a load which is only drawing a small fraction of their rating. I don't have a better solution - my 'workhorse' Pi is on a similar UPS, which also supports my main Windows system. The latter gets shut down reasonably quickly if it is on and the power fails, and we don't (fortunately) tend to have frequent, long, outages here, so I have never had to find out how long the Pi will be supported.
I have a 1KVA UPS that I bought in the mid-1980s, back when they were comparatively rare and comparatively expensive. It uses 2 30AH sealed lead-acid batteries in series. During a power outage I was running it with just a desk lamp attached. At the time, it was using a CFL bulb of about 20W. After 5 hours of this, my wife and I decided to just shut it off and turn in. The UPS was still going strong. That's probably about the same power a PI plus PSU would draw.

Return to “Troubleshooting”