APC Back-UPS Battery Run Time Mod

I got an APC Back-UPS 1400 to protect my hardware from power surges and outages. With my notebook and PC plus two monitors, network switch, PCengines router and ISP router connected, it ran about 40 minutes until the battery was empty.

By far the most “power outages” last less than two seconds and merely elicit an angry growl from the UPS before it returns to its usual, quiet 50Hz hum. However, every now and then, a transformer goes boom, and it usually takes the electricity guys about 1-2 hours to fix it. Which was too long for my UPS to bear.

So I figured I should replace its original batteries. According to APC, the model I bought does not have user-replaceable batteries. They even have this somewhat useless video on YouTube, showing how you can not replace the battery.

The Hard(-ware) Part

Well, as it turns out, you can in fact replace the battery if you are fearless and know how to use a screwdriver.

APC Back-UPS 1400 insides

The UPS contains two 12V, 7Ah lead acid batteries, standard BP7-12, which are connected in series. Unfortunately, there is no replacement battery with significantly more capacity with these dimensions, so I cut them out, drilled a hole in the case of the UPS and led the cables to the outside.

I ordered two 35Ah, 12V deep cycle lead batteries as replacement, as well as some cable and lugs to fit the M6 battery screws. I build a nice battery pack out of the paper boxes in which the batteries were shipped, and connected everything together.

New batteries connected in series in the back, original battery pack in the front
My cat เสือ (Tiger) warming his ass on the UPS, next to the finished battery pack

The Soft(-ware) Part

Now, this “Back UPS” series of APC is the dumb, cheap kind of UPS. You can’t just tell it that it now has a bigger battery. In fact they have a different series called “Smart UPS” where you can do that. Apparently they didn’t want to call this one “Dumb UPS” though.

Anyway, it has a USB interface via which it reports some status information, including the battery voltage, the estimated battery charge and the estimated remaining run time, which you can read out using apcupsd (which I run on my router, which runs pfSense):

APC      : 001,037,0959
DATE     : 2019-10-05 07:54:55 +0700  
HOSTNAME : ********
VERSION  : 3.14.14 (31 May 2016) freebsd
UPSNAME  : greenhouse-ups1
CABLE    : USB Cable
UPSMODE  : Stand Alone
STARTTIME: 2019-10-04 12:08:32 +0700  
MODEL    : Back-UPS XS 1400U  
LINEV    : 232.0 Volts
LOADPCT  : 31.0 Percent
BCHARGE  : 100.0 Percent
TIMELEFT : 18.1 Minutes
MBATTCHG : 1 Percent
MINTIMEL : 1 Minutes
MAXTIME  : 0 Seconds
SENSE    : Medium
LOTRANS  : 155.0 Volts
HITRANS  : 280.0 Volts
ALARMDEL : 30 Seconds
BATTV    : 27.2 Volts
LASTXFER : Unacceptable line voltage changes
XONBATT  : 2019-10-04 17:21:49 +0700  
TONBATT  : 0 Seconds
CUMONBATT: 4 Seconds
XOFFBATT : 2019-10-04 17:21:51 +0700  
STATFLAG : 0x05000008
SERIALNO : 3B1803X11330  
BATTDATE : 2018-01-18
NOMINV   : 230 Volts
NOMBATTV : 24.0 Volts
NOMPOWER : 700 Watts
END APC  : 2019-10-05 07:55:00 +0700  

As you can see here, at a load of about 30% (I ran some stress test on my PC to achieve this relatively high load), it reports a remaining run time of 18 minutes – which would possibly be somewhat accurate with the original batteries.

As it turns out, the battery charge is not calculated from the actual battery voltage. When I disconnected the power, the UPS reported a linearly decreasing battery charge and remaining run time, hitting zero after about 40 minutes (I did this with normal work load which is around 15%) – while the batteries happily still delivered 24.8 Volts (and would continue to do so for another two hours or so).

Ideally, I’d want apcupsd to shut down my hardware when the UPS reports an accurate remaining charge of, say, 30% (even though they are “deep cycle” batteries, they do not actually like being drained completely – it reduces their life span).

I found multiple sources claiming that you could calibrate the UPS by draining the battery completely with a load of between 30 and 34%. I tried that to no avail – the UPS still reports a remaining run time as if it had its original battery. Unfortunately, recharging the large battery takes approximately 40 hours because the charge current is dimensioned for the original battery, so I did not do any further tests up to now.

Instead, I set apcupsd’s BATTERYLEVEL = -1 and MINUTES = -1 and set TIMEOUT = 9000, so that the hardware would shut off after 9000 seconds (=2.5 hours) regardless of the battery charge reported by the UPS. (Ironically, pfSense’s apcupsd package wouldn’t allow setting those values to -1 due to a validation bug, so I fixed that first).

So, now hopefully I’m ready for all the power outages to come.

What Was My Mt.Gox Balance Again?

As you might remember, Mt.Gox, one of the first Bitcoin trading platforms, was hacked in February 2014 (or before that), and subsequently closed down, with the users’ funds lost. A long process started where users could apply to reclaim their funds, but nothing came of it so far. Now on June 22, Mt.Gox sent out another email to its former users, and actually I’m not entirely sure what it says, but it seems like a new system will be set up for filing claims.

But I was wondering, because I forgot – how much BTC did I have on Mt.Gox anyway? How can I find out my former Mt.Gox balance?

So, it turns out there was a leak of Mt.Gox data in 2014, and you can download the whole thing from archive.org here. The zip file contains a dump of all account balances and a BTC transfer log with all transactions since 2011. The transfer log and account balance dump do not contain user’s names or email addresses – they only contain user and transaction IDs.

Bitcoin transfer log from Mt.Gox leak

I found a transaction reference in one of my old emails from Mt.Gox. With this transaction reference, I was able to look up my wallet ID and so I found my balance in the other file.

Account balances from Mt.Gox leak

The balances in the dump are shown in Satoshis, i.e. you have to multiply by 0.00000001 in order to get the amount in BTC. Note that the topmost entry in the dump had a balance of 44547.67562508 BTC, which is worth about 285 million Euro or 331 million US Dollars at the time of writing.

I’m not going to reveal my own balance here, I’ll just say that, while it is not a negligible amount at today’s prices, other people were much more unlucky than me 🙂

Update: there is this post on reddit which sums up what’s going on with Mt.Gox claims refiling right now.

Update 2: the new claims system is online, read about it in my new post: Mt.Gox Claim Filing System Online