Tracking my laptop battery

By | January 5, 2016

Some time ago I read “The (De-) evolution of My Laptop Battery“. At the time I had an old (2008 model I believe) MacBook Pro, on it’s first (or second) battery, and that battery was already heavily degraded. Because of that I saw no need to start logging the current battery capacity, but I made a note of doing that as soon as I got myself a new laptop.

So, little over a year ago, when I retired by old and faithful for a brand new MacBook Pro, one of the first things I did was to set up a cron job that every half hour stores the current battery stats to a local file when turned on.

laptop model

I was somewhat worried about the battery on these new Macs as you can’t easily replace them anymore, given that they’re an integrated part no longer externally accessible. Handing a laptop in for a repair job on a component that inevitably is going to be degraded seemed like a somewhat heavy price to pay for a slimmer design. Anyway, what can you do? I needed a new laptop as the old one struggled to keep up.

The model I have comes with a battery that claims an 8440 mAh design capacity level. This is enough to let it run for 4 hours for my type of typical usage, if not more. However, I rarely use my laptop unplugged. Typically, my laptop sits at my desk, plugged in while on. Most often the battery is fully charged, but I don’t tend to leave it plugged in while not in use. In other words, the battery is typically at 95-100%. So given this, how has the battery capacity degraded over time?

Below we see the max capacity from it was new, till now, shown on a daily basis, a little over a year since I got it. We can see that initially the battery is well above the design capacity, peaking at 9229 mAh. Only now, over a year since new, is the battery actually at (or slightly below) the specified design capacity.

battery capacity

I have no clue why the capacity suddenly increased a few months after I got it, but over time it seems to have decreased about 600-700 mAh within the total period. If that continues linearly, which I don’t think is likely, I could expect the battery to have about half its design capacity in maybe 5-6 years. That sounds a bit too good to be true, but it would be nice if that actually was the case. FYI, the cycle count is currently at 75.

Battery capacity is however just one property of this dataset. Another thing it tells me is how much and when I tend to use my laptop. As mentioned I don’t tend to use it during daytime weekdays, but it might still be on if working from home or I leave it on to run some kind of task. Let’s first look at the number of hours it stays on spread across all the days available.

hours of use by date

What’s difficult to see from the graph is the overall average, which is 7.3 hours. What the brown/orange trend line is showing however is that it seems my usage is slowly increasing over time. We can also see a few periods where I’ve left it on 24 hours for several days in a row. From memory this would typically be during long running calculations on some simulation work I sometimes do on it.

What about a typical week? We can group these stats by day of week, and find the number of hours I’ve had the laptop on for each day. The below graph resonates with how I know my usage pattern is very much. I tend to start the week working on personal projects during the evenings, before calming this down towards Thursday/Friday (and indeed Wednesdays as well it seems). The weekends then see an increase in use as it would typically be on, either just in the background (playing music or whatever), or actively being used.

hours of use by day

Breaking it down further, we can count the number of log entries by hour across a 24-hour period and get the below graph. Again, we can tell this machine is generally used in the evenings, getting turned off around midnight when I go to bed. We also see a spike in the morning, around 8:00, which is me using it briefly before heading out to the office.

usage by hour of day

If you’d like to do something similar yourself, all I have is a simple shell script as shown below. This is run by a cron job scheduled as 0,30 * * * *.

script

 

One thought on “Tracking my laptop battery

  1. Tyga

    As far as “half design capacity after 5-6 years” my experience confirms your guesstimate.

    I still use a 6 year old MBP (mid-2009 vintage) – replaced 160GB spinning rust drive with a 240GB SSD years ago.
    Running istats :

    — Battery Stats —
    Battery health: Check Battery
    Cycle count: 813 ▁▂▃▅▆▇ 81.3%
    Max cycle count: 1000
    Current charge: 2044 mAh
    Maximum charge: 3534 mAh ▁▂▃▅▆▇ 64.8%
    Design capacity: 5450 mAh

    Get 2-3 hours of use on a fully charged battery.

Comments are closed.