battery life | pebble developer retreat 2014
DESCRIPTION
You can find the video recording here: http://youtu.be/TS0FPfgxAso Stuart Harrell, software engineer at Pebble, gives a talk about battery life and how to preserve it. This talk explains the effect of different system functions on battery life and discusses solutions to common battery life problems with apps. Day 2 - Video 1TRANSCRIPT
TITLE TEXT
BATTERY LIFE
STUART HARRELL
I’m an engineer on the firmware team. !
I spend a lot of time working on battery life. !
I also make Pebble apps (see right).
WHO IS THIS GUY?
25% of customers say that battery life is important to them (will probably rise) !
We may start telling customers about battery hogs (they don’t know) !
???
WHY YOU MIGHT CARE
First 10 minutes — guessing game !
Second 10 minute — getting more battery life in YOUR app !
Last 10 minutes — interactive demo
OVERVIEW
GUESSING GAME
1. Listen to scenario !
2. Ponder carefully !
3. Hold up fingers to show guess !
4. Be yourself
GUESS THE BATTERY LIFE
1. Less than 2 days !
2. Between 3 and 5 days !
3. Between 6 and 12 days !
4. More than 12 days
PRACTICE ROUND! (MINUTE WATCH FACE)
Answer is 4. More than 12 days. (14 days)
PRACTICE ROUND! (MINUTE WATCH FACE)
1. Less than 2 days !
2. Between 3 and 5 days !
3. Between 6 and 12 days !
4. More than 12 days
BACKLIGHT ON CONSTANTLY
Answer is 1. Less than 2 days. (4 hours)
BACKLIGHT ON CONSTANTLY
1. Less than 2 days !
2. Between 3 and 5 days !
3. Between 6 and 12 days !
4. More than 12 days
WATCH FACE WITH SECONDS
Answer is 3. Between 6 and 12 days. (9 days)
WATCH FACE WITH SECONDS
1. Less than 2 days !
2. Between 3 and 5 days !
3. Between 6 and 12 days !
4. More than 12 days
WATCH FACE WITH MINUTE ANIMATION
Answer is 3. Between 6 and 12 days. (11 days)
WATCH FACE WITH MINUTE ANIMATION
1. Less than 2 days !
2. Between 3 and 5 days !
3. Between 6 and 12 days !
4. More than 12 days
WATCH FACE WITH MINUTE, BLUETOOTH OFF
Answer is 4. More than 12 days. (36 days)
WATCH FACE WITH MINUTE, BLUETOOTH OFF
1. Less than 2 days !
2. Between 3 and 5 days !
3. Between 6 and 12 days !
4. More than 12 days
CONSTANT ANIMATION
Answer is 1. Less than 2 days. (1 day)
CONSTANT ANIMATION
1. Less than 2 days !
2. Between 3 and 5 days !
3. Between 6 and 12 days !
4. More than 12 days
GRABBING WEATHER ONCE PER MINUTE
Answer is 3. Between 6 and 12 days. (6 days)
GRABBING WEATHER ONCE PER MINUTE
1. Less than 2 days !
2. Between 3 and 5 days !
3. Between 6 and 12 days !
4. More than 12 days
GRABBING WEATHER ONCE PER SECOND
Answer is 1. Less than 2 days. (18 hours)
GRABBING WEATHER ONCE PER SECOND
RECAP
Backlight
Bluetooth
Constant Animation
Tick Timer
4 hours1 day at 30 fps6 days when using on minute18 hours when using on second36 days when turned off
14 days with minute watch face9 days with second watch face
TIPS AND TRICKS THAT *YOU* CAN USE
The CPU and bluetooth chip are power hogs !
Every time the CPU wakes up, it has a system upkeep cost !
Every time the bluetooth chip wakes up, it has to open the channel for communication and it remains in a high-power active mode for a short time
BATCHING
Sending app message on the minute = 6 day battery !
!
Sending app message on the second = 18 hours !
!
Sending 60 app messages on the minute = 6 day battery
BATCH BLUETOOTH USAGE
!
100 Hz with 25 sample batches = 12 day battery (very small impact) !
100 Hz with 1 sample batches = 8 day battery !
!
Above numbers are for when no processing is occurring. !
Accelerometer cost = how much CPU is turned on
BATCH ACCELEROMETER READINGS
Rotating house 30fps = 1 day battery !
Rotating house 10fps = 3 day battery !
!
More battery life or smoother animations? Which will your users prefer?
FPS MATTERS
1-pixel row at 30fps = 5 day battery !
1-pixel column at 30fps = 1 day battery !
!
!
Why? Our display draws row-wise. !
Consider trying to minimize the number of rows if you have a long-lasting animation
VERTICAL VS HORIZONTAL ANIMATIONS
Simplicity with minutes = 14 days battery tick_timer_service_subscribe(MINUTE_UNIT, handle_minute_tick); !
Simplicity with seconds = 9 days battery tick_timer_service_subscribe(SECOND_UNIT, handle_second_tick); !
Power consumption is a mix between waking CPU and drawing to the display
SECOND VS MINUTE WATCH FACES
Will drain a fully charged battery in 4 hours !
Be careful with light_enable !
Consider giving users a choice if you do want to keep the backlight on !
Don’t repeat my mistake!
DON’T LEAVE ON THE BACKLIGHT
SUMMARIZING
Backlight
Bluetooth
Constant Animation
Tick Timer
Avoid light_enable
Lower FPS and try to minimize the rows associated with the animation
Batch calls that use bluetooth whenever possible
Process data in larger batches (25) if your application permitsWaking the CPU every second is more expensive then waking every minute
Accelerometer
DEMO TIME
SCREENSHOT 1
SCREENSHOT 2
SCREENSHOT 3
Demo link: http://arcane-escarpment-6914.herokuapp.com !
!
!
!
Email me: [email protected] !
Tweet me: @StuartHarrell1
NOW IT’S YOUR TURN
11:00
Martijn
BLUETOOTH LE WORKSHOP