• PhilipTheBucket@ponder.cat
    link
    fedilink
    arrow-up
    22
    arrow-down
    5
    ·
    2 days ago

    The battery level your phone shows is just made-up bullshit. It’s roughly accurate of course, but they can’t really check how much charge is in the battery with 1:100 accuracy, so it just counts down at a roughly constant rate making adjustments to the rate based on rough measurements of broadly whether the battery is “real full” or “mostly full” or “almost empty” or whatever.

    • Limonene@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      8 hours ago

      It’s hard because it’s not a perfect linear relationship between battery voltage and battery percentage. When the battery is 80% full, the voltage hardly changes at all as it drains. But it can change significantly with unrelated factors, like age and temperature. So they have to use the integral of current consumption to calculate the battery level. There are other tricks, too, like using temperature to check battery percentage (when the battery is charging, it heats up if it’s nearly full), and some lithium ion batteries have a third wire for measuring the temperature.

    • Denjin@lemmings.world
      link
      fedilink
      arrow-up
      3
      ·
      21 hours ago

      Lithium ion battery chemistry is actually incredibly well understood and easily calculated as a point value and also extrapolated into capacity values using data on how you use your phone.

    • Death_Equity@lemmy.world
      link
      fedilink
      arrow-up
      25
      ·
      1 day ago

      The battery has a capacity reading down to the milivolts and the phone knows how much power it is using, which changes dynamically to meet the usage. The remaining battery level is determined by the voltage available at the current consumption. There is some averaging involved based on your usage profile.

      So your battery level is accurate at a given time, but changes based on what you are doing and what you have running. So your battery will drain faster if you are playing an intensive game, but will last far longer if you have nothing unessential running and the screen is in sleep mode.

      Apps like Facebook, chew through battery in the background because of how often it has to use resources to check for notifications, when when you don’t actually have the app open or in the recent apps list. So your battery will lose charge faster than you would expect when you haven’t been on your phone.

      so, naw lil bro.

      • tetris11@feddit.uk
        link
        fedilink
        English
        arrow-up
        3
        ·
        1 day ago

        The battery has a driver, which is written in software that indicates level based on an underlying profile of how the battery drains.

        Hence why Pixel4a users were suddenly shocked by an upgrade that halved their battery life because Google made a whoopsie on the battery profile.

        • Death_Equity@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          1 day ago

          We are saying the same thing, I was oversimplifying though.

          The profile is based on the voltage of the battery, the capacity, and the permissible amp draw. The actual voltage reading informs the device of the real remaining capacity because the device can’t read capacity and can only infer it based on historic data compared against the profile. Battery temperature is also a throttling factor, but we don’t need to get that far into the battery management weeds.

      • PhilipTheBucket@ponder.cat
        link
        fedilink
        arrow-up
        4
        arrow-down
        6
        ·
        1 day ago

        The remaining battery level is determined by the voltage available at the current consumption

        Gets all condescending about how it works

        Isn’t aware of the difference between V and mAh or the extremely horizontal (for most of the range) curve defining the relationship between them for Li-ion batteries

        I got irritated enough by people spouting off at me to look up how it actually works, it’s not at all how you are describing, although describing it as “bullshit” is probably a stretch

        So naw big bro

    • rc__buggy@sh.itjust.works
      link
      fedilink
      arrow-up
      8
      ·
      edit-2
      1 day ago

      My brother in Christ, may I show you the glory of the Multimeter? You can check voltage of any battery or even individual cells if you can isolate them.

    • Ilovethebomb@sh.itjust.works
      link
      fedilink
      arrow-up
      7
      ·
      1 day ago

      You can get a voltage sensor that is accurate to three decimal points for literal cents, so yes, your phone does know how much energy is left in the battery. It also has current sensors, so knows how much energy is being used.

      • 𞋴𝛂𝛋𝛆@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        1 day ago

        It does not know the capacity loss of the cell over time. That is why you should let the battery go completely dead and then charge it to max capacity as this will recalibrate the coulomb meter on the battery manager - batman

          • 𞋴𝛂𝛋𝛆@lemmy.world
            link
            fedilink
            English
            arrow-up
            3
            ·
            1 day ago

            It tries but the value is floating until it actually has a full charge cycle. There is no way to know what the entire voltage range is. You’re getting into how efficient the chemistry is over time and that is impossible to measure. It can be estimated, but that is all theoretical and not real. When the battery is fully discharged, the time, temperature, and current can be used to determine Coulombs and that is the actual energy capacity.

            I’m not an expert, but I have built many circuits. My main experience here is in reverse engineering some gaming hardware that had an advanced battery management chip from Diode Semiconductors. That had such a Coulomb battery meter. The board was a 3 layer PCB and I took that as a challenge. The batman chip was also a small ball grid array (pins are inaccessible on the back side. I didn’t have xrays when I did the first trace of all pins, so I had to fully understand the chip to trace all connections only using the vias. I think I have a chip or two in parts drawers that do the same thing, but I never built anything with them, or at least haven’t yet.

        • PhilipTheBucket@ponder.cat
          link
          fedilink
          arrow-up
          3
          arrow-down
          1
          ·
          1 day ago

          Preach sibling

          Idk how multiple super assertive people all got the idea that “voltage = battery percent” and all wanted to yell it at me the same time lol

      • PhilipTheBucket@ponder.cat
        link
        fedilink
        arrow-up
        2
        arrow-down
        2
        ·
        1 day ago

        I don’t think I am going to take confident proclamations about how it works from someone who thinks “voltage” translates to “how much energy is left in the battery”.

        https://batteryuniversity.com/article/bu-903-how-to-measure-state-of-charge

        I don’t really know how this stuff works, that’s why it is my conspiracy theory instead of me just giving fun facts. But, I don’t think you know how this stuff works either.

        It sounds like coulomb counting (current sensors, as you said) is often the method. Personally, I suspect there’s a decent amount of bullshit inserted into that to make it look “normal” when people are looking at how the number behaves, at the expense of accuracy. You might move your phone from cold to warm for example, and the usable energy in the battery might increase when that happens (or something) but it’s definitely not going to show your battery percent going up, even if it could detect it properly which I don’t think it can. Whether to say that means it’s “bullshit” is I guess a matter of opinion.

        • Ilovethebomb@sh.itjust.works
          link
          fedilink
          arrow-up
          3
          arrow-down
          1
          ·
          1 day ago

          Phones don’t use lead acid batteries, genius. I don’t know why you think that study is relevant.

          Also, your phone knows what the temperature of the battery is, and almost certainly takes that into account, although this affects the output voltage but not the amount of energy stored.

          • PhilipTheBucket@ponder.cat
            link
            fedilink
            arrow-up
            1
            arrow-down
            1
            ·
            edit-2
            1 day ago

            Li-ion is worse. I looked up a few different articles, I just kind of picked that one at random because I didn’t want to spend more time on it. This one is pretty succinct about it:

            https://www.pcbway.com/blog/PCB_Basic_Information/Important_Techniques_for_Determining_Battery_State_of_Charge_c46fe75a.html

            “This method is not suitable for some other cell chemistries like lithium-ion, which has a negligible change in its voltage throughout most of its charge/discharge cycle.”

              • PhilipTheBucket@ponder.cat
                link
                fedilink
                arrow-up
                4
                arrow-down
                1
                ·
                1 day ago

                My new conspiracy theory is that a gang of people have teamed up to try to wind me up on this particular topic in what was supposed to be a lighthearted nonsense-question to which I gave an appropriate nonsense-answer.

                You’re the only one who actually did arrive at something which is pretty much the actual answer (“coulomb counting”), although you keep mucking it up by saying things like you “can get a voltage sensor” to get the energy left in the battery, or “current through the battery” when the battery is the only part current does not flow through during discharge, or by making up wild random guesses that something is “almost certainly” taken into account. Just take all that extra stuff away and stick with “the phone monitors discharge” and you’ll be pretty much right.

                Hopefully we can put this whole endeavor behind us now, and go back to talking about Chipotle and chemtrails.