0
\$\begingroup\$

I've got only a basing electronic background and I'm more experienced in programming :)

I'm going to use some power bank (PB) device with USB connectors to provide power to my embedded system. I planned to let this device working independently (mostly without personal control of it) and just get the SoC or SoP (state of charge/power) from this power bank. In case of low power of PB I wanted to just notify me via i.e. SMS and then shut down my embedded system.

The question is: do the power banks provide end user with such a communication protocol for gathering SoC/SoP from this power bank?

I know there is something like Power Delivery in USB and I was looking in Linux kernel sources for support for such a feature but found only:

https://docs.kernel.org/power/charger-manager.html

and not sure this is the right pointer I should read to start with controlling power bank?

It might look like there is some generic way for controlling power banks (as the charger manager exists in Linux) but I'm not sure if I'm not going wrong way.

Any other pointers how could I start this project?

\$\endgroup\$
7
  • 3
    \$\begingroup\$ While it's certainly possible to design a power bank which is able to notify connected devices of its state-of-charge (and/or any other parameters) as if it were a UPS, I've never met or heard of one which does so. \$\endgroup\$
    – brhans
    Commented Jul 20, 2023 at 12:24
  • 2
    \$\begingroup\$ This isn't really the target application for power banks, so there's no real incentive to add these features. \$\endgroup\$
    – Finbarr
    Commented Jul 20, 2023 at 12:36
  • \$\begingroup\$ Make one! Add a USB hub to it and hook into that one with a USB client capable MCU and you’ll have all the options from there. You can make it appear as a serial port which spits out SoC. \$\endgroup\$
    – winny
    Commented Jul 20, 2023 at 13:15
  • \$\begingroup\$ @winny: Hm... I'm not sure if writing my own BMS would be an easy task... I assume that this is what you suggested me :) \$\endgroup\$ Commented Jul 20, 2023 at 13:23
  • \$\begingroup\$ No need, you can either read SOC from the BMS or just measure the voltage. \$\endgroup\$
    – winny
    Commented Jul 20, 2023 at 13:46

1 Answer 1

1
\$\begingroup\$

No, USB power banks generally don't provide state of charge info over USB.

They might also not even know or care about their own state of charge in any way, as they might just shut down when battery voltage is low enough to be considered empty.

Having a USB powerbank monitor it's own battery like a laptop would mean there must be added electronics for battery monitoring and some interface to extract that information, standard or vendor specific. A laptop does this in a vendor specific way but the information is exposed via an API which the OS/drivers/programs can utilize. And sure, UPSes with USB connection allows a desktop PC OS to know the battery status, but the PC is the USB host and UPS is the USB device.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.