Go Down

Topic: Hack power bank to get remaining charge (Read 1 time) previous topic - next topic

mr_boris

May 30, 2019, 01:18 pm Last Edit: May 30, 2019, 01:20 pm by mr_boris
Hi folks, I want to use powerbank for my arduino project, but I also want to get info of remaining charge programmatically.

I wonder if there is any feature designed by manufacturer (xiaomi, Baseus, e.t.c.) which lets you to read this info via usb port? Or the only way is to remove the cover and connect to right pins?



I can't find too much info about it on the internet. I found one video in which some dude made controller with lcd display for his powerbank but w/o any details, schematics or code.

Maybe someone already did this? Any advice will be appreciated, thanks!

wvmarle

Four light sensors on the indicator LEDs should do the trick.

The charge indication won't be more precise than those four levels anyway, no matter how it's read.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

mr_boris

Four light sensors on the indicator LEDs should do the trick.

The charge indication won't be more precise than those four levels anyway, no matter how it's read.
Why only 4 leds indicator? There are powerbanks with the percentage indicator also.

wvmarle

Those you may be able to hack into.

Get one; open it up; see what you find. Or check the data sheet that comes with it, if the manufacturer offers a ready interface over the USB for this data they'll no doubt have it documented there.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

mr_boris

Those you may be able to hack into.

Get one; open it up; see what you find.
I guess in this case I will need to look at controller on the power circuit and search some datasheet.

The easiest way is to buy battery cells separately and make you own power controller for them (probably based on the same arduino board).

offers a ready interface over the USB
Is there any DIY charging controller which provide such feature?

wvmarle

Not that I'm aware of. Mostly as it's anything but trivial to get a useful estimate of battery charge that's much better than the 4-level indication most power banks give.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Hiddenvision

#6
Jun 16, 2019, 09:31 pm Last Edit: Jun 16, 2019, 09:54 pm by Hiddenvision
Some have a simple led level readout some have LCD.
I guess those with simple led level indicator will be easy to tap onto the pins and sense if they go active.

Those with LCD/Display I would imagine it would be simple enough to also monitor the pins to see what is displayed.

You could also perhaps use a current sense module, it would only tell you what is used and not what is left but if you wrote some clever calibration stuff it could be a fairly accurate method.

The latter is a very similar method to what is shown in the video you saw now that I watched it.

I can take some pictures of the various units I have and the PCB used on units with a percentage display and also some with simple led indicators for capacity. With luck may assist your desire to find a method to calculate remaining capacity.

There is also this eBay item that does offer a communication method of various stats via USB 292076965244. It is not a powerbank itself but could perhaps be used alongside of one.
Still waiting for mine to arrive but I would guess it will have some simple processor and again be much like what that fella in the video developed. Once they arrive I shall pop the hood and let you now what's inside if you want.

Hiddenvision

#7
Jun 18, 2019, 02:47 pm Last Edit: Jun 18, 2019, 09:37 pm by Hiddenvision
Ok scrap that last statement.
The two items I purchased arrived today,
nice enough but they do not offer any communication over either of the USB ports so they only display on the screen itself.

I guess I misunderstood the line "Communication function: Yes"

for reference this is the controller it contains.
http://www.nuvoton.com/resource-files/DS_N76E003_EN_Rev1.04.pdf

I'll have a probe around later to see if perhaps there is some debug lines that have any related output.

I suspect if some smart cookie was to make something similar, based on an atmel, with open source firmware compatible with the Arduino environment, they would become rich pretty quick.

Go Up