battery life | pebble developer retreat 2014

38
TITLE TEXT BATTERY LIFE STUART HARRELL

Upload: pebble-technology

Post on 01-Jul-2015

706 views

Category:

Technology


0 download

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 1

TRANSCRIPT

Page 1: Battery Life | Pebble Developer Retreat 2014

TITLE TEXT

BATTERY LIFE

STUART HARRELL

Page 2: Battery Life | Pebble Developer Retreat 2014

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?

Page 3: Battery Life | Pebble Developer Retreat 2014

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

Page 4: Battery Life | Pebble Developer Retreat 2014

First 10 minutes — guessing game !

Second 10 minute — getting more battery life in YOUR app !

Last 10 minutes — interactive demo

OVERVIEW

Page 5: Battery Life | Pebble Developer Retreat 2014

GUESSING GAME

Page 6: Battery Life | Pebble Developer Retreat 2014

1. Listen to scenario !

2. Ponder carefully !

3. Hold up fingers to show guess !

4. Be yourself

GUESS THE BATTERY LIFE

Page 7: Battery Life | Pebble Developer Retreat 2014

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)

Page 8: Battery Life | Pebble Developer Retreat 2014

Answer is 4. More than 12 days. (14 days)

PRACTICE ROUND! (MINUTE WATCH FACE)

Page 9: Battery Life | Pebble Developer Retreat 2014

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

Page 10: Battery Life | Pebble Developer Retreat 2014

Answer is 1. Less than 2 days. (4 hours)

BACKLIGHT ON CONSTANTLY

Page 11: Battery Life | Pebble Developer Retreat 2014

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

Page 12: Battery Life | Pebble Developer Retreat 2014

Answer is 3. Between 6 and 12 days. (9 days)

WATCH FACE WITH SECONDS

Page 13: Battery Life | Pebble Developer Retreat 2014

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

Page 14: Battery Life | Pebble Developer Retreat 2014

Answer is 3. Between 6 and 12 days. (11 days)

WATCH FACE WITH MINUTE ANIMATION

Page 15: Battery Life | Pebble Developer Retreat 2014

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

Page 16: Battery Life | Pebble Developer Retreat 2014

Answer is 4. More than 12 days. (36 days)

WATCH FACE WITH MINUTE, BLUETOOTH OFF

Page 17: Battery Life | Pebble Developer Retreat 2014

1. Less than 2 days !

2. Between 3 and 5 days !

3. Between 6 and 12 days !

4. More than 12 days

CONSTANT ANIMATION

Page 18: Battery Life | Pebble Developer Retreat 2014

Answer is 1. Less than 2 days. (1 day)

CONSTANT ANIMATION

Page 19: Battery Life | Pebble Developer Retreat 2014

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

Page 20: Battery Life | Pebble Developer Retreat 2014

Answer is 3. Between 6 and 12 days. (6 days)

GRABBING WEATHER ONCE PER MINUTE

Page 21: Battery Life | Pebble Developer Retreat 2014

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

Page 22: Battery Life | Pebble Developer Retreat 2014

Answer is 1. Less than 2 days. (18 hours)

GRABBING WEATHER ONCE PER SECOND

Page 23: Battery Life | Pebble Developer Retreat 2014

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

Page 24: Battery Life | Pebble Developer Retreat 2014

TIPS AND TRICKS THAT *YOU* CAN USE

Page 25: Battery Life | Pebble Developer Retreat 2014

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

Page 26: Battery Life | Pebble Developer Retreat 2014

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

Page 27: Battery Life | Pebble Developer Retreat 2014

!

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

Page 28: Battery Life | Pebble Developer Retreat 2014

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

Page 29: Battery Life | Pebble Developer Retreat 2014

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

Page 30: Battery Life | Pebble Developer Retreat 2014

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

Page 31: Battery Life | Pebble Developer Retreat 2014

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

Page 32: Battery Life | Pebble Developer Retreat 2014

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

Page 33: Battery Life | Pebble Developer Retreat 2014

DEMO TIME

Page 34: Battery Life | Pebble Developer Retreat 2014

SCREENSHOT 1

Page 35: Battery Life | Pebble Developer Retreat 2014

SCREENSHOT 2

Page 36: Battery Life | Pebble Developer Retreat 2014

SCREENSHOT 3

Page 37: Battery Life | Pebble Developer Retreat 2014

Demo link: http://arcane-escarpment-6914.herokuapp.com !

!

!

!

Email me: [email protected] !

Tweet me: @StuartHarrell1

NOW IT’S YOUR TURN

Page 38: Battery Life | Pebble Developer Retreat 2014

11:00

Martijn

BLUETOOTH LE WORKSHOP