2

I want to measure how much battery is consumed while switching on Wifi, scanning and connecting to a an AP. I tried doing it with the API to see battery level. But that API gives battery level on a scale of 100 which is not granular enough to find out the power consumed in turning on the Wifi and scanning only once.

Is there a way out to measure this?

Reno
  • 33,594
  • 11
  • 89
  • 102
Anonik
  • 31
  • 4

4 Answers4

1

If you want to measure the power consumption in you phone and if you can do it using hardware I would suggest this: http://www.adafruit.com/products/904

It's a Current and Voltage sensor board, easy to use with an Arduino board. I've used it to get fine grained values every 6ms.

PowerTutor need to be calibrated (using hardware or datasheet values) for each device if you want to be accurate.

keoma
  • 128
  • 2
  • 8
0

Check out Powertutor. It is in my experience the best application out there to measure power consumption. It is not 100% accurate but is good enough for estimations. You can categorize by 3G, CPU, Wifi.. etc.

ishan
  • 1,029
  • 1
  • 12
  • 19
  • i am trying powertutor, but on the its interface as well as th log files, there is no mention of WiFi power consumption. I ran ping and client server file transfer programs, but the GUI showed zero power consumption by wifi. – junaids May 28 '16 at 08:19
0

You should read the value in /sys/class/power_supply/battery/batt_current.

That's the current consumption of the phone in mA. It's updated by the OS every minute or so.

Reno
  • 33,594
  • 11
  • 89
  • 102
  • Hi, as u had mentioned to use third party apps, I was interested to know, how apps like "Power Tutor" are able to measure power when there is no explicit API or software support. The current value of batter current and voltages are also updated after a minute or so in /sys/class/power_supply/ ...so then how does power tutor measure real time consumption of power by applications ? – Anonik Dec 09 '11 at 01:46
0

I don't think there is any such API to do this for WiFi. You'll have to use alternatives :

Community
  • 1
  • 1
Reno
  • 33,594
  • 11
  • 89
  • 102