如何计算使用wifi的Android手机的功耗?

发布于 2024-09-03 18:28:15 字数 118 浏览 7 评论 0原文

我在 Android 1.6 手机上实现了一个路由协议,该协议使用无线(自组织)网络来交换消息。现在我想从能耗的角度来评估它,基础是尝试计算传输单个数据包所浪费的能量,有人知道如何做到这一点吗?欢迎提供软件/硬件解决方案!

I have implemented a routing protocol on an Android 1.6 mobile that uses wireless (ad-hoc) network in order to exchange messages. Now I would like to evaluate it under an energy consumption point of view, the base would be to try to calculate the energy wasted to transmit a single packet, do anybody has any idea how to do that? Software/hardware solutions are welcome!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

也只是曾经 2024-09-10 18:28:16

我不相信任何应用程序都会给您带来任何形式的有意义的结果。您确实需要寻找硬件解决方案,并且它可能需要自制。

我用于手机功率测量的设置包括以下内容:

  • 稳压电源:应能够提供至少 3 安培的电流。
  • 采样电流表。您可能需要自己设计,使用小值精密电阻和 ADC 来测量电阻上的压降(这将为您提供电流)
  • ADC 可以是专有的采集卡 - 这些可以从来源轻松获得像 RS,具体取决于您所在的位置。对于此应用,它可能希望具有 1kHz 左右的采样率。
  • 用于从 ADC 捕获数据的软件。 NI LabView 最常用于此类应用。大多数不错的采集卡都支持 LabView,不过您可以使用任何您喜欢的东西。它们几乎都有 C API。
  • 一个虚拟电池,使此配置能够连接到手机。最简单的方法通常是扔掉真正的电池(小心,如​​果是锂离子电池!)。

当您设计系统时,请记住,6 或 9 伏电源的小值电阻器上的压降将非常小,因此您的 ADC 需要非常灵敏,才能获得有意义的结果。

一旦掌握了所有这些,您将能够随着时间的推移观察设备电流。您会发现这种差异远远超出您的预期。手机会一直打开和关闭各种电路。特别是,当访问蜂窝网络时,您会看到相当大的功率峰值。

经过一番调查后,您将能够看到 WiFi 何时启动,尤其是传输突发。

祝你好运。

I don't believe that any application will give you any form of meaningful result. You really need to be looking at a hardware solution, and it will likely need to be home-brew.

The set-up I have used for power measurement on mobiles consists of the following:

  • Regulated power supply: this should be capable of delivering at least 3 amps.
  • A sampling ammeter. You will probably need to design this for yourself, using a small value precision resistor and an ADC to measure the voltage drop over the resistor (which will give you the current)
  • The ADC can be a proprietary acquisition card - these are readily available from sources like RS, depending on your location. It probably wants to have a sampling rate of around 1kHz for this application.
  • Software for capturing data from the ADC. National Instruments LabView is most often used for this sort of application. Most decent acquisition cards have LabView support, although you can use anything you like. They nearly all have C APIs as well.
  • A dummy battery to enable this configuration to be connected to the phone. The easiest way to do this is normally to trash a real battery (carefully, if it's Li-Ion!).

When you are designing the system, remember that the voltage drop across a small value resistor for a 6 or 9 volt supply will be very small, so your ADC needs to be pretty sensitive for you to get meaningful results.

Once you have all of this, you'll be able to observe device current over time. You will find that this varies far more than you may expect. The phone will be turning on and off all sorts of circuitry all of the time. In particular, you will see fairly large power peaks when the cellular network is being accessed.

After a bit of investigation, you'll be able to see when the WiFi is powered up, and the transmit bursts in particular.

Good luck.

╰◇生如夏花灿烂 2024-09-10 18:28:16

我相信有许多应用程序可以跟踪应用程序的功耗。您可以使用其中之一来在激烈的测试期间观察您的应用程序。

编辑:可以尝试的一个应用程序是power coach。请注意,正如它所说,功耗可能会根据实际硬件的不同而有很大差异。您可能想在几个不同的平台上进行测试以查看差异。

I believe that there are a number of apps available that will track the power consumption of an application. You could use one of those to observe your application during an intense test.

Edit: One app to try would be power tutor. Note that as it says though, power consumption is likely to vary a lot depending on the actual hardware. You might want to test it out on a few different platforms to see the differences.

温柔戏命师 2024-09-10 18:28:16

是的,PowerTutor 是密歇根大学博士论文成果中最可靠的应用程序之一。 PowerTutor 为您提供 Android 上所有正在运行的应用程序的能耗。然而,该应用程序在 HTC G1、HTC G2 和 Nexus one 上运行得更加准确,因为它是为此类产品开发的。

Yes, PowerTutor is one of the most reliable application produced in result of a PhD thesis in University of Michigan. PowerTutor gives you energy consumption of a all running application on Android. However, this application is working more accurate on HTC G1, HTC G2 and Nexus one since it is developed for such products.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文