cr0n
Posts: 9
Joined: Wed Feb 25, 2015 9:50 pm

Protection against short (<1s) voltage drops?

Tue Sep 04, 2018 8:43 pm

Hi,

I use my Pi for temperature/humidity monitoring in my flat. Works perfectly though. The only problem is, that the filesystem crashes and gets destroyed every few months (something between 5 and 8 month). The actual symptom is that the filesystem suddenly gets read-only while the Pi is still running. After a reboot the filesystem check shows several errors that can't be fixed, preventing the Pi from booting.

I found out that this happens exactly whenever the lights in my flat flicker for less than a second (which rarely happens, as well). That's enough correlation for me to try some protection against <1s voltage drops in the power grid.

To begin I would like to find some ideas and discuss them. And maybe you can help here.

As I don't want to deal with complete blackouts, a UPS might be beyond the goal. And I have no idea how the cheap ones deal with only voltage drops.

The "easy" idea would be a Powerbank that can be charged and discharged at the same time. But same problem: how do they react on voltage drops?

The last (and I think safest) idea is a capacitor (plus eventually resistor) soldered to the Pi. That should work, but how do I dimension the capacitor to bridge 1-2 seconds voltage drops? And can I just connect it to the regarding power-pins of the Pi and that's it? (In my sight of view it should)

What are your experienceses? Is there one version you could directly recommend? Or does anyone maybe already have THE solution?

Thanks!

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: Protection against short (<1s) voltage drops?

Tue Sep 04, 2018 8:57 pm

I've always just used a UPS and it just always works. We have frequent power glitches but my Pis (and pretty much everything else) just keeps up and running as if nothing ever happened.

Everytime this question comes up in the forum, people have all these exotic solutions in mind, but I always end up asking "Why not just use a UPS?"

That said, I am interested in "powerbank" type solutions and have done some research and experimentation along those lines. The trick is that you need a powerbank that meets both of these criteria (not all do - and it is hard to tell from advertising whether it does; experimentation seems to be the only course):

1) It can charge while it is supplying power.

2) It won't drop the power to the Pi when the input (AC) power goes away.

Most fail the 2nd criterion.

I tried several models and did find one that worked, and I ran it for about 6 months before it "faded away". After about 6 months, it could no longer supply enough power to the Pi to keep it running reliably.
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

cr0n
Posts: 9
Joined: Wed Feb 25, 2015 9:50 pm

Re: Protection against short (<1s) voltage drops?

Wed Sep 05, 2018 6:52 pm

Interesting to hear, thanks for that opinion! Well, to answer your question "Why not just use a UPS?": because a capacitor would be considerably cheaper than any good UPS!

...or?

Maybe I should ask you first: which USP are you using? How much does it cost? And is there any "cheap" UPS, that you could suggest to do exactly my desired job?

pfletch101
Posts: 510
Joined: Sat Feb 24, 2018 4:09 am
Location: Illinois, USA

Re: Protection against short (<1s) voltage drops?

Wed Sep 05, 2018 8:11 pm

cr0n wrote:
Wed Sep 05, 2018 6:52 pm
Interesting to hear, thanks for that opinion! Well, to answer your question "Why not just use a UPS?": because a capacitor would be considerably cheaper than any good UPS!
Doing nothing would be even cheaper, but you would be left with the issues that are troubling you. :)
There are many problems with 'just adding a capacitor'.
One is that mains power disturbances rarely come completely out of the blue, so you may well be dealing with an outage coming on top of a milder brownout. I don't know how well regulated your power supply is, but in order to calculate the capacitor's size you would need to take into account the possibility that the power rail voltage would already have drifted down a bit before the full outage hit.
You would also need to know the reverse current resistance of the power supply, to be sure that your stored charge would not simply leak back through the supply circuitry. There are almost certainly others.

If you buy a UPS (and you can get a decent low-power UPS for under $50, if you live in the US), all the hard work has been done for you, plus you have an opportunity to shut the Pi down cleanly if you experience a 'real' power outage.

Brandon92
Posts: 773
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Protection against short (<1s) voltage drops?

Wed Sep 05, 2018 8:15 pm

You can also take a look at the PiJuice HAT. This might be interesting for your application.

User avatar
DarkPlatinum
Posts: 844
Joined: Thu Nov 02, 2017 2:30 pm
Location: Unknown
Contact: Website YouTube

Re: Protection against short (<1s) voltage drops?

Wed Sep 05, 2018 8:32 pm

You should look at PiJuice, you can recharge the battery using solar power if you buy a seperate solar panel, and the Battery HAT acts like a UPS.
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3 1 * Raspberry Pi 3B + :mrgreen:

Check Out My Raspberry Site (Run on a Raspberry Pi 3B :) ): https://html.dynu.net

cr0n
Posts: 9
Joined: Wed Feb 25, 2015 9:50 pm

Re: Protection against short (<1s) voltage drops?

Wed Sep 05, 2018 8:42 pm

pfletch101 wrote:
Wed Sep 05, 2018 8:11 pm
If you buy a UPS [...], all the hard work has been done for you [...].
Yes. That Argument is true for a proper weatherstation either, though.

Don't misinterpret that answer, I'm grateful for your thoughts. But there is always a solution that deals with even more possibilities and probabilities. But isn't there the phrase "to crack a nut with a sledgehammer"?

Okay, which UPS are you mentioning there? And as you mentioned decent UPS for under 50$, what's your opinion for UPS under about 20$?

The PiJuiceHAT looks interesting, indeed. And I think it would work. But my thoughts above apply for that as well.

pfletch101
Posts: 510
Joined: Sat Feb 24, 2018 4:09 am
Location: Illinois, USA

Re: Protection against short (<1s) voltage drops?

Wed Sep 05, 2018 8:45 pm

Brandon92 wrote:
Wed Sep 05, 2018 8:15 pm
You can also take a look at the PiJuice HAT. This might be interesting for your application.
Cute, and would work, but would be more expensive than a regular small UPS and would (IMHO) have no real advantage over one in this application.

pfletch101
Posts: 510
Joined: Sat Feb 24, 2018 4:09 am
Location: Illinois, USA

Re: Protection against short (<1s) voltage drops?

Wed Sep 05, 2018 9:03 pm

cr0n wrote:
Wed Sep 05, 2018 8:42 pm
pfletch101 wrote:
Wed Sep 05, 2018 8:11 pm
If you buy a UPS [...], all the hard work has been done for you [...].
Yes. That Argument is true for a proper weatherstation either, though.
Not entirely - I have a Davis weatherstation (well into the mid-range for cost and quality), and it has major problems for monitoring indoor conditions, for which I use separate standalone sensors monitored by one of my Pis. These do a much better job.
Don't misinterpret that answer, I'm grateful for your thoughts. But there is always a solution that deals with even more possibilities and probabilities. But isn't there the phrase "to crack a nut with a sledgehammer"?
There is, but, to run with that metaphor, I would see the UPS as a rather ornate nutcracker and the capacitor as a small hammer and chisel!
Okay, which UPS are you mentioning there? And as you mentioned decent UPS for under 50$, what's your opinion for UPS under about 20$?
I was thinking specifically of the APC Back-UPS BN450M UPS, which is available from various vendors for under $50.00 - I have one protecting my router, WiFi Access Point, and NAS. There may be a couple of others in that price area. I don't know of any UPS for under $20.00 - you can have reliable or ultra-cheap, but not both!

Brandon92
Posts: 773
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Protection against short (<1s) voltage drops?

Wed Sep 05, 2018 9:11 pm

I agree that this is not the cheapest solution. And there are better ones.

However, we don't know you setup. And what for current it consuming. And yes, a capacitor could work. However there are some issues with it, like pfletch101 discussed . And if you "take" are large capacitor as back up. You could have a issue when the capacitor is used to power up you Rpi for a small amound of time. And the power goes back up. Because the capacitor is emty, it take some time to charge up. And this result possible that you power supply have some trouble with it. And the voltage is goes down. And you have the same problem again.

edit
I can also find a couple of UPS for around 50 euro in the Netherlands. But I don't know how they preform.

cr0n
Posts: 9
Joined: Wed Feb 25, 2015 9:50 pm

Re: Protection against short (<1s) voltage drops?

Fri Sep 07, 2018 12:16 pm

Okay, I see that you would entirely recommed UPSs.

Let's assume that I buy an UPS. What would you think, which flaws would cheaper UPS have compared to more expensive ones?

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: Protection against short (<1s) voltage drops?

Fri Sep 07, 2018 1:20 pm

cr0n wrote:
Fri Sep 07, 2018 12:16 pm
Okay, I see that you would entirely recommed UPSs.

Let's assume that I buy an UPS. What would you think, which flaws would cheaper UPS have compared to more expensive ones?
The main difference that I've seen is just their power rating - which basically boils down to how many things you can plug into it. The more you pay, the higher the power rating.

My experience is they are all pretty much the same - eventually, they wear out and have to be replaced.
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

pfletch101
Posts: 510
Joined: Sat Feb 24, 2018 4:09 am
Location: Illinois, USA

Re: Protection against short (<1s) voltage drops?

Fri Sep 07, 2018 2:27 pm

cr0n wrote:
Fri Sep 07, 2018 12:16 pm
Okay, I see that you would entirely recommed UPSs.

Let's assume that I buy an UPS. What would you think, which flaws would cheaper UPS have compared to more expensive ones?
The most important determinant of price for UPSes is the capacity of the device in Watts (determined by the current which its inverter can supply from its batteries) and the total amount of energy which its batteries can store. These generally increase more or less in parallel with increasing price. A typical consumer UPS can maintain its rated power for 5-15 minutes before its batteries are exhausted - it will last correspondingly longer, of course, if supplying less than its rated power. The batteries are the most expensive component of the UPS. At a given 'power point', you may pay a bit more for 'bells and whistles', like built-in spike protection for ethernet, cable, or telephone lines, automatic clean shutdown of an attached computer in case of a mains power failure, and/or remote monitoring capabilities , but these are secondary.

If you buy a name brand UPS (APC, Tripp-lite), you should not have to worry about reliability or effectiveness of protection from transients in normal use. I would not personally buy a UPS built by a manufacturer whose name I did not recognize, but YMMV.

The 250W UPS I specified is the lowest power general UPS I know of - going below that, you are generally talking about devices that are designed to attach directly to single computers, and these are often more, rather than less, expensive, though they typically have many of the "bells and whistles" I referred to above.

Return to “Troubleshooting”