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!
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.
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.
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.
精彩评论