0

For context: I'm working on an app where we're considering the use of iBeacon to identify other people nearby who are running the app. Any time that the app is running, the device acts as an iBeacon; when the user takes a particular action, their device will range nearby iBeacons to identify others nearby.

I'm trying to figure out what kind of impact this would have on the battery, to continuously broadcast as an iBeacon. It should be minimal (I mean, the whole point of Bluetooth low energy is that it's low energy, right?), but without running two identical devices side-by-side for a couple hours, one broadcast and one not, I'm not sure how to determine how much it will affect battery life.

I tried using the Energy Diagnostics profile in Instruments, but for Bluetooth, it's just on or off. This only changes if I disable/enable the Bluetooth on the device. Starting or stopping iBeacon broadcasting doesn't change anything. It seems unlikely that broadcasting as an iBeacon adds zero overhead on top of the already-running Bluetooth hardware, but Instruments doesn't give me enough info to know that for sure.

Any ideas?

Brock Boland
  • 15,870
  • 11
  • 35
  • 36
  • Be aware that it isn't possible to act as an iBeacon in the background -http://stackoverflow.com/questions/18944325/run-iphone-as-an-ibeacon-in-the-background – Paulw11 Aug 23 '14 at 22:40
  • Yeah, I was only counting on it broadcasting while in the foreground. – Brock Boland Aug 24 '14 at 23:24
  • Then I wouldn't worry too much about the BLE power consumption. The display will use much more battery – Paulw11 Aug 24 '14 at 23:36

1 Answers1

2

In making the Android Beacon Library, I had to figure out a way to do similar tests on that platform. The technique I used is brute force enough that it should apply to iOS as well.

I. Put your phone in a state where very little will be going on that is not related to your app.

  1. Uninstall or kill any apps that may be running in the background
  2. Disable 3G/Wifi (to prevent OS data transfers from using battery)
  3. Disable your screen from going to sleep (ever).
  4. Charge your battery to 100%

II. Take a measurement of how much your app drains the battery when transmitting as a beacon:

  1. Launch your app and make it transmit as a beacon.
  2. Disconnect your phone from the charger, and record the time.
  3. Wait several hours until your battery gets low. Record how much time has passed since the previous step.
  4. Record the battery level (e.g. 10%)

III. After charging your phone back to 100%, then take a baseline measurement:

  1. Launch you app in a state where it is not transmitting as a beacon.
  2. Disconnect your phone from the charger, and record the time.
  3. Wait exactly the same amount of time as in step II(3).
  4. Record the battery level.

The difference in the battery level between III(4) and II(4) is how much extra your phone uses when transmitting as a beacon vs the baseline.

Yes, this technique will take time -- but run the tests overnight, and you can have your answer in 48 hours. (Although you'll have a dead battery two mornings in a row!)

davidgyoung
  • 63,876
  • 14
  • 121
  • 204
  • 2
    I conduct battery testing like this on a daily basis with MANY different phones, and I will add to this that each phone is different, and even the same phone will be different between multiple tests. The more you run the tests and average out the results, the more likely you are to be able to accurately predict average battery consumption over time. – Mike Aug 23 '14 at 18:26