jriff
Posts: 4
Joined: Tue Feb 12, 2013 8:08 am

Micro UPS

Thu Jul 11, 2013 1:46 pm

Hi all

I have a lot of Pi's running in different places. They are always turned on but are power cycled 1-2 times a day. Power is just cut - no clean shutdown. Sometimes the filesystem on the SD card get corrupted and I guess it is because of the sudden loss of power.

I was thinking that there must be a sort of micro UPS that can keep the Pi running for about 15 seconds? Then the OS can do an emergency shutdown before power runs out.

Does anyone know of such a device?

User avatar
Tage
Posts: 287
Joined: Fri May 24, 2013 2:29 am
Location: St Thomas, Ontario Canada

Re: Micro UPS

Thu Jul 11, 2013 2:11 pm

it is relatively simple to create a UPS with 8s runtime. in another thread I suggested three 1 Farad 4.2V supercaps in series.
For example, if you use three of these supercaps in series and charge the pack to 12.6V from the car battery or 12V power supply you then have about 8 seconds of power for a Pi running at 500mA current draw. If you need more runtime you can parallel another set of capacitors.

You could use a cheap switching converter to get 5V from the capacitor while the voltage is dropping from 12.6V to 6V. Don't use linear regulators. I recently bought one of these gadgets that plug into the cigarette lighter socket in a car. It cost about $4 and has a USB socket. it was a simple thing to remove the mechanical parts to get to the circuit board that contains a switching regulator that delivers 5V at 1A max. The input voltage to this particular switching converter was maximum 25V, but it is probably possible to extend that input voltage range by changing the input capacitor. if you only need a few more seconds you could use four supercaps in series and charge the pack to a higher voltage (16.8V with the Murata super caps)

jriff
Posts: 4
Joined: Tue Feb 12, 2013 8:08 am

Re: Micro UPS

Fri Jul 12, 2013 7:30 am

Thanks for your answer.

I need this to run in production on about 300 Pis so a home made solution isn't what I was looking for :-) I was thinking more like a PSU that has a battery or a couple of supercaps built in and a way to let the Pi know that power has been cut. That way I could monitor two GPIO pins for a high or low and do an emergency shutdown.

geekinthesticks
Posts: 97
Joined: Fri Feb 08, 2013 7:22 pm

Re: Micro UPS

Fri Jul 12, 2013 8:34 am

If you use a conventional UPS most of them support apcupsd. This is a daemon that monitors the UPS and fires events on power loss. You can hook the events with shell scripts to do whatever you want. Documentation is at http://www.apcupsd.com/

User avatar
Tage
Posts: 287
Joined: Fri May 24, 2013 2:29 am
Location: St Thomas, Ontario Canada

Re: Micro UPS

Fri Jul 12, 2013 2:35 pm

you could power the Pi from a 12V supply, with a switching converter at the input of the Pi. connect a diode in series with the 12V supply, and add a battery with a voltage 6.5V....12.0V, and another diode in series with the battery. connect the diodes with cathodes together, so when the supply goes don the current for the switching converter will be drawn from the battery.

if you use alkaline cells you do not need to worry about charging. with this simple circuit your battery voltage at no load needs to be lower than the voltage coming from the 12V supply.
add a voltage divider from the 12V supply output to a GPIO input pin so you can detect when the main supply goes down.

rtek1000
Posts: 24
Joined: Wed Mar 12, 2014 9:21 pm

Re: Micro UPS

Thu Mar 27, 2014 6:50 am

Maybe this scheme:

Image

Return to “General discussion”