Do-it-yourself UPS
Giampiero writes "Over at dansdata.com some guy named Dan creates a UPS out of some spare parts. To sum it up, "if you're looking for an industrial-capacity UPS solution, and don't like the prices of the off-the-peg options, it might be easier than you think to roll your own."" Of course you can mentally substitute U.S. 110 volts for Australian 220 volts wherever necessary...
Please, everyone take caution when working with high voltage and moreso, high ampre compenents. We don't want any fried ./ers
Tibbon
tibbon.com
Oh ... um ... never mind.
I've been doing this for years. I have a big brown truck, and whenever I want to send something to someone else, I just put it in a box, hop in the truck, and drive it over to them. I've even got a little portable touchpad for them to sign on, so it feels like the real thing.
TheFrood
If you say "I'll probably get modded down for this..." then I will mod you down.
On the other hand, would I get to wear the little shorts? Chicks seem to dig those.
---- El diablo esta en mis pantalones! Mire, mire!
Or, then again, instead of building one you could scour your local office supply stores and just might happen to get lucky. I got a "last year's model", 650 VA UPS, new but in a beat-up box in the clearance bin. It really looked like trash and subsequently was repeatedly marked down from well over $100 to $10.
:-)
Somehow, I get the nagging feeling that this pristine condition UPS (that I'm using right now) was worth more than $10
Of course, PCs don't actually use AC power: there's a big box in the back that converts all the AC input back to DC. So why not save some money and bypass this, by running the PC straight off the battery (like a laptop)?
Coupla caveats:
.3 or .7 volts.
Put a "battery isolator", or at least a power diode with a heat sink, between the power supply and the battery. And allow for the fact that it will drop
Don't even think about wet cells inside the house. Sulfuric acid belongs out of doors. There's a reason you're allowed to ship the Concorde battery without declaring it hazardous: it won't spill. Further, a non-sealed battery will release hydrogen while it's being recharged. Is your computer room free of all ignition sources?
Fred KC7YRN
(I've seen a commercial 500 VA unit for US$40)
One of the main gripes I have about the offerings from APC et al is that only their expensive, high-current supplies have the connector for expanding the batteries. This is unfortunate for those of us who care more about running time than wattage rating.
:)
The other thing that's irritating it that they rate these things in "VA" (watts?), when watt-hours would be a more useful to know.
Anyway, it turns out that it's not too difficult or expensive to jury rig your own UPS with extended run times. Pick up some 12AWG power cable, a couple of marine/RV deep-cycle batteries (don't waste your money on sealed or gell cell). Then take apart the UPS, and wire two of the 14V batteries in series with the internal 28V supply. Oh, and use a fuse.
For about $500 in all, I was able to build a UPS like this that could power six servers for over 24 hours.
Then you keep asking yourself "What can brown do for you?"
Where's your battery-power going to go when the mains fail? How is it going to be stopped from running back into the mains? Thats the same problem with smoke-detectors that plug into the wall and have a backup battery. When the power fails, the battery is pretty much instantly drained back into the main.
Job? I don't have time to get a job! Who will sit around and bitch about being broke and unemployed then?
Aside from corporate networks where constant uptime is absolutely necessary, why in the world would someone want to shell out for a power supply? I can understand the hack value in piecing together your own UPS, but it's all pretty much worthless in the end. Any catastrophe that could knock out power to your outlet is going to be big enough to ruin the UPS in the process.
Unless you live in Myanmar with its unpredictable power producing capabilities, this kind of expensive toy is useless. Even in Myanmar, though, you'd expect that you'd be accustomed to backing up every once in a while.
I have been pwned because my
IMHO un attended shutdown is one of the best features of the higher end UPS systems.. It safely saves your work and turns the computer of in case of an extended outage.. also what kind of surge protection do you get from that getto unit? Remote battery status? I use a UPS to protect my self from bad wiring and surges.. Hooking up to a settup like that would just be to unstable IMHO.. To each thier own, I guess
EA David Gardner -"... but the consumers have proven that actually what they want is fun."
Note to MOCs (Moderators On Crack): not offtopic, as comment is based on a rather uncreative allusion to what I originally thought was the story's topic after first reading its subject line, before reading the body.
You'd probably get more bang for the buck though if you already owned some of the components, such as a decent marine battery or a 25A power supply.
His article was more to say that if you roll your own, you can stack up a basement wall full of lead-acid batteries and run your PC for a week offline if you want. And you can do that cheaper than you can buy a real industrial power supply.
John
These do-it-yourself UPS thingies are going to require maintenance. Car batteries are designed to deliver about 3400 amps directly into the alternator of a car, only during the time that you turn the key. They they trickle charge very slowly off the engine mains.
By contrast, UPS batteries are designed to discharge at a slower rate, but charge very very quickly to be able to work if the power suddenly cuts out two or more times in a row.
The problem with using one battery where another is required is that a memory effect can develop. That slow discharge on a car battery can cause it to lose capacity and in as little as 6 months it'll be useless for any power failures over about 5 seconds.
How much does a car battery cost? about $50. But, you're going to need one every 6 months or so, making a home built UPS actually many times more expensive than one you buy at Comp USA.
I know it's counter-intuitive, but many things about batteries are.
If tits were wings it'd be flying around.
(Note - driving around the city with a passenger who's pointing a 240 volt disco strobe at unsuspecting pedestrians is neither condoned, nor encouraged, by the author. And even though it makes rain look really cool, please do not stand in the rain holding the strobe.)
It looks like he's tried this before. I wonder if he'll have an article on how to take apart your UPS and use it to scare pedestrians with a strobe.
D/\ Gooberguy
Karma: Meh (Mostly from meh.)
My friend once made a UPS out of some furbies and a big-ass fishtank... it was sort of cool, although it didn't really work, at all. But it was cool, ie: when we cut the power, one of the furbies blew up, and the water started bubbling... but the computer still shut off, o well.
1.18 New Zealand Dollars =)
There should be a moratorium on the use of the apostrophe.
Max V.
NeXTMail/MIME Mail welcome
$1.00 AUD = $.56 USD = €.60 EUR
Be careful with this stuff. Batteries can be nasty. At my previous job we had a "switch room" which housed out 50,000kva (yes "K"va) UPS. On the wall across from it were huge "grab the handle and yank" circuit breakers...which were covered in battery acid from the previous UPS.
Now this wasn't your home little ups box, this thing would blend in with three refrigerators side by side, and would run a 500 person electronics factory, and 500 person office (PC's at least) for 8+ hours. That was a kickass battery box.
Just remember, UPS's can go "BOOM" and I wouldn't want to try my hand at making my own and seeing it for myself. Some things are better left to APC and crue.
-Pete
Soccer Goal Plans
What's a separate-boxes do-it-yourself UPS rig good for, besides making you look all technical and competent?
Well, it lets you have monstrous battery capacity, if you like.
Why not buy the power supply and inverter in the same box, like this one, which sells for around USD$235.
Maybe it's a bit more expensive, but it can deliver 500 W (1000 W) peak, instead of 210 W (there are larger models available as well, up to 3600 W), you can use all the car batteries you want, and you may run less risk of electrocuting yourself.
Comment removed based on user account deletion
I use TrippLite power inverters with marine deep cycle batteries.
I have a 24 and 36 volt inverters. To add additional capacity all I need to do is add more batteries. The only thing to make sure is that ther e is proper ventalation for the batteries.
The inverters have ports for remote management as well as status leds.
It is a much lower cost solution and not as risky as there is not really high voltages.
However, you can probably replace the battery in your UPS with a similar model for less than the cost of a new UPS. Either find the manual for your UPS, search for your UPS model on line, or open up your UPS and see if it has any labelling regarding the battery capacity, or (better) a "replace battery with XXXXXX model or equivalent." Find an equivalent on line (thanks, Google!)
Check with a battery store (most major metropolitan areas will have several.) It may be worth the drive, as batteries are heavy, cost much to ship, and can only be delivered via ground (slowly.) And if you're uncomfortable working with live circuits or very hazardous materials, they'll probably be able to replace it for you for a small fee.
Finally, PLEASE RECYCLE YOUR OLD BATTERY! In most states, it is illegal to dispose of any lead acid batteries in the garbage or in a landfill. They are filled with corrosive toxic sludge. Please be responsible.
John
Brown says, "I want some more pie... *chuckle* Brown didn't say that."
--
"Everybody wants a rock to wind a piece of string around." - They Might Be Giants, "We Want a Rock"
Or, you could visit:
http://auction.apc.com/
And get refurbished, and sometimes brand-new, warranteed APC power units for pennies on the dollar.
Two years ago I purchased two 420VA refurbished backups for around $50 each. They're currently protecting my three boxen, one of which I'm on now, and have been flawlessly through brown-outs, sags, surges, etc.
Typically the refurb'd units are from companies who have agreements with APC to buy many UPSs and return them when the batteries run out. Why? Customers used to return UPSs marked as 'defective' when in fact it was simply a dead battery. So, they tape over the battery bay and simply have the customers return the units with dead batteries and pick up a new one. They replace the battery and sell the ok unit again as refurbished.
Thanks,
--
Matt
It's the other way around.
The article is about building a 220VAC/50Hz device. It converting from Aussie voltage.
-twb
I bet he used to set fire to ants with magnifying glasses too. Not that I'd ever do anything like that. No-sireee. Stop looking at me!
I also hope that they're on a concrete slab or on a floor over a beam designed to hold up the unusual amount of weight. If it's just a wooden joist construction room on an interior wall, you may find your floor sagging in a year or two as the nails slowly release.
The other thing is that your UPS may run fine until a deep discharge or two, and then blow out the charger because you're drawing more current than the power supply was designed to deliver.
John
The Dans Data article was originally written by Dan for our magazine, Atomic Maximum Power Computing.
As we're an Australian mag with a (mostly - we sell in New Zealand, Singapore and a few other places) Australian audience, its setup for 240V.
The UPS D-I-Y article appeared in AtomicMPC Issue 13 (latest issue is 18)
Janie took my gun...
I have a 24 and 36 volt inverters. To add additional capacity all I need to do is add more batteries. The only thing to make sure is that there is proper ventalation for the batteries.
:-)
Even though you specifically mention that you provide ventilation, I bet you will still get people yapping at you that your setup is dangerous because of the hydrogen
Just out of curiousity, how do you connect the batteries together? Do you use ordinary automotive cables connected to two huge bus bars? Or do you have some fancy connection blocks? I thought about doing something like this myself, but I never saw any really elegant way of connecting the batteries together.
It is a much lower cost solution and not as risky as there is not really high voltages.
The current can be absolutely amazing, though! I might not be so worried about touching an exposed contact, but I would be paranoid about letting any kind of metal object anywhere near the battereies!
A dingo ate my sig...
I doubt that. You can pick up an APC Back-UPS 500 for $100 USD if you look hard enough. Places like Staples often have them on clearance.
Plus, APC adds filtering components and surge protection. I think there is a guarantee on the components hooked to it too. I had a Cisco router hooked to an APC Back-UPS once during a bad thunderstorm. People lost equipment all over the place during that storm, and I lost the UPS... it was DEAD. But it saved the router, which was more important!
Also, you get serial port communication for logging too. Sometimes it's nice to know that, well, damn, why DID the power go out at 4:30 AM?
Thanks but no thanks... I'll be sticking with my trusty APC. =) But this is a cool idea nonetheless.
Also the cost for these components is *much* higher than a $59 APS UPS.
However, if you wanted to roll your own you would ditch the inverter and simply regulate the gel-cel down to the +12, +5, +3.3, +2.2, etc that your computer needs, and use a DC-DC converter chip to get the -12 and -5volts.
That's much more efficient and somewhat safer.
You wouldn't want a person without a CS degree writing software; we shouldn't have folks without EE degrees designing power supplies.
--
Ask the Ya-Hoot Oracle Anything!
Back in the day I use to have an account on a BBS that did this exact thing. The sysop then got others to do this too.
On another note, one of the nice things about this is the ability to expand the source of the 12v in. For instance, a small array of solar cells wired together and into the battery taking the load off of the house current/AC->DC thingy during some days. When we did the math for it, it paid for it's self in about 4 month of sunlight every day, or about a year in real life. 12v is a nice little voltage to work with when it comes to this and alternitive energy sources. Hell, wire a nice little 12v DC generator to an exercise bike for when your bored. Get a work out and save on your electric bill. Also, if you want to go real insane/creative, suck off of the telephone lines when not in use, they got something comming through them i'm sure. It's alot easier to get 12volts then it is 110ac.
(Score:0, Interesting)
>> Of course you can mentally substitute U.S. 110 volts for Australian 220 volts wherever necessary...
Holy S#!t! And I thought the Canadian exchange rate was bad!
You can beam power around as microwaves or a laser beam or something, but the equipment to collect the power and convert it will be large and bulky. And unless you want to turn your apartment into a large microwave oven with you inside it, you would need some kind of complicated aiming system to make sure the power only goes where you want it.
Simpler would be to have your gadgets run on battery power, with charging cradles.
If you imagine ultra-low-power technology combined with ultra-high-density batteries, you would have gadgets that don't need charging often and have no power leads. Then just have robots run around in the middle of the night, charging them while you sleep.
:-)
steveha
lf(1): it's like ls(1) but sorts filenames by extension, tersely
Funny I thought we ran on 240 volts in Oz
--- Who put this sig here? ---
I've even got a little portable touchpad for them to sign on, so it feels like the real thing.
If you really want it to feel like UPS Ground, shouldn't you kick the box around the back of the truck en route?
"We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
Totaly myth.
Not possible.
Even if the resistance was only 1000 ohms, and it was most certainly a great deal higher, he would only have 9 mA, not 80.
So, if I didn't want to build my own UPS, what are some good brands to get for affordable yet good quality UPSes (reliable, has computer interface that Linux supports, etc.)? I've heard not so great stories about APS...
It's totally impractical. You would have to ensure that no metal objects were in the house, or they would pick up the power as well.
Read up no Tesla, he was a fan of this. Lots of wireless lights in his labs. High frequency, high voltage electric fields really.
There are modular inverters with N+1 redundancy, but those are usually seen only in large units.
I have two UPSes -- I used to have three but one died a horrible death for no apparent reason.
:-(
The smallest unit I have is a 600VA no-name Taiwanese box with two 7A SLAs. It has no fan and, although it's just an SBS, it still runs hot as hell.
As a result of this hot running, I discovered that the SLAs tend to dry out rather quickly such that you get a much shorter time than you'd expect when the mains power goes off (as I discovered just the other night
My other box is a Siemens 1KVA full-time UPS with forced ventilation and a bunch of other cool features.
It's worth noting that even a fan-cooled UPS such as the Siemens can run way too hot -- as I discovered about a year after I installed it.
Without warning, the UPS started screeming at me with a continuous alarm buzzer. It was still working but it was not at all happy.
On touching the case I discovered why -- it was too hot to touch.
I shut things down really quickly and opened up the case to see what was wrong...
Dust!
The intake holes in the front panel have a fine wire mesh over them and, since this UPS (like most others) lives on the floor under my desk, enough dust had been sucked into the holes to totally block them.
So here's a DC-AC inverter busy delivering about 500W of power to several computers and monitors -- but without the benefit of any cooling. No wonder it wasn't happy.
I blew the filters out with compressed air, checked that the fan was okay and put it back together. It's been working fine for nearly two years since -- albeit that I check and clean the intake meshes every few months now.
That the Siemens box was smart enough to warn me it was in distress (rather than just failing) shows that nobody ever regretted buying quality.
So.. rules of thumb for UPSes...
If it runs hot-- expect the batteries to last just 18 months to 2 years -- and don't wait until the power fails to find out that you should have changed them already.
If you have a fan-cooled UPS mount it up off the floor or check that the cooling holes are clear at regular intervals.
I did some network consulting at a lawfirm that had offices in a high-rise tower. They couldn't get the EPA permits granted for a diesel powered backup generator, so they built a "UPS" room.
The inverter came from these guys here.
They hooked up half a room full of 12 volt lead-acid batteries to charging systems and inverters and put the whole system under a vent hood. We never did figure out exactly how much runtime their server room had.
-ted
To a large extent the danger of explosion can be reduced by using hydrogen catalyst battery caps on all cells of the lead acid battery. These can be purchased from Hydrocap, 975 N.W. 95 Street, Miami Florida, 33150,(305)696-2504.
M0571y H@rml355.
Get a laptop. They come with a built-in UPS, and the power management is tightly integrated with the BIOS. They also tend to be pretty energy efficient.
- some guy creates cool thing
- said guy puts directions on his homepage
- some bored
/.er finds it, submits it to /.
- editor likes it, it gets posted
- INSTANT DEATH to the guy's homepage
- inventor guy looks at how many hits he's gotten, realizes why server is dead
- guy learns not to share innovations online
This is how we thank people that invent cool things in this day and age.UPS batteries tend not to be as expensive as notebook batteries...there aren't as many different varieties, so they tend to be somewhat standardized. I recently replaced the two 12V 7Ah batteries in a UPS at home. That UPS cost about $170 when I bought it. New batteries were about $40 for two. Given that the UPS is a 900VA unit that can keep a dual-P!!! server running for about half an hour, $40 isn't a bad deal to keep it running.
20 January 2017: the End of an Error.
Actually the problem is that they were designed to run only for 5-10 minutes at a time. Instead of heatsinks they just use blocks of metal that have enough thermal mass to keep it within operation temperatures for that period of time.
I found out the hard way.. wired up an additional 25Ah in parallel with the 10Ah that came with it (rated for 500VA). Ran fine for 30 minutes. Then a burning smell and beeping for no reason (battery meter at ~40%). Unplugged it and immediately opened it up (30 seconds), as soon as I did one of the heatsinks (err lob of metal) fell onto the hardwood floor, with the semiconductor still attached glowing white hot. In about 1/2 sec it burst into flames (Oxygen starved from inside case!) and the whole block started to burn into the floor. Luckily I had some pliers to pick it up so it wouldn't burn the house down. There is still a big black square burnt into the floor. Branded by my ex-UPS.
I got damned lucky because I didn't drop the heatsink on any part of myself, I imagine any clothing would have caught fire instantly, etc.
In retrospect I suppose I could just add large heatsinks and a fan and it should work. The semiconductors have to be rated for the current, but the wasted energy just has no where to go.
"I don't know that atheists should be considered citizens, nor should they be considered patriots." George HW Bush
I think these are what you're looking for:
http://www.keypower.com/DC_power/DX-250H.htm
W=P=E*I ONLY for purely resistive loads.
W == less then E*I for inductive loads, like computers, motors, etc... anything with a power factor less then 1. On the other hand, VA == E*I for any device, and gives the total amount of power required by the device, not how much it is using.
(E == volts, I == amps)
.
At work we bought a 3kva upsonic ups. Its good for about 10 minutes. That just would not do so we hooked up 16 deep cycle batteries to the thing. Now it will run for about 4 hours on a full load and a very long time when we start pulling things offline. It takes 4 days to recharge the thing.
We got a UPS because it has a good inverter and auto switching and a built in charger. An inverter would have cost more. I've got a snmp card so I can measure different things.
You have to be careful about these things beause you get a large voltage and massive amounts of current. Our system has two 96 volt banks and good for at least 300 amps. That can kill and it can also cause batteries to explode. Treat these with the respect they deserve. We have a small circut that goes between each battery that has 4 led's that let us know if any one of the batteries go bad. Its also hooked to a monitor system so we can get real time alarms if anything goes bad.
Or, you can do what I did...and instead of paying $200 for an equivalent battery, you can spend that on a couple of Die Hard Deep-Cycle Marine batteries and 4-gauge cable hardware. ;)
;)
This was a Smart UPS 1400 RM. The newer XL models actually have an expansion plug on the back which can support a few of these puppies. I'll get an XL model off of ebay someday...but the homegrown hack will have to work for now.
// Agent Green (Ian / IU7 / KB1JQO)
// IEEE 802.3: All 10base Are Belong To Us
Look for people selling these from companies who've tossed them when upgrading to larger more centralized backup power (APC silicon, etc).
There was another rackmount 1400VA unit for $100 when I went back a few weeks later... I was a little upset but what the hell 1000 is enough for me, and I dont have a rack in my apartment (though I'd like to) ;-)
that was not particularly covered in the article.
I used to design UPS's for a major American UPS mfr. The author slightly mentioned that you would not want to use a normal UPS for continuous operation due to overheating. He is correct but for the wrong reason. It is NOT overheating of the battery cables you have to worry about. It is the Transformer.
Since the Transformer is the biggest cost item next to the Battery they are highly optimized for the performance/price point. That means a transformer designed to run at 400VA for 3 minutes will probably melt into a glob of laquer, copper, and steel in about 20 minutes. Of course that also means it could short out, catch fire, or send unknown voltages to your computer possibly destroying your computer PS.
Just as a point of reference the industry has made a distinction between continuous duty and back-up supplies. UPS means temporary supply to allow you to save data. Inverter means continous duty.
If you wish to try this project I make two suggestions:
1. Use or purchase an Inverter. Tripp Lite sells the PV series inverters which were designed to be used exactly in the fashion of the unit in that article. They also sell APS's which are UPS's that _are_ continous duty.
2. If you MUST use a UPS inverter, then get one that is overrated by at least 10 to 1 in VA handling capability. Depending on the UPS you get this may not be enough, but it will get you close.
3. If you are really ambitious, replace the UPS transformer with a much bigger one. Keep in mind that the power handling of the drive circuitry is important too, but hey - you want to tinker, right? Just make sure you understand the proper step-up ratio and winding configuration of the original transformer.
-- Mean People Suck
But UPS battires are just simple Lead-Acid battires. Generally nice sealed ones, but none the less still a Lead-Acid battery which can be built fairly cheaply. They are, after all, a very old technology. Laptops, needing a much better power to weight ratio use more advanced battery technologies. At a minimum they use something like nickel metal hydride and generally all newer laptops use something like lithium ion battires. Well, while these provide great storage for their weight, they are much more expensive to construct and hence more expensive to buy.
From the screen of the computer, I can see that he builds a DIY UPS, but he doesn't run a DIY operating system.
Those who would give up liberty in exchange for security and DRM should switch to Microsoft Palladium!
A friend of mine works for a hospital which recently changed out all their batteries in their UPS as they do every few years. He salvaged a few good ones, and gave me a couple.
I connected them in parallel to the power connectors on my APC UPS and can now expect many more minutes of power outage without interruption.
Your local hospital might be a good source of batteries for a project like this since they have to pay to dispose of the batteries anyway.
My poetry site welcomes the unusual.
Indeed. Just last week I saw a 24,000kVA backup power system. It's 5 tractor trailers, one of which contains a modified jet engine. The bad news is that it puts out 13.8kV or more. CS majors - don't hook that to your PC. Rent one today!
Envy my 5 digit Slashdot User ID!
What good is a homebrew UPS if it doesn't support decent management software such as NUT?
Having a UPS means nothing if you lose power and the server dies when the battery runs out. You want the system to gracefully shutdown when the battery level becomes critical.
-- Will program for bandwidth
A UPS is an emergency backup solution for mission-critical applications. Building a UPS out of spare parts based on instructions from a web site seems like sewing a parachute using recycled grocery bags with a pattern from McCall's.
"Regular" light bulbs should run fine (and actually last longer) on DC.
Just because it CAN be done, doesn't mean it should!
I have repaired a couple of UPS. Every time it
just required that I replace the batteries.
I regularly see cheap =$20 UPS at the local Silicon Valley swaps where usually the only thing wrong is that they need new batteries.
I picked up a Tripplite Omnipro 1400VA UPS for $25 and a few months later picked up 5 batteries for $20. I also picked up a small Deltec UPS for $5 and a new battery for $12.
As for the Tripplite, it appeared totally dead when plugged in with the dead batteries that came with it.
This post is encrypted twice with ROT-13. Documenting or attempting to crack this encryption is illegal.
A few people on here are bemoaning the fact that this "ghetto" UPS doesn't have monitoring. Even the author of the article notes this. However, building such a monitor wouldn't be too difficult.
Basically, you are looking at a relatively simple voltage window comparator circuit. Most of these circuits use op-amps arranged in a differential mode to provide 2 or 3 "windows", and typically light up LEDs to show "high", "medium", and "low" voltage levels. Simple digital signal probes do the same. Most of the time, these devices can be built using cheap op-amps or comparator ICs that house four comparators in a single DIP package. Hook the LED lines to a PIC/MAX232 system and monitor the data via RS-232. Or, simpler - monitor the status of the lines using the parallel port.
The "el-cheapo" solution is to just simple start the shut-down as soon as power is completely lost. Drop a relay across the 120 VAC input, then have a 5V source (from the battery and a 7805) switched "on" when the relay is disengaged when the voltage fails. Run the 5VDC to a opto-isolator circuit (to isolate the computer port from the mains at the relay), and the ouput from the opto-isolator to the parallel port or serial port (you could monitor this directly). Configure the software monitor to check every so often, and if the power is indicated to be "out" after 15 or so seconds, begin the shutdown sequence (this will allow for transients in power that might occur - you could up this to however long you wish).
Software would have to be written for both of these solutions, but it would be rather simple, for either *nix or 'doze.
In regard to the danger of this kind of "battery-box" solution - you definitely have to be careful with this, when it is on, and "off" (ie, doing the UPS thing). LA batteries can source a lot of current - you can easily make a cheapo stick welder with a couple of good 12V car batteries - that is serious current. Also, when an LA battery (actually, any battery) is under load, it will generate heat, and in the case of an LA battery, a lot of heat can be generated. This heat can cause the electrolyte to "boil", forming funky gasses. The batteries can also explode (heck, I have even personally witnessed dry cells explode). If you want to see an "interesting" site, go to an electronics junkyard and look for an old "heavy duty" UPS (look for refrigerator size boxes needing 440VAC input). If the batteries are still in the box, take a careful look at them - you might notice that they are "swelled", some may have even leaked or burst. This is because the UPS kicked on, and remained on for a VERY long time, and the batteries literally "cooked".
What the one poster said about having cleanup supplies, etc - yeah, that could be needed. If it was me, I would store the UPS outside my house, in a ventilated shed or something...
Reason is the Path to God - Anon