Spark Battery Life Testing

It looks like Test #7 finally died after roughly 4 days, 1 hour, 20 minutes, and 37 seconds. What a trooper!

Pinging: @bko, @peekay123, @BDub, @zachary, @satishgn - Do you guys have any thoughts about the weird sleep intervals detailed in my post above?

I am afraid that I donā€™t have any real insight into this. There is clearly a plateau in the data points if you exclude Test #7. That makes some sense to me since once your duty cycle becomes so low, the power consumption is dominated by other things like running the LDO regulator and leakage currents.

I donā€™t know what is magical about Test #7.

@wgbartley, I was looking at the code that sets the RTC wakeup alarm for deep sleep. It takes a uint32_t value in seconds so I donā€™t seen any reason for what might cause what you observed with the 1800s sleep. :frowning:

We're up to 1 week and still going!

3 Likes

Test #8 finally gave up last night after 1 week, 1 day, 7 hours, 1 minute, and 42 seconds.

2 Likes

These tests are great. Thanks for putting this together @wgbartley :slight_smile:

What we also need is to know what the average current consumption is when the Spark Core is in sleep and deep sleep modes. You could kind of determine that if you knew what the capacity of your battery was at the discharge rate of the Spark Coreā€¦ kind of hard to know for sure though since thatā€™s a chicken and egg problem.

If we know the average current consumption when the spark is sleeping and also the wake up current, then we can calculate how long it will last with a given battery.

Does anyone have a good current meter to test this with? If not I have a HP34401A that could be good enough.

I donā€™t have any fancy equipment. My fanciest is a cheap multimeter from Loweā€™s. My Weller soldering station is nice, but I use it way less than the multimeter.

It looks like all the tests finally finished. Since the final test was 30-minute intervals and didnā€™t come close to doubling the 15-minute test as far as battery time, I think the point of diminishing return lies between those two intervals, and probably closer to the 15-minute interval than the 30-minute side of things.

If anyone has any other tests theyā€™d like to see done with a Core and one of my batteries, let me know, and Iā€™d be happy to facilitate. Iā€™m only going to dedicate one Core for any additional testing so that I have some back in the pool for other projects!

1 Like

This is great data. I was just about to perform the same type of tests using 4 AA Eneloop batteries instead. Iā€™ll think Iā€™ll do some calcs on your data and perform some testing of my own and compare the results.

If there is a diminishing return after 15 minutes of sleep, might this suggest it doesnā€™t actually stay asleep for longer than 15 minutes? Averaging a longer sleep current with fixed brief wake currents should just get better and better the longer you are asleep. The bulk of the batteryā€™s capacity should be consumed in the wake current, so a longer sleep time should in fact prolong the run time.

Time to do some real current measurementsā€¦ Iā€™ll bust out the HP34401A.

Can you share whatā€™s at ā€œhttp://myhost.mydomain.tld/?l=test1ā€ so I can compare apples to apples? Iā€™m assuming this is some PHP script on your webhost. Thanks!

1 Like

@BDub, I spoke to @timb about this as well. It would be good to understand the peak current consumed during wakeup and the profile of current consumption. I measured over 500ma peak current on the 5V side but I donā€™t know for how long. That peak may affect the battery life if it nears or exceeds it max A/hr rating. Food for thought. :smile:

I thought it might be something similar to that. However, the true update interval is close to 30 minutes, so it definitely sleeps or stays in some sort of not-powered-up-and-connected-to-wifi mode for the full ~30 minutes.

I've uploaded the code to GitHub here -- GitHub - wgbartley/simple-logger

I have my HP34401A setup and measuring current within a couple uA. Just need that server side code from @wgbartley :wink: Got it!

@peekay123 first off, letā€™s not confuse battery life with battery capacity. Battery life would describe how many charge/discharge cycles youā€™ll get, while capacity is how many mA/hā€™s you get out of the battery in one discharge cycle (which varies with load current and ambient temperature).

Basically with WGā€™s 600mAh lipo, 500mA peaks are not going to affect itā€™s battery life at all. Lipos are easily rated for 1C, if not 10-20C and up discharge rates. C is the capacity of the battery in Amps per Hour. So WGā€™s battery would be 1C = 600mAh which means you could discharge it at a constant 600mA for 1 hour before itā€™s dead. This varies from battery to battery so you have to check the datasheet for all of the specifics. If you discharge a battery at a higher C rate like 5C or 10C you might only get 90% or 80% of the capacity rating of the battery. So for 5C you would discharge it at a 3A rate (600mA x 5), and you might expect it to last for 60min/5, but in reality it will probably be somewhat less than that due to more internal heat dissipation and chemistry crap ā€¦ so maybe 3A for 10 mins instead of 12 mins. You typically wonā€™t see the battery capacity go up if you use lighter loads though, itā€™s not really inversely proportional like that.

Which is why these little peaks of 500mA wonā€™t do much except be a much higher load than the sleep current, and averaged over time will look like a very small load (say a couple mA). So then essentially you can take 600mA and divide by 2mA letā€™s say, and get 300 hours of run time. Iā€™m totally just guessing at numbers hereā€¦ off to measuring!

P.S. If you knew all of that stuff already, great! Iā€™m just kind of pretending like a bunch of people are listening to our conversation and donā€™t know already :wink:

@BDub, dude your killing me here! I use one wrong word and you on me like a fat kid on a smartie! :stuck_out_tongue:

The 500ma may not be a lot over an hour but itā€™s still a lot more than 350ma TI states. So what happens when the CC3000 takes a while to connect which Iā€™ve seen at times. That increases the A/hr consumption. The real question is whether that peak current is all CC3000 (hence not in our control) or is there a way to reduce it? :smile:

You don't have to pretend with me; I'm listening and didn't know until now. Well, I had an idea, but now I have a better idea. Thanks!

However, regarding the term "battery life", Wikipedia says it's both. :stuck_out_tongue_winking_eye:

This is like the Steve Jobs definitionā€¦ ā€œHow long a mobile device can work on a single charge of a rechargeable battery.ā€ Thatā€™s consumer crap, not engineering crap :smile:

1 Like

Spark Core is waking up, blinking D7 for 5 seconds, turning off D7 for 5 seconds, turning on D7, POSTing to a PHP script to log that it is alive, turning off D7, then going into DEEP SLEEP for 120 seconds, and repeatingā€¦ shown here is the first part all the way through to deep sleep. 142-145mA while awake, and 187uA in deep sleep. Running off of a USB port, you can see the voltage measurement on the Tektronix DMM916. Current measured with an HP 34401A accurate to within a few uAā€™s.

I did not see anything like 500mAā€¦ you can watch for yourself :wink:

Thatā€™s pretty low current when offā€¦ we know the LDO is consuming like 120 or 150uA all of the time so most of it is due to that beast. Still though, anything close to 100uA or less quiescent current is pretty decent for battery powered devices. Obviously lower the better though!

Now to test the long 30 minute wait and see if it powers up current wise at all during that time. If it does my meter will audibly click and Iā€™ll knowā€¦ thatā€™s about as high tech as Iā€™m going to get with it tonight.

BTW: Here is the setup loop that blinks the D7 led, really I changed it like this so I could reprogram the Core without having to factory reset it :wink:

void setup() {
    pinMode(D7, OUTPUT);
    uint32_t startTime = millis();
    while(millis() - startTime < 5000UL) {
        digitalWrite(D7, HIGH);
        SPARK_WLAN_Loop();
        delay(100);
        digitalWrite(D7, LOW);
        SPARK_WLAN_Loop();
        delay(100);
    }
}
3 Likes

Hereā€™s a little excel work showing how long the battery should last using my measured currents. I adjusted for your average uptime (looks to be about 20 seconds, i.e. it was taking a while to connect to wifi probably) and I also tweaked the battery capacity down to 450mA so that the time of the first test would match, about 12 hours. Then if you look at the rest of the tests, they match up pretty close. I wouldnā€™t be surprised if your 600mA battery wasnā€™t being fully charged, and had ~450mA of capacity :wink:

Average current calculation:

Runtime calculation:

Whatā€™s interesting is your 900 second test is kind of the outlier in the bunch. 600 and 1800 seem to match my chart pretty close.

BTW: the Core did sleep fully for 30 minutes (1800 seconds) and did not wake up early or anything.

So now if we keep doubling our sleep time, weā€™re sure to find the point at which there is a true diminishing return.

Ahaā€¦ itā€™s when the Wake Time and Wake Current is so diluted by the sheer amount of time that the core is Sleeping. The Sleep Current dominates and you canā€™t do any better than Battery Capacity / Sleep Current = Runtime Hours.

2 Likes

I know all of the batteries were fully charged when I started them. However, fully charged may not mean exactly 600 mAh. I'm going to label my batteries so I can keep track of them just in case I notice one not living up to it's labeled potential (like 450 mAh max charge?). I'll re-run the 900- and 1800-interval tests starting today and tomorrow (wedding anniversary today and Father's day tomorrow).

1 Like

The way to test it would be to charge it up however you did in previous tests. Then discharge it at a fixed constant current of typically a 1C rate, or 600mA. It should last 1 hour if it is 100% charged. If it doesnā€™t you can divide the discharge minutes by 60 and multiple by 100 for the capacity it did have. The constant current part might be the tricky part.

Happy Belated Anniversary and Fatherā€™s Day!

1 Like