1
GiddyNaya
19d

How does my PC knows my battery needs replacement even on initial boot. What's the logic behind it?

Comments
  • 7
    There are standards to which most battery manufacturers adhere, and one of those standards is a set of monitoring and alarming APIs that are accessible by common tools used by all major operating systems and BIOS/UEFI implementations.
  • 1
    I think the part that does this is called voltage comparator.
  • 0
    @bahua Talking of apps, do you mean that the batteries are programmable?
  • 0
    @Pyjong any further insight?
  • 3
    BIOS/EFI can see batt controller's metrics. It can query its last full charge capacity and factory full charge cap. And make a diff between the two. If the capacity (max charge) is degraded too severely (a threshold predefined by the manufacturer), like 40% or 30% of the factory capacity is remaining, the alert is shown.

    A userspace analogy for Linux I have scripted a while ago: https://gitlab.com/netikras/... . it's the HEALTH parameter that I'm talking about.
  • 2
    @netikras thanks, that's an eye-opener for me.
  • 1
    @GiddyNaya

    The batteries themselves? No, I don't think so. But the tools used by the operating systems can of course be copied and reimplemented.
  • 0
    @GiddyNaya I don't know how it really looks on the motherboard. But it's basically an opamp so based on comparison of the battery output and some reference voltage, you get some output voltage. The output voltage has some described range of what's considered "power good".
  • 0
    In addition, most set a hard flag at specific number of cycles that is stored in uefi nvram.
  • 0
    @Pyjong Uhm no, that's at best suited for concluding that the battery needs charging, not replacement.
  • 0
    @Fast-Nop erm yeah, but given that you can't recharge the battery, doesn't that imply you will have to replace it?
  • 0
    @Pyjong Then the warning should have been coming much earlier along with hard shutdown to prevent deep discharge in the first place.

    One exception might be if you have single cell monitoring and can see that one cell is short-circuited, in which case the device should refuse to operate the battery because there's risk of fire. But even that is only useful if you have N cells in series, none in parallel.
  • 0
    @Fast-Nop I meant as in the battery isn't rechargeable.
  • 0
    @Pyjong The only non-rechargeable battery in a PC is the button cell on the mainboard for the BIOS settings. The main battery e.g. for laptops is always rechargeable.
  • 1
    @Fast-Nop ah ok, I thought that's the one we're talking about
  • 0
    Notebook batteries come with their own battery management IC and often even bring their own microcontroller to guarantee that it‘s a genuine battery
Add Comment