Got a heads up from Amazon that one of my device batteries was low. Gotta give it to the battery, it lasted quite longer than I anticipated. So, I peeked into the device usage history, which was a trove of data Amazon has kindly stored. In fact, I wrote a web scraper to download all this data. Sadly, records only go back to two weeks. Nevertheless, I plotted the data and surprisingly the pattern revealed that battery level gets affected by temperature change. Cool, isn't it? Finally managed to change the battery. Also, I might just plug in a rechargeable one next time so as to not be a part of the 'throw-away battery' culture. All in all, quite an interesting discovery, courtesy of my Amazon device battery.
[0:00] So I got this interesting email from Amazon.
[0:02] Apparently one of my batteries is going flat.
[0:05] So this is a device I connected up to Alexa on the 22nd of January 2023.
[0:10] Now, interestingly, I actually ordered this back on the 27th of November 2016.
[0:16] So this battery has lasted absolutely ages.
[0:18] So that’s pretty impressive.
[0:21] But even more interesting, there’s a link here and we can view the device usage history.
[0:25] So if we go over here to inventory history, you can see we’ve got lots and lots of measurements of the battery level.
[0:31] Now, that’s pretty cool to have this little chart, but it’s not particularly useful.
[0:36] But what’s really handy, if you look at the network requests when you’re hitting next,
[0:40] you can see it’s sending off this request to a server.
[0:43] And if we look at the contents of this request, you can see we’ve got all the data here.
[0:47] So with the help of my friend ChatGPT, I wrote a little web scraper to download all this data.
[0:54] So I’ve got my code here.
[0:56] All I need to do is copy out one of the cookies from these requests and paste it in.
[0:59] And then we can run this and it goes off and downloads all of the data from Amazon.
[1:04] So very nice of Amazon to store all my data for me.
[1:08] Now, unfortunately, it’s not all of my data.
[1:11] It only goes back to about two weeks ago.
[1:14] So the latest is on the 21st and it goes back to the 6th.
[1:19] But now I know this data is here, I might start downloading it regularly.
[1:22] So I’ve got my very own free IoT service.
[1:25] Although it does come at the cost of Jeff Bezos
[1:27] constantly sending me messages saying to buy new batteries.
[1:30] Now, what’s really interesting is what happens when we plot the data.
[1:34] So I’ve downloaded all the data.
[1:35] You can see here, if we look at these timestamps,
[1:38] you can see it’s recording a measurement pretty much every 15 minutes.
[1:41] So here’s one at 1.46, two minutes past two, 17 minutes past two, 32 minutes past two.
[1:47] So about every 15 minutes, it pings the device, gets the battery level and sends it off to Amazon.
[1:53] So if we plot this, it’s pretty noisy.
[1:55] So you can see there’s quite a noisy set of data here.
[1:58] But we can clean that up by averaging some of the values.
[2:01] And this is pretty interesting.
[2:02] There’s actually quite an interesting pattern here.
[2:05] If I put on markers for each day, it becomes even more interesting.
[2:09] So you can see every day there’s a bit of a pattern.
[2:11] So the battery voltage goes down, then it goes up, then it starts going down again.
[2:16] Now, if we zoom into just a couple of days, we can see this really clearly.
[2:20] Now, what’s happening is that if we look here at this particular day,
[2:24] you can see the battery level during the night keeps going down.
[2:27] So from midnight down to around 6 a.m., our battery level keeps decreasing.
[2:32] Then it starts going up again.
[2:34] Now, what’s interesting is our heating goes off overnight and our bedroom is pretty cold.
[2:39] So the temperature in the bedroom is going down from when the heating goes off.
[2:42] So if we move over to here, you can see around 8 or 9 o’clock, 10 o’clock,
[2:47] that’s when it starts getting dark here and our heating goes off pretty early.
[2:50] So the battery voltage starts going down as soon as the bedroom starts to get cold.
[2:54] And then during the night, the bedroom is quite cold and the battery level is quite low.
[2:58] Then around 7 o’clock or 6 o’clock, our heating comes on and the room starts warming up
[3:04] and the battery level starts going up again.
[3:06] So our battery level is ranging from around 5% capacity up to around 25% capacity.
[3:12] So that’s really interesting.
[3:13] Just goes to show the effect that temperature has on what your battery can output.
[3:17] And that is backed up by the science.
[3:19] So if we look at this chart here, you can see that at zero degrees,
[3:23] the output voltage from the battery is pretty low and it goes up as the temperature increases.
[3:28] Now, as I say, I’ve had this device for quite some time, so it is time to change the battery.
[3:32] But I thought that’s a really useful chart.
[3:34] Thank you, Amazon, for collecting this data.
[3:36] I’m pretty sure I did agree to you collecting this.
[3:38] I must have ticked a box at some point.
[3:40] So really handy.
[3:41] Let’s get the battery changed and I might try and plug in one of these rechargeable
[3:44] batteries instead of one of the disposable ones, because I don’t really like throwing
[3:48] batteries away, but I want to check the PCB and make sure it can handle the higher voltage.
[3:52] So I’ve taken the whole thing apart and to get the battery out,
[3:56] you do just need to remove this cover.
[3:58] But I thought it’d be interesting to take a look at the PCB and see what’s on it.
[4:02] Talking about PCBs, I’m sure you’ve heard of PCBWay.
[4:06] ♫ PCBWay ♫
[4:08] Go to PCBWay for all your PCBs. I’ve been using them for quite a while and I’ve had no problems,
[4:13] so I definitely recommend them.
[4:14] But let’s have a look at what’s on the PCB.
[4:16] We have this Atmel chip.
[4:18] This is some flash and this is a little MOSFET that turns power on and off to the flash.
[4:25] So it’s obviously designed for very low power.
[4:28] Now, looking at our battery, let’s just check our battery level.
[4:33] So let’s bring in the multimeter. We can measure the battery.
[4:37] So we have around three volts.
[4:39] If we compare that to a fresh coin cell.
[4:45] So let’s see what I’ve got here.
[4:48] Here we go.
[4:49] This is a 2032 cell, so it’s a bit smaller.
[4:53] But if we measure the voltage on this one, we have 3.14 volts.
[4:59] So quite a bit higher than our flat one.
[5:02] Now, what I was hoping to do is to replace this with a rechargeable lithium cell.
[5:08] The problem is these rechargeable lithium cells.
[5:12] I’ve got one here which I’ve fully charged.
[5:14] The voltage on this, if we measure it, is around 4.15 volts.
[5:22] So it will go up to 4.2 volts when it’s fully charged.
[5:25] Now, that would be fine if this PCB had a voltage regulator on it.
[5:31] Interestingly, the Atmel chip here that’s doing all the hard work and doing all the wireless stuff.
[5:38] Actually, you can see the onboard antenna here and the matching network.
[5:43] This does have an onboard regulator, but it only takes up to 3.6 volts,
[5:48] which is fine for a coin cell.
[5:50] Not so good for one of these rechargeable ones that goes much higher.
[5:53] The flash chip could take the voltage.
[5:55] It goes up to 4.5 volts, I think.
[5:58] So that would be fine.
[5:59] This IC here is a MOSFET and the Atmel chip is using that to turn power on and off to the flash.
[6:07] So it saves a lot of power by just turning everything off
[6:11] and going into low power sleep mode until you click one of the buttons.
[6:15] So, clicking the buttons, wakes up the chip, wakes up the flash
[6:20] and then does whatever it needs to do and then goes back to sleep again.
[6:23] So pretty interesting.
[6:24] It’s a very minimalist PCB, not much on it.
[6:27] Only really two ICs, the CPU and the flash.
[6:30] So I’ve got a few of these coin cells on order.
[6:34] I didn’t realize that it takes bigger ones, not small ones.
[6:38] It’s probably why the battery lasted so long because it’s quite a big cell really.
[6:43] So we’ll plug that in tomorrow and then we’ll check with Amazon
[6:46] and see if the battery reports full power.
[6:48] So via the magic of television, the new batteries have arrived.
[6:53] I’ve unwrapped this one already.
[6:55] Let’s measure the voltage and see what we have on this brand new fresh battery.
[7:01] So 3.25 and then this is the old flat battery.
[7:10] Three volts.
[7:13] Let’s test these batteries under some load.
[7:15] So I’ve got a 1k resistor here.
[7:17] Bend the wires so that it makes a good contact and stick the battery between them.
[7:25] And this is the old flat battery, so 2.9.
[7:29] Let’s try that on our new fresh battery.
[7:33] Still 3.2.
[7:40] Get the probes the right way around.
[7:42] 3.2.
[7:44] So there you go.
[7:45] Pretty good.
[7:47] So let’s get this new battery installed and then we’ll monitor the voltages
[7:51] or the battery capacity from Amazon.
[7:54] So I thought I’d do an interesting experiment.
[7:56] I’ve put the old battery in the fridge for a few minutes.
[8:00] Let’s see how it performs now.
[8:02] So get the connection.
[8:04] So before it was 2.9, now 2.8.
[8:11] So the battery being cold definitely seems to affect the performance.
[8:15] So that’s pretty interesting and matches up what we’re seeing in the data.
[8:19] So that’s good.
[8:20] The science appears to work.
[8:22] So I’ve just been warming the battery up in my hand and it’s now nice and warm.
[8:27] So let’s do the same test again.
[8:33] Back up to, well possibly even higher, 2.95 because the battery is now at body temperature.
[8:38] So yeah, really interesting.
[8:41] Let’s see what the chart is like from Amazon after a couple of days.
[8:44] Well unsurprisingly it’s not the most interesting of charts.
[8:48] Our battery is reporting 100% all the time.
[8:51] So I’ll keep an eye on this over the next few months and see what happens.
[8:55] But it’s fixed now.
[8:57] Battery works.
[8:58] An interesting project.