Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.mobile.android > #33370 > unrolled thread

How does an app estimate charging current?

Started byAardvarks <aardvarks@a.b.c.com>
First post2016-08-15 02:13 +0000
Last post2016-08-16 21:07 +0100
Articles 12 — 5 participants

Back to article view | Back to comp.mobile.android


Contents

  How does an app estimate charging current? Aardvarks <aardvarks@a.b.c.com> - 2016-08-15 02:13 +0000
    Re: How does an app estimate charging current? crankypuss <undisclosedUserid@gmail.com> - 2016-08-15 06:31 -0600
      Re: How does an app estimate charging current? David Taylor <david-taylor@blueyonder.co.uk.invalid> - 2016-08-15 17:37 +0100
        Re: How does an app estimate charging current? Aardvarks <aardvarks@a.b.c.com> - 2016-08-16 05:13 +0000
          Re: How does an app estimate charging current? crankypuss <undisclosedUserid@gmail.com> - 2016-08-16 05:28 -0600
            Re: How does an app estimate charging current? Aardvarks <aardvarks@a.b.c.com> - 2016-08-16 13:43 +0000
              Re: How does an app estimate charging current? crankypuss <undisclosedUserid@gmail.com> - 2016-08-17 04:59 -0600
          Re: How does an app estimate charging current? David Taylor <david-taylor@blueyonder.co.uk.invalid> - 2016-08-16 17:07 +0100
          Re: How does an app estimate charging current? Nigel Wade <nmw@local.domain> - 2016-08-17 15:50 +0100
            Re: How does an app estimate charging current? Aardvarks <aardvarks@a.b.c.com> - 2016-08-17 17:12 +0000
        Re: How does an app estimate charging current? crankypuss <undisclosedUserid@gmail.com> - 2016-08-16 05:22 -0600
          Re: How does an app estimate charging current? pamela <invalid@nospam.com> - 2016-08-16 21:07 +0100

#33370 — How does an app estimate charging current?

FromAardvarks <aardvarks@a.b.c.com>
Date2016-08-15 02:13 +0000
SubjectHow does an app estimate charging current?
Message-ID<nor8g4$jh1$1@gioia.aioe.org>
I'm having a problem that my Samsung S3 is not charging from the charging
cables (multiple cables, multiple chargers).

When I install battery charge apps, they report 0 ma when the cable is
connected. 

But, there is no ammeter inside of a Samsung phone, right?

So, how do the apps compute their charging current?
Is it accurate?

[toc] | [next] | [standalone]


#33377

Fromcrankypuss <undisclosedUserid@gmail.com>
Date2016-08-15 06:31 -0600
Message-ID<nosdg8$dku$3@dont-email.me>
In reply to#33370
On 08/14/2016 08:13 PM, Aardvarks wrote:
> I'm having a problem that my Samsung S3 is not charging from the charging
> cables (multiple cables, multiple chargers).
>
> When I install battery charge apps, they report 0 ma when the cable is
> connected.
>
> But, there is no ammeter inside of a Samsung phone, right?

Probably not as-such and software-readable, but the phone has no means 
of determining when the battery is fully charged other than measuring 
the current flow, so something's measuring it, whether or not that 
something is programmable.

There is an order-of-magnitude difference between really good charging 
circuitry and something that will charge a battery, and your Samsung 
phone is consumer-grade electronics, which implies that it's on the 
lower-end of the spectrum from something that squeezes the most juice 
into the battery in the shortest time.  Offgrid battery charging systems 
can get quite exotic in their measurements, doing things like applying 
various loads to the battery and measuring corresponding current flow, 
etc etc.  Your phone is doubtless more straight-forward than that since 
its intent is to procure profit for the manufacturer to make the next 
generation of quickly-obsolete profit-gathering technology.

>
> So, how do the apps compute their charging current?

Most likely the hardware generates a few charge-related interrupts, like 
"no voltage", "no current", and "charging", which in an Android machine 
get filtered through the bowels of the JVM and are eventually serviced 
by code that stashes the data for later app use.

> Is it accurate?
>

You can buy a USB tester for about $10 US that will show you the actual 
volts and amps.  I'd say that if your phone isn't charging, the first 
thing to check is the voltage level output by the charger or USB port 
you're trying to charge from.  If you're in a hurry and want to 
sacrifice a USB cable to the gods of multimeter connection, you could 
dig around a bit and find the appropriate USB connector pin-out diagrams 
somewhere (or maybe look for red and black wires for starters).

-- 
http://totally-portable-software.blogspot.com
   [Sat Mar 26: "Documentation and Portability"]

[toc] | [prev] | [next] | [standalone]


#33381

FromDavid Taylor <david-taylor@blueyonder.co.uk.invalid>
Date2016-08-15 17:37 +0100
Message-ID<nosr4m$1gk$1@dont-email.me>
In reply to#33377
On 15/08/2016 13:31, crankypuss wrote:
[]
> Probably not as-such and software-readable, but the phone has no means
> of determining when the battery is fully charged other than measuring
> the current flow, so something's measuring it, whether or not that
> something is programmable.
[]

A phone can measure the battery voltage, and perhaps the battery 
temperature to determine end-of-charge.  Many Li-ion cells have these 
measuring facilities built-in, which is why they have more than two 
terminals.
-- 
Cheers,
David
Web: http://www.satsignal.eu

[toc] | [prev] | [next] | [standalone]


#33395

FromAardvarks <aardvarks@a.b.c.com>
Date2016-08-16 05:13 +0000
Message-ID<nou7ct$gtd$1@gioia.aioe.org>
In reply to#33381
On Mon, 15 Aug 2016 17:37:42 +0100, David Taylor wrote:

> A phone can measure the battery voltage, and perhaps the battery 
> temperature to determine end-of-charge.  Many Li-ion cells have these 
> measuring facilities built-in, which is why they have more than two 
> terminals.

My battery is constantly draining even when the little lightning bolt shows
it's charging. This happens with multiple cables & chargers.

All the charging report apps I tried show 0 amps going into the battery:

Charging Report by PlayfulGeeks 
https://play.google.com/store/apps/details?id=com.playfulgeeks.chargingreport

Ampere by Braintrapp
https://play.google.com/store/apps/details?id=com.gombosdev.ampere

BatteryBot Battery Indicator by Darshan Computing, LLC 
https://play.google.com/store/apps/details?id=com.darshancomputing.BatteryIndicator

The phone also gets very hot to the touch, and sometimes shuts off the
charging (as if it was happening) saying the battery was too hot.

I think the microusb connector is the culprit but I don't know (as it's
soldered on in the Samsung Galaxy S3). 

The phone does have two files that I can "cat" with a terminal program, but
they always just have a "0" in them for the current.
http://www.programcreek.com/java-api-examples/index.php?source_dir=Battery-Indicator-Pro-master/src/com/darshancomputing/BatteryIndicatorPro/CurrentHack.java

I can "see" that file by opening up the Android terminal emulator to type:
cd /sys/class/power_supply/battery/
...
cat current_now (No such file or directory)
cat current_avg (0)
cat current_max (No such file or directory)
...
ls batt* (lots of stuff)

I think all the current apps just read one or more of those files.
But HOW does the current get *into* those files?

[toc] | [prev] | [next] | [standalone]


#33405

Fromcrankypuss <undisclosedUserid@gmail.com>
Date2016-08-16 05:28 -0600
Message-ID<nouus5$3mn$3@dont-email.me>
In reply to#33395
On 08/15/2016 11:13 PM, Aardvarks wrote:
> On Mon, 15 Aug 2016 17:37:42 +0100, David Taylor wrote:
>
>> A phone can measure the battery voltage, and perhaps the battery
>> temperature to determine end-of-charge.  Many Li-ion cells have these
>> measuring facilities built-in, which is why they have more than two
>> terminals.
>
> My battery is constantly draining even when the little lightning bolt shows
> it's charging. This happens with multiple cables & chargers.
>
> All the charging report apps I tried show 0 amps going into the battery:
>
> Charging Report by PlayfulGeeks
> https://play.google.com/store/apps/details?id=com.playfulgeeks.chargingreport
>
> Ampere by Braintrapp
> https://play.google.com/store/apps/details?id=com.gombosdev.ampere
>
> BatteryBot Battery Indicator by Darshan Computing, LLC
> https://play.google.com/store/apps/details?id=com.darshancomputing.BatteryIndicator
>
> The phone also gets very hot to the touch, and sometimes shuts off the
> charging (as if it was happening) saying the battery was too hot.
>
> I think the microusb connector is the culprit but I don't know (as it's
> soldered on in the Samsung Galaxy S3).
>
> The phone does have two files that I can "cat" with a terminal program, but
> they always just have a "0" in them for the current.
> http://www.programcreek.com/java-api-examples/index.php?source_dir=Battery-Indicator-Pro-master/src/com/darshancomputing/BatteryIndicatorPro/CurrentHack.java
>
> I can "see" that file by opening up the Android terminal emulator to type:
> cd /sys/class/power_supply/battery/
> ...
> cat current_now (No such file or directory)
> cat current_avg (0)
> cat current_max (No such file or directory)
> ...
> ls batt* (lots of stuff)
>
> I think all the current apps just read one or more of those files.
> But HOW does the current get *into* those files?
>

Sounds to me like maybe time to replace the phone.  Unless it's one of 
the increasingly-rare ones that have replaceable batteries, then you 
have to figure out whether just replacing the battery would do the job. 
IOW from what you've posted it sounds like the battery is shot and maybe 
the connector too.  Only so much diagnosis is useful, beyond that you've 
spent more time than a new phone costs.

Gee, do you have an iPhone yet?

[Sorry, irredeemable-smartass genes in my genetic mess.]

-- 
http://totally-portable-software.blogspot.com
   [Sat Mar 26: "Documentation and Portability"]

[toc] | [prev] | [next] | [standalone]


#33411

FromAardvarks <aardvarks@a.b.c.com>
Date2016-08-16 13:43 +0000
Message-ID<nov5aq$1rn7$1@gioia.aioe.org>
In reply to#33405
On Tue, 16 Aug 2016 05:28:43 -0600, crankypuss wrote:

> Sounds to me like maybe time to replace the phone. 

Actually, the phone is fine.
And I have a bunch of batteries since it takes a second to replace.
The problem isn't the phone or the batteries.
It's probably the connector.

>  Unless it's one of 
> the increasingly-rare ones that have replaceable batteries, then you 
> have to figure out whether just replacing the battery would do the job. 

I don't buy phones for myself that don't have sd cards and replacable
batteries.

> IOW from what you've posted it sounds like the battery is shot and maybe 
> the connector too.  Only so much diagnosis is useful, beyond that you've 
> spent more time than a new phone costs.

A new phone is about $200.

[toc] | [prev] | [next] | [standalone]


#33469

Fromcrankypuss <undisclosedUserid@gmail.com>
Date2016-08-17 04:59 -0600
Message-ID<np1jkb$2o1$3@dont-email.me>
In reply to#33411
On 08/16/2016 07:43 AM, Aardvarks wrote:
> On Tue, 16 Aug 2016 05:28:43 -0600, crankypuss wrote:
>
>> Sounds to me like maybe time to replace the phone.
>
> Actually, the phone is fine.
> And I have a bunch of batteries since it takes a second to replace.
> The problem isn't the phone or the batteries.
> It's probably the connector.
>
>>  Unless it's one of
>> the increasingly-rare ones that have replaceable batteries, then you
>> have to figure out whether just replacing the battery would do the job.
>
> I don't buy phones for myself that don't have sd cards and replacable
> batteries.
>
>> IOW from what you've posted it sounds like the battery is shot and maybe
>> the connector too.  Only so much diagnosis is useful, beyond that you've
>> spent more time than a new phone costs.
>
> A new phone is about $200.
>

Yeah, how many hours have you already wasted dicking around trying to 
diagnose the one you have?  You work way cheaper than I do, which might 
mean that one's priorities change as age increases the perceived value 
of one's time, or that your hobby is dicking around with junk.

-- 
http://totally-portable-software.blogspot.com
   [Sat Mar 26: "Documentation and Portability"]

[toc] | [prev] | [next] | [standalone]


#33415

FromDavid Taylor <david-taylor@blueyonder.co.uk.invalid>
Date2016-08-16 17:07 +0100
Message-ID<novdok$lvj$2@dont-email.me>
In reply to#33395
On 16/08/2016 06:13, Aardvarks wrote:
[]
> I think all the current apps just read one or more of those files.
> But HOW does the current get *into* those files?

You measure current by measuring the voltage drop across a know resistance.

-- 
Cheers,
David
Web: http://www.satsignal.eu

[toc] | [prev] | [next] | [standalone]


#33473

FromNigel Wade <nmw@local.domain>
Date2016-08-17 15:50 +0100
Message-ID<e1jbu9FdeccU1@mid.individual.net>
In reply to#33395
On 16/08/16 06:13, Aardvarks wrote:
> I can "see" that file by opening up the Android terminal emulator to type:
> cd/sys/class/power_supply/battery/
> ...
> cat current_now (No such file or directory)
> cat current_avg (0)
> cat current_max (No such file or directory)
> ...
> ls batt* (lots of stuff)
>
> I think all the current apps just read one or more of those files.
> But HOW does the current get*into*  those files?

/sys is a pseudo-filesystem which provides direct hooks into the kernel device drivers.
The "files" are not actual files, and when you read from them you are actually reading the kernel/device driver data structures directly.

So, nothing actually writes any values into /sys/class/power_supply/battery/

[toc] | [prev] | [next] | [standalone]


#33480

FromAardvarks <aardvarks@a.b.c.com>
Date2016-08-17 17:12 +0000
Message-ID<np25ti$1s2o$4@gioia.aioe.org>
In reply to#33473
On Wed, 17 Aug 2016 15:50:48 +0100, Nigel Wade wrote:

> /sys is a pseudo-filesystem which provides direct hooks into the kernel device drivers.
> The "files" are not actual files, and when you read from them you are actually reading the kernel/device driver data structures directly.
> 
> So, nothing actually writes any values into /sys/class/power_supply/battery/

Interesting. Thank you for that information.
I think *all* the battery-related programs are simply GUIs that interface
to those pseudo files.

[toc] | [prev] | [next] | [standalone]


#33404

Fromcrankypuss <undisclosedUserid@gmail.com>
Date2016-08-16 05:22 -0600
Message-ID<nouus4$3mn$2@dont-email.me>
In reply to#33381
On 08/15/2016 10:37 AM, David Taylor wrote:
> On 15/08/2016 13:31, crankypuss wrote:
> []
>> Probably not as-such and software-readable, but the phone has no means
>> of determining when the battery is fully charged other than measuring
>> the current flow, so something's measuring it, whether or not that
>> something is programmable.
> []
>
> A phone can measure the battery voltage, and perhaps the battery
> temperature to determine end-of-charge.  Many Li-ion cells have these
> measuring facilities built-in, which is why they have more than two
> terminals.

I'm fairly sure there are industry standards I'm unaware of that specify 
what information batteries provide.  On linux I've seen evidence that 
there are quite a few of these indicators, telling the company, model, 
capacity, and so forth.  But if the phone isn't charging, the first 
thing to do is determine whether the charger is at fault or the phone. 
Swapping chargers should tell that much, assuming access to a known-good 
charger.

-- 
http://totally-portable-software.blogspot.com
   [Sat Mar 26: "Documentation and Portability"]

[toc] | [prev] | [next] | [standalone]


#33426

Frompamela <invalid@nospam.com>
Date2016-08-16 21:07 +0100
Message-ID<XnsA666D6D1434BCD4AM2@207.246.207.110>
In reply to#33404
On 12:22  16 Aug 2016, crankypuss wrote:

> On 08/15/2016 10:37 AM, David Taylor wrote:
>> On 15/08/2016 13:31, crankypuss wrote:
>> []
>>> Probably not as-such and software-readable, but the phone has
>>> no means of determining when the battery is fully charged
>>> other than measuring the current flow, so something's
>>> measuring it, whether or not that something is programmable.
>> []
>>
>> A phone can measure the battery voltage, and perhaps the
>> battery temperature to determine end-of-charge.  Many Li-ion
>> cells have these measuring facilities built-in, which is why
>> they have more than two terminals.
> 
> I'm fairly sure there are industry standards I'm unaware of that
> specify what information batteries provide.  On linux I've seen
> evidence that there are quite a few of these indicators, telling
> the company, model, capacity, and so forth.  But if the phone
> isn't charging, the first thing to do is determine whether the
> charger is at fault or the phone. Swapping chargers should tell
> that much, assuming access to a known-good charger.

I have an Android app which monitors the battery when it is charging 
but on my tablet the app says some chips are missing so it can only 
give approximate info.  Presumably other devices have this chip which 
reports on battery activities.

On my tablet, the app says it will give an approximate value for the 
charging current although I'm not sure how it's doing that.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.mobile.android


csiph-web