Słomkowski's technical musings

Playing with software, hardware and touching the sky with a paraglider.

Long-lasting UPS setup with APC Smart-UPS and car batteries


I connected a server-grade UPS with four car batteries to create a cheap solution for non-stop operation of server rack cabinet for over 12 hours in the event of a power outage.

Introduction

Recently, I was tasked with devising a system to ensure continuous operation of servers contained in a certain rack cabinet for at least 12 hours during a power outage. It also needed to be done cheaply, so buying new server-grade equipment was not an option. Naturally, a UPS came to mind, accompanied by large batteries to support a longer outage.

I started by measuring the power consumption of the whole cabinet - it turned out that it averaged at about 300 W, which is not much, but theoretical peak power (sum of max. power ratings of all disks, motherboards, CPU-s, etc.) resulted in ~1200 W, so the UPS should be able to handle this high load too, however rare.

So I needed a rack-mountable UPS with at least 1200 W of peak power, with external battery connector. Because of Linux support (namely, apcupsd daemon), I decided to limit the search to APC brand. I purchased APC SMART SUA2200XLI from one of the local companies which deals in used server equipment.

The UPS

APC SMART SUA2200XLI is 5U rack-mountable line-interactive UPS capable of delivering almost 2 kW of AC power. It is nominally energized by four 12 V 17 Ah RBC55 VLRA batteries connected in series and optionally by external battery connector (Anderson SB120, blue - 48 V). Internal batteries are not required, all power may come through external connector. These sources seem to be simply connected in parallel internally, the UPS doesn’t distinguish external vs internal power. Diagnostics and control is provided through USB, serial and optional networking card. Warning! DE-9 serial connector uses proprietary pinout. Using standard serial cable will cause the UPS to shut down!

Since this model has reached its end of life state, I provide datasheets in case they get removed from Schneider’s website.

Choosing batteries

A UPS should ideally be paired with deep cycle VRLA lead-acid batteries. To keep the cost down, I decided to use ordinary car batteries. They are widely available and much cheaper. They won’t be routinely discharged in this application anyway, since long power outages are rare. Even during recent major line service in the area, the outage was less than six hours. It means the batteries are not expected to lose much capacity during their lifetime since they won’t be deeply discharged frequently.

Taking 300 W of load, 12 hours of operation and 80% efficiency, 300 W * 12 h / 48 V / 80% = 93.75 Ah of theoretical battery capacity is needed, so I decided use 100 Ah. Searching for quality car batteries yields pessimistic findings, as only a handful of manufacturers use the casting process to make battery plates. The majority of them use punching net technology, which yields substandard results. At the time of writing this article, the Ukrainian manufacturer Megatex uses casting, so I bought four AMEGA Premium M5 100 Ah batteries.

Warning! Car batteries are more likely to emit hydrogen gas than AGM/VLRA batteries when overcharged. It is essential to keep the batteries in ventilated area. The rack cabinet in this project is kept within a large corridor with natural ventilation.

Consideration of the usage of a UPS without an external battery connector

Apart from using a UPS with an external battery connector, it should also be possible to simply connect a larger battery to the internal power clamps inside the UPS. My concern with this idea was that such setup might be incapable of providing enough charging current to the large battery, so it would take forever to charge it from fully depleted state. In extreme cases, increase of self-discharge caused by cell degradation would prevent the big battery from ever being charged. UPS-es with external battery connectors should theoretically have greater charge current, which should vary with number of battery packs connected to it. I haven’t confirmed that increasing number of battery packs increase charging current in the aforementioned UPS, though.

Construction

The batteries weigh almost 100 kg so a strong base plate is a must. I cut 20 mm water-resistant plywood to closely match the interior of the cabinet. It lays at the bottom of the cabinet, held by four caster assemblies in the corners. To make the base even stronger, I bolted a strip of plywood at the bottom. Batteries are secured in place by several small pieces of plywood.

Batteries are connected in series by 16 mm² wires and snap-on battery clamps. Anderson SB120 connector is crimped to the other end. To make diagnostics easier, there’s also a front panel with measuring instruments and emergency shut-off switch. The front panel is 2U blank rack panel with drilled holes for the instruments. The wiring is shown in the schematic:

Electrical wiring of the battery harness for the UPS.
Electrical wiring of the battery harness for the UPS.
↑ click to enlarge ↑

Four batteries are connected in series. Each one has a nifty Chinese voltmeter/battery monitor LY6W attached. Their current draw is normally ~5 mA, but the backlight shuts down if the voltage goes below ~10.6 V, allowing the meters to be connected at all times. You configure it by pressing the button on the back, as described in the manual: TH01/LY6N/LY6W battery tester.

Additionally, there is a 100 A battery cutoff switch and a bidirectional 52 mm ammeter, both of which are intended for use in agricultural machines. The ammeter has a range of -60 A to 60 A, unfortunately no numerical markings on the scale.

To err on the side of caution, I installed two fuses rated for 100 A, each in MIDIVAL package, which is commonly used in cars and electric vehicles. The fuse in the photo is rated for 32 V, but the other fuse on the front panel is rated for 58 V. It is crucial to use a fuse rated for 48 V or higher because a low voltage fuse may not necessarily interrupt the circuit - sustained DC arc might prevent it from happening and cause fire.

Software and configuration

The UPS communicates with one of the Linux boxes inside the cabinet through the serial port. The apcupsd daemon monitors its state. I set up appropriate e-mail notifications and shutdown hooks. Due to the unusual setup, it is also recommended to set the number of external battery packs to match the total battery capacity. Considering the following facts:

100 Ah is an equivalent to 2-3 external battery packs. I set the value to 3. This can be done through serial connection as described by Schneider or by apctest command, as shown in this terminal session:

# apctest

You are using a SMART cable type, so I'm entering SMART test mode
Hello, this is the apcupsd Cable Test program.
This part of apctest is for testing Smart UPSes.
Please select the function you want to perform.

1) Query the UPS for all known values
2) Perform a Battery Runtime Calibration
3) Abort Battery Calibration
4) Monitor Battery Calibration progress
5) Program EEPROM
6) Enter TTY mode communicating with UPS
Q) Quit

Select function number: 6

Enter an ESC character (or ctl-[) to exit.

>000
+OK
+NO
|>001
+OK
>002
>002
|^[
1) Query the UPS for all known values
2) Perform a Battery Runtime Calibration
3) Abort Battery Calibration
4) Monitor Battery Calibration progress
5) Program EEPROM
6) Enter TTY mode communicating with UPS
Q) Quit

I haven’t confirmed if increasing number of battery packs increases charging current, though.