PhatFil
Posts: 1342
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

UPS solutions?

Sun Mar 04, 2018 12:35 am

With my Pi project satisfying its initial testing, Installation is now my focus, and i am considering UPS options. And i am more than a little confused.

My perception of a UPS is a box that provides power to important devices and maintains a backup supply, generally a battery to provide sufficient power to enable the important devices to shutdown correctly, and in our case with Pi s not corrupt our system cards. .

However Every solution i come across seems to opperte off batteries which are continually discharged/maintained.

My limited understanding of the batteries generally used LiPo 3.7v cells is that they have a limited number of dischrge/recharge cycles, and if these are exhausted with repeated use, the battery will not last that long. While these cells can sit for quite some time at circa 75% capacity with little detriment?

So It seems that if i adopt a 'standard' pi ups solution the inevitable conclusion is battery failure and loss of service ?

What am i missing??

achrn
Posts: 373
Joined: Wed Feb 13, 2013 1:22 pm

Re: UPS solutions?

Sun Mar 04, 2018 9:32 am

I've never seen a UPS that continually runs down the batteries. Apart from anything else, it would be pretty useless if it's just at the point of hitting minimum charge as the power supply went out.

(Some (indeed, probably all serious ones) periodically run a discharge test for a small portion of their capacity, but I haven't noticed that functionality on a pi.)

Can you provide an example of a Pi UPS that runs the batteries down?

alphanumeric
Posts: 2002
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: UPS solutions?

Sun Mar 04, 2018 9:51 am

There are LIPO Shims etc that will power your Pi from a LIPO Battery. Some will auto shut down the Pi when the battery gets low, some won't. A lot of these small devices won't charge the battery back up though. You need a different separate device for that. Not the way I personally prefer to go. There are devices that will charge the battery, let you run from battery, and let you run from a power supply while it recharges the battery.

Adafruits PowerBoost devices will do that, namely the PowerBoost 500c and 1000c. I have a 1000c in one of my portable projects. I can run my Pi off of the battery, then plug in my power pack and run from that while the battery is recharged. If I unplug my power pack it runs off of the battery. No lose of power to the Pi, providing you don't run the battery down. It won't auto shutdown the Pi but it does have a low battery terminal , that with a bit of work, you could use to do that. Wire it to a GPIO and code up some python etc. I haven't bothered, I have a 6600 MAH battery and only ever run it from battery for an hour or two tops. No where close to draining the battery.
https://www.adafruit.com/product/2465

There is also the https://www.dfrobot.com/product-1613.html It will give you more current than the above but no easy way to auto shut down the Pi.

achrn
Posts: 373
Joined: Wed Feb 13, 2013 1:22 pm

Re: UPS solutions?

Sun Mar 04, 2018 2:23 pm

alphanumeric wrote:
Sun Mar 04, 2018 9:51 am
There are LIPO Shims etc that will power your Pi from a LIPO Battery.
I wouldn't call that a UPS - that's just a battery-driven supply.

alphanumeric
Posts: 2002
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: UPS solutions?

Sun Mar 04, 2018 4:47 pm

achrn wrote:
Sun Mar 04, 2018 2:23 pm
alphanumeric wrote:
Sun Mar 04, 2018 9:51 am
There are LIPO Shims etc that will power your Pi from a LIPO Battery.
I wouldn't call that a UPS - that's just a battery-driven supply.
I wouldn't either. I mentioned it in response to the OP's "However Every solution i come across seems to operate off batteries which are continually discharged/maintained." comment. It all depends on what your looking for and reading the description for the device.

The Adafruit PowerBoost C isn't an ups either, but comes pretty darned close.

PhatFil
Posts: 1342
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: UPS solutions?

Mon Mar 05, 2018 10:45 pm

My google searches have mostly included 'DIY' and perhaps 'low budget' too, And the vast majority of solutions appear to be a case of repurposing battery power banks that allow concurrent charge/discharge..
http://raspi-ups.appspot.com/en/index.jsp

even Pete scargills dogs dinner-> Kitchen sink -> sbc ups solution seems to work in this way too.
https://tech.scargill.net/the-kitchen-sink/

I will admit to not looking too closely at out of the box hats or shims for the job beyond initial checks as the price tags seem a little outrageous.

however after a re-google to insert links to illustrate my point, i finally landed on this which looks like an ideal solution for me..
viewtopic.php?f=37&t=50470
I should have centered my search in here to start with..

User avatar
davidcoton
Posts: 4024
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: UPS solutions?

Mon Mar 05, 2018 11:13 pm

PhatFil wrote:
Mon Mar 05, 2018 10:45 pm
i finally landed on this which looks like an ideal solution for me..
viewtopic.php?f=37&t=50470
Note that the calculation for R1 in the circuits shown on the first page of the linked topic (the 2-cell version) gives the right result for the wrong reason. :o
The correct formula is (5-2*1.25)/C/64, which just happens to be the same because the nominal battery voltage is exactly half the supply voltage. :?
But if you modify anything, beware! :shock: Here be dangerous dragons. :(
Signature retired

PhatFil
Posts: 1342
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: UPS solutions?

Tue Mar 06, 2018 12:30 am

davidcoton wrote:
Mon Mar 05, 2018 11:13 pm
PhatFil wrote:
Mon Mar 05, 2018 10:45 pm
i finally landed on this which looks like an ideal solution for me..
viewtopic.php?f=37&t=50470
Note that the calculation for R1 in the circuits shown on the first page of the linked topic (the 2-cell version) gives the right result for the wrong reason. :o
The correct formula is (5-2*1.25)/C/64, which just happens to be the same because the nominal battery voltage is exactly half the supply voltage. :?
But if you modify anything, beware! :shock: Here be dangerous dragons. :(
Thanks, i will be reading the two related posts fully before commiting anything to the breadboard and testing, But its the sort of solution i was failing to find earlier in my searching. I must have had tunnel browsing vision..

achrn
Posts: 373
Joined: Wed Feb 13, 2013 1:22 pm

Re: UPS solutions?

Tue Mar 06, 2018 8:25 am

PhatFil wrote:
Mon Mar 05, 2018 10:45 pm
My google searches have mostly included 'DIY' and perhaps 'low budget' too, And the vast majority of solutions appear to be a case of repurposing battery power banks that allow concurrent charge/discharge..
http://raspi-ups.appspot.com/en/index.jsp

even Pete scargills dogs dinner-> Kitchen sink -> sbc ups solution seems to work in this way too.
https://tech.scargill.net/the-kitchen-sink/
What makes you think either of those continually discharge the batteries? I've just skimmed down them, but they don't seem to do what you say all (or almost all) the Pi UPS solutions do. All the time there is mains, the battery does nothing (the circuit keeps it topped up). When the mains is lost, the battery supplies the Pi. When the mains returns, the mains supplies the Pi and recharges the battery.

I don't understand what you think these are doing, or what you think they should do. Or maybe I've missed something about how they operate.

mosespi
Posts: 508
Joined: Mon May 12, 2014 3:35 pm
Location: 34,-118
Contact: Website

Re: UPS solutions?

Mon Mar 12, 2018 2:14 am

I have a (primarily) NiMH battery based UPS specifically designed for the Pi:

http://www.allspectrum.com/mopower/

I don't really understand your discharge/recharge/deterioration question. Most all batteries deteriorate over time, and have limited cycle and shelf life. Standard lead, lithium and nickel batteries will last about 2-5 years in service, lithium iron may provide more cycles or longer service life. Each battery type has it's peculiarities. Maybe you are talking abnormal use or bad designs?

Regards,
-Moses
Power problems? MoPower UPS for the Pi
http://www.allspectrum.com/mopower/

alphanumeric
Posts: 2002
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: UPS solutions?

Mon Mar 12, 2018 9:32 am

It may be that the OP doesn't understand the "uninterruptable" part of UPS. And how it actually provides power with no interruption. Why the battery is always being charged from one side of the UPS and simultaneously drained from the other. That's how it works, in simple terms anyway. In your PC UPS its AC to DC (battery charger) then DC (battery) back to AC. If the mains fail it just becomes DC (battery) to AC until the battery runs down.
For the Pi its AC Mains to Battery charger to LIPO battery, then LIPO battery to up converter. If my understanding of how they work is correct, the charger is also feeding the up converter. The battery is just kept fully charged until needed. Wear and tear on the battery is minimal if the power doesn't actually fail.

PingoBags
Posts: 47
Joined: Mon Nov 06, 2017 10:53 pm
Location: NS, Canada

Re: UPS solutions?

Mon Mar 12, 2018 1:07 pm

I'm in the process of making something close to a UPS but not. I didn't want the wear on an inverter running 24/7 just to have no interruption for devices that aren't that crucial. The only interruption I don't want, is to my pi.

Its not fully finished but I have tested it and it works great.
I used 1, 4 channel relay with a pi zero w.
Channel 1 interrupts the the 12v from the deep cycle to the inverter.
Channel 2 and 3 are connected to a single line/outlet, channel 2 is mains power, channel 3 is inverter.
Channel 4 is inverter power only.
That mains/inverter outlet also powers the pi but for that 1 second it's completely off as the transfer happens, I plan on using
2- 100F supercapacitors in series. In my testing, I used lipo batteries.
My plan is to have no drain on my big deep cycle battery or wear on the inverter when not in use and to supply just enough stored energy
to the pi to keep it running until the transfer happens.

To detect mains outage, I took an old 5v/550Mah charger. Made a voltage divider to drop it to 3v and used more resisters to drop the current to about 2mah. When the mains is on, the input pin is high, and low when the power goes out.

mosespi
Posts: 508
Joined: Mon May 12, 2014 3:35 pm
Location: 34,-118
Contact: Website

Re: UPS solutions?

Mon Mar 12, 2018 10:38 pm

PingoBags,

If all you are powering is a Pi.. there is no need for an inverter. A simple diode-OR (look it up) arrangement works pretty well for low power DC applications, no 'physical' switching takes place. Look at the schematic for my UPS in the documentation, it has a similar design.

I think your design is overly complex and might have a few misconceptions.. the inverter being one of them. I'll explain:
I would recommend not using an inverter.. but even if you do, there is very little 'wear' on most solid state electronics, lifetimes of decades are possible and sometimes even expected out of modern well designed electronics.
The relay switching seems unnecessary and along with it the expensive supercapacitors. Diode-OR the DC going to the Pi and be done with it.
You can have a 'no drain' 'big deep cycle' battery by just keeping it at a certain float voltage, or occasionally topping it up. As I mentioned in my previous post almost all batteries have age related wear.. if your big deep cycle is a lead acid battery.. it is essentially metal plates sitting in acid, slowly eating itself up. Whether you use it or not, it will need replacement in a couple of years. Same goes for lithium, they all deteriorate with age.

Unless you want an educational exercise, go simple. I think you can accomplish what you want with much less.. an AC to DC adapter going to a floated (or charger controlled) lead acid battery feeding a diode-OR network to a DC-DC converter powering your Pi. You can tap before the OR diodes to detect a mains failure, no need for extra adapters.

Regards,
-Moses
PingoBags wrote:
Mon Mar 12, 2018 1:07 pm
I'm in the process of making something close to a UPS but not. I didn't want the wear on an inverter running 24/7 just to have no interruption for devices that aren't that crucial. The only interruption I don't want, is to my pi.

Its not fully finished but I have tested it and it works great.
I used 1, 4 channel relay with a pi zero w.
Channel 1 interrupts the the 12v from the deep cycle to the inverter.
Channel 2 and 3 are connected to a single line/outlet, channel 2 is mains power, channel 3 is inverter.
Channel 4 is inverter power only.
That mains/inverter outlet also powers the pi but for that 1 second it's completely off as the transfer happens, I plan on using
2- 100F supercapacitors in series. In my testing, I used lipo batteries.
My plan is to have no drain on my big deep cycle battery or wear on the inverter when not in use and to supply just enough stored energy
to the pi to keep it running until the transfer happens.

To detect mains outage, I took an old 5v/550Mah charger. Made a voltage divider to drop it to 3v and used more resisters to drop the current to about 2mah. When the mains is on, the input pin is high, and low when the power goes out.
Power problems? MoPower UPS for the Pi
http://www.allspectrum.com/mopower/

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

Re: UPS solutions?

Mon Mar 12, 2018 11:34 pm

alphanumeric wrote:
Mon Mar 12, 2018 9:32 am
It may be that the OP doesn't understand the "uninterruptable" part of UPS. And how it actually provides power with no interruption. Why the battery is always being charged from one side of the UPS and simultaneously drained from the other. That's how it works, in simple terms anyway. In your PC UPS its AC to DC (battery charger) then DC (battery) back to AC. If the mains fail it just becomes DC (battery) to AC until the battery runs down.
For the Pi its AC Mains to Battery charger to LIPO battery, then LIPO battery to up converter. If my understanding of how they work is correct, the charger is also feeding the up converter. The battery is just kept fully charged until needed. Wear and tear on the battery is minimal if the power doesn't actually fail.
You've got one thing wrong there; in a commercial UPS designed for keeping your computer or other electronic equipment online, the battery is charged while AC is available and discharged when AC is lost, that is true, but while AC is available the battery is NOT used, instead the AC is passed through and switches to the fallback (the battery) only when power is lost. While AC is present, the battery is not used at all.
55:55:44:44:4C
52:4C:52:42:41

User avatar
davidcoton
Posts: 4024
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: UPS solutions?

Mon Mar 12, 2018 11:56 pm

Imperf3kt wrote:
Mon Mar 12, 2018 11:34 pm
You've got one thing wrong there; in a commercial UPS designed for keeping your computer or other electronic equipment online, the battery is charged while AC is available and discharged when AC is lost, that is true, but while AC is available the battery is NOT used, instead the AC is passed through and switches to the fallback (the battery) only when power is lost. While AC is present, the battery is not used at all.
There are two types of UPS.

One (less expensive) works as you describe, using a relay to switch over -- I've had cases where the switchover is too slow and PCs running heavy computations crash during switchover (they are OK using the test button, but the total time to detect mains failure and switch is too long).

The other type, sometimes called "online" UPSs, convert all the power to battery voltage and then back through the inverter, even when mains is available. This eliminates problems at switchover, at the cost of a much bigger DC power supply. It is still true to say that the battery is not used (discharged) while mains power is available, since the DC derived from the mains is enough to maintain the inverter load and float charge the battery.
Signature retired

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

Re: UPS solutions?

Tue Mar 13, 2018 12:41 am

Ah yeah, forgot about the 'online' type UPS. Don't they have the disadvantage of wearing out faster?
55:55:44:44:4C
52:4C:52:42:41

User avatar
davidcoton
Posts: 4024
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: UPS solutions?

Tue Mar 13, 2018 8:39 am

Imperf3kt wrote:
Tue Mar 13, 2018 12:41 am
Ah yeah, forgot about the 'online' type UPS. Don't they have the disadvantage of wearing out faster?
I don't have any data on that. There is no intrinsic reason why they should, indeed the most vulnerable component is probably the mechanical relay that is removed from the online design. The battery and inverter are (in concept) identical, as is the battery charge regime. The only other difference is the much beefier DC PSU. The DC PSU and inverter both work 24/7, so they are working harder. The inverter of an online UPS is under constant conditions rather than on/off, which should if anything improve reliability. Any UPS must be properly designed for its internal operating temperature -- capacitors at elevated tremperature can be less reliable.
Signature retired

alphanumeric
Posts: 2002
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: UPS solutions?

Tue Mar 13, 2018 9:36 am

We had a SUPU, uninterruptable power unit at a radar site I was a maintenance tech at. Three phase AC mains feed the charger. It charged a large bank of lead acid batteries, 400+ volts DC on the BUS. I'm not talking car batteries either, these were each about four times the size. Twenty or thirty or so batteries, I forget how many there were. Then a separate inverter on the other side to get you your 3 phase AC mains back that fed the Radar. The charger and inverter were two separate units each as big as about two phone booths. 30 minute run time. It just needs to run long enough for the 40 kw diesel generator to start up and feed it power. It was never off or out of the circuit except for routine maintenance.

PingoBags
Posts: 47
Joined: Mon Nov 06, 2017 10:53 pm
Location: NS, Canada

Re: UPS solutions?

Wed Mar 14, 2018 12:20 am

@mosespi
No, the system is to power some 120v low watt lights, a 120v 100 watt water heater, small water pump and a few other devices.

I was just saying that the pi is also powered from the same system but I need to power it when the switch from mains to inverter happens.
I don't need nor want the inverter running 24/7 when it's only going to be used about 10 times a year.

The reason I wanted to use supercaps and not lipos is because I read that caps still function at lower temps.
I know from personal experience that lipos will stop working when they get too cold, not even that cold really.
This system is outside and everything freezes here in Canada during winter.
I'm still not 100% set on using caps though. Maybe the little heat from the pi would be enough to keep them going.
I think your design is overly complex and might have a few misconceptions
I tried making it as simple as I could. But if you're thinking I'm only designing it to power a pi, then I see your point.

mosespi
Posts: 508
Joined: Mon May 12, 2014 3:35 pm
Location: 34,-118
Contact: Website

Re: UPS solutions?

Thu Mar 15, 2018 5:53 am

PingoBags,

Indeed if you need AC power as well, it does change things. What I think you are building is essentially a standard offline UPS (one that 'switches' over to the inverter when power fails). I don't believe such a UPS will wear out the battery or inverter without it being used. I have an older commercial one running from a large lead acid battery, never gives me any trouble, and we get a fair bit of wind related power disturbances at certain times of the year. Commercial UPSs switch quickly enough that I don't think you will have trouble keeping a Pi (which is also buffered by it's AC-DC wall-wart and it's capacitor BTW) running during the switch-over. One comment.. I would not use a multitasking OS for timing sensitive 'interrupt' routines, best go with a microcontroller or at least a real time OS.

Bad things happen to lithium batteries when charged below freezing, but a fully charged lead acid battery survives cold conditions pretty well, as evidenced by car batteries. And it's probably still the least expensive battery for stationary backup purposes, although a bit on the heavy side.

Regards,
-Moses
PingoBags wrote:
Wed Mar 14, 2018 12:20 am
@mosespi
No, the system is to power some 120v low watt lights, a 120v 100 watt water heater, small water pump and a few other devices.

I was just saying that the pi is also powered from the same system but I need to power it when the switch from mains to inverter happens.
I don't need nor want the inverter running 24/7 when it's only going to be used about 10 times a year.

The reason I wanted to use supercaps and not lipos is because I read that caps still function at lower temps.
I know from personal experience that lipos will stop working when they get too cold, not even that cold really.
This system is outside and everything freezes here in Canada during winter.
I'm still not 100% set on using caps though. Maybe the little heat from the pi would be enough to keep them going.
I think your design is overly complex and might have a few misconceptions
I tried making it as simple as I could. But if you're thinking I'm only designing it to power a pi, then I see your point.
Power problems? MoPower UPS for the Pi
http://www.allspectrum.com/mopower/

PingoBags
Posts: 47
Joined: Mon Nov 06, 2017 10:53 pm
Location: NS, Canada

Re: UPS solutions?

Thu Mar 15, 2018 11:32 am

mosespi,
That's a good point about the commercial UPSs switching quickly enough. I thought about changing the timing in my script for that reason.
If I did leave the inverter on, it might be doable. But I'm not that comfortable doing it. The inverter and mains, power the same plug, only separated by a ssr which has some leakage.
Another thing I considered doing is using the deep cycle to power the pi. The inverter has a usb port that works even when the inverter is switched off.
I could just connect the inverters on/off switch to the relay directly.

I might be able to keep a lipo warm enough though. My other pi is also outside, doing basically the same thing but without a battery backup/inverter.
I have it enclosed in a material called kerdi board. I made a win app that read the pi logs ambient temp, water temp and also shows me the pi temp.
Even when it's -25c or colder outside, the pi is always above freezing. I know the battery wouldn't be at the same temp as the pi but it might just be enough.

mosespi
Posts: 508
Joined: Mon May 12, 2014 3:35 pm
Location: 34,-118
Contact: Website

Re: UPS solutions?

Sat Mar 17, 2018 8:10 am

PingoBags,

I can see it keeping a bit above ambient if it's well insulated. If needed an additional 1 or 2 watt resistor should keep things pretty warm too in the cold months for lithium charging. You likely won't be charging when the power is out, so no need to power the resistor when the power has failed. Probably best if the charging circuit checked the temperature in case power came back up after a hard freeze. If the Pi was more of a power hog under full load, I would just mine some bitcoin or something for heat when the weather is cold, but it's not!

Regards,
-Moses
PingoBags wrote:
Thu Mar 15, 2018 11:32 am
mosespi,
That's a good point about the commercial UPSs switching quickly enough. I thought about changing the timing in my script for that reason.
If I did leave the inverter on, it might be doable. But I'm not that comfortable doing it. The inverter and mains, power the same plug, only separated by a ssr which has some leakage.
Another thing I considered doing is using the deep cycle to power the pi. The inverter has a usb port that works even when the inverter is switched off.
I could just connect the inverters on/off switch to the relay directly.

I might be able to keep a lipo warm enough though. My other pi is also outside, doing basically the same thing but without a battery backup/inverter.
I have it enclosed in a material called kerdi board. I made a win app that read the pi logs ambient temp, water temp and also shows me the pi temp.
Even when it's -25c or colder outside, the pi is always above freezing. I know the battery wouldn't be at the same temp as the pi but it might just be enough.
Power problems? MoPower UPS for the Pi
http://www.allspectrum.com/mopower/

Return to “General discussion”