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.
@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.
These tests are great. Thanks for putting this together @wgbartley
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!
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!
@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.
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 have my HP34401A setup and measuring current within a couple uA. Just need that server side code from @wgbartley 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
@BDub, dude your killing me here! I use one wrong word and you on me like a fat kid on a smartie!
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?
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
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
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
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
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.
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).
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.