maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   BatteryGraph(like) tool that shows power CONSUMPTION? (https://talk.maemo.org/showthread.php?t=61344)

MasterZap 2010-08-29 11:29

BatteryGraph(like) tool that shows power CONSUMPTION?
 
Aloha friends.

Does anyone know of a version of a BatteryGraph style tool (or can entice the Author of BatteryGraph to add as a feature) that can show the moment-to-moment actual power consumption?

In my old N95 I had the Nokia Energy Profiler, which is similar to "BatteryGraph", except that it was much faster updating (every second), and could give a completely accurate draw of current in milliamps (or recompute into milliwatts based on voltage, if that floats your boat more)

http://www.symbian-freak.com/images/...7/11/NEP08.jpg

That way, finding power draws on the device was *trivial*. You just turned something off, flipped over to the energy profiler, saw "oh, that saved me 64 milliamps, cool" etc.

It was very accurate and you could learn all sorts of interesting stuff from it (like the power draw profile of a 3G connection turning on, checking email, and closing down for example).

The N900 doesn't give me this, not even on the low level.

While the battery monitoring tools seems to - under the hood - actually measure current, it actually gives this to us, the user, as a cumulative power consumption of a diminishing mAh value (milliamp-hours).

This is nigh useless as an aid to judge power _draw_, because you end up having to judge slopes of curves in BatteryGraph.

If nobody can find the actual current count (which is possible the system hides from us, if we are on lucky), then what I would like BatteryGraph to do (or a similar tool) would be to measure the value the OS *does* give us... but display it as a delta, i.e. how much did the "mAh" count change during the last X seconds? (Someone told me this value updates only every 5.12 seconds?)

This could be drawn is a separate curve in BatteryGraph, that could then much more easily be used to judge actual momentary draw.

Someone? Opinions? Thoughts?


/Z

ossipena 2010-08-29 12:38

Re: BatteryGraph(like) tool that shows power CONSUMPTION?
 
it isn't really very accurate. Yes you can compare it to another numbers calculated similarily but 64mA doesn't mean you get exactly the amount of current saved elsewhere.

But I agree that such app would be pretty nice to have..

One solution could be different approach from battery eye etc: calculate numbers without a daemon, 1-2 times per second and when you close the app, power consumption stops too.

Matan 2010-08-29 12:55

Re: BatteryGraph(like) tool that shows power CONSUMPTION?
 
The current draw (as you said, averaged over a 5.12s time span) can be read from the BQ27200 chip. You can either use the bq27x00_battery driver (in kernel-power) and read the value from /sys/class/power_supply/bq27200-0/current_now, or talk directly to the BQ27200 over I2C, using i2c-tools. Read the relevant register with the command

i2cget -y 2 0x55 20 w

In both methods, note that the units are unknown, so you can tell when the N900 uses a lot of power or a little power, and you can tell the ratio between a lot and a little, but you can't know exactly how much mAh are drawn.

ossipena 2010-08-29 14:05

Re: BatteryGraph(like) tool that shows power CONSUMPTION?
 
imo units are useless. only delta (=difference) means something. for example cut power consumption to half vs 80mA, which one tells more?

I'll see if I can scrape simple python app together.

yorg 2010-08-29 14:33

Re: BatteryGraph(like) tool that shows power CONSUMPTION?
 
couldn't you calculate the consumtion by using the battery eye data?

I mean isn't the consumption the derivative of the graph?

BabelO 2010-08-29 15:46

Re: BatteryGraph(like) tool that shows power CONSUMPTION?
 
Quote:

Originally Posted by Matan (Post 801404)
The current draw (as you said, averaged over a 5.12s time span) can be read from the BQ27200 chip. You can either use the bq27x00_battery driver (in kernel-power) and read the value from /sys/class/power_supply/bq27200-0/current_now, or talk directly to the BQ27200 over I2C, using i2c-tools. Read the relevant register with the command

i2cget -y 2 0x55 20 w

In both methods, note that the units are unknown, so you can tell when the N900 uses a lot of power or a little power, and you can tell the ratio between a lot and a little, but you can't know exactly how much mAh are drawn.

Hi,

Why do you say units are unknown ? according to bq27200 datasheet just divide by 20 to get mA / mAh / mW depending of register you want to read you can also get minutes.

20 is the 0.02 ohm resistor, i think nokia just follow this recommandation when building n900

Fabrice

Matan 2010-08-29 15:54

Re: BatteryGraph(like) tool that shows power CONSUMPTION?
 
Quote:

Originally Posted by BabelO (Post 801507)
20 is the 0.02 ohm resistor, i think nokia just follow this recommandation when building n900

There is no reason to think that.

BabelO 2010-08-29 17:27

Re: BatteryGraph(like) tool that shows power CONSUMPTION?
 
Quote:

Originally Posted by Matan (Post 801517)
There is no reason to think that.

When i design an electronic circuit, usually i follow the typical application circuit.

I do some test and the values looks good

ossipena 2010-08-29 18:24

Re: BatteryGraph(like) tool that shows power CONSUMPTION?
 
damn my apt -system is broken, so my efforts stopped almost before they began.... I hope I can fix it without reflash..

shadowjk 2010-08-30 12:12

Re: BatteryGraph(like) tool that shows power CONSUMPTION?
 
I use 20 (Also note that there's another factor, 3.57 or something like that, check the datasheet), and others use 21 or 22 as value for the sense resistor.

MasterZap 2010-08-30 13:41

Re: BatteryGraph(like) tool that shows power CONSUMPTION?
 
Well, as another poster noted, the "true" units isn't really what is terribly interesting to view; what I desire is a chart of the current_now value, in "whatever" units ... perhaps even simply as a percentage of a base value I define myself.... or whatnot.

Heck, I could perhaps hack together a phython hack myself to simply display it at some interval (together with a running, resettable average or somesuch).

But I suck at python, and you are all so much better at it than I ;)

(Plus ideally, I would entice the author of BatteryGraph to add that as a feature)

/Z


All times are GMT. The time now is 00:28.

vBulletin® Version 3.8.8