Author Topic: USB Battery Bank Auto Shutoff  (Read 4366 times)

0 Members and 1 Guest are viewing this topic.

Offline engrguy42Topic starter

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
USB Battery Bank Auto Shutoff
« on: May 11, 2020, 11:58:28 pm »
Interesting...you learn something new every day.

I have a 10 amp-hour battery bank for USB stuff (cellphone, etc.) lying around, and it occurred to me "hey, it's free 5 volts, why the heck not use it?". Quick and easy for a quick, flat, 5V....and 10 AH is nothing to sneeze at.

So I tried it (modified a USB cable to just use the power wires) and it works great. Until it suddenly shut off. I was powering some stuff, and suddenly it shuts off all by itself. WTF??

So apparently those battery banks have internal circuitry to shut the thing down when it thinks nothing is connected. Go no, right?

So the other day I just happened to finish some software to access my Labjack USB data acquisition device, and it grabs data and plots it. So I figured I'd try to get to the bottom of this. So I hook up the battery to the Labjack, turn on the recorder, and it gives me the attached plot. With no load on the bank it shuts off about 35 seconds after you turn it on.

So I then applied a 20 ohm resistive load (250mA) and it stayed on forever. So I tried a 47 ohm resistor (106 mA) and it stayed on forever. So I applied a 100 ohm load (50 mA) and it shut off in 35 seconds.

So apparently these things shut off if there's less than 100-150 mA of output current. So what people do is put together a circuit to apply a burst of load every 10 or 15 seconds to keep the thing awake. Of course you could just tie a resistor, but that's just a waste of amp hours.

I'm curious, anyone know of a cheapo device I can get to do this load cycling? I saw a TI paper on this phenomenon, and they have some recommended circuits, but I'm too lazy  :D

Thanks.

« Last Edit: May 12, 2020, 12:03:08 am by engrguy42 »
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #1 on: May 12, 2020, 05:03:27 am »
Power banks are designed  to charge other batteries, such as your phone's battery.  Partly to save their own battery power, and partly out of concerns about lithium battery safety, they are designed to shut down when the other battery has been fully charged.  And they conclude the charging is finished based on the low current draw.  But if "low" means 100mA, that won't work for most microprocessor projects.  And you know, sinking excess current just to keep the powerbank turned on kinda defeats the purpose of battery power.

There is a line of powerbanks by Voltaic Systems which have an "always on" option, but they are about US$30.  And there is this much cheaper design that's only safe to use for 60mA loads or less if you are also charging the powerbank at the same time:



Apparently, sinking extra current periodically, as you described, works to keep most powerbanks on.  I'm not familiar with the circuit you described to do that, but maybe someone will point us to it.
 

Offline engrguy42Topic starter

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #2 on: May 12, 2020, 01:46:24 pm »
Okay, well I kludged together a 555 timer with some parts I had lying around and came up with the attached, which I tweaked in LTSpice.

Basically it turns a MOSFET on with 50% duty cycle to apply a 120mA load to the battery bank. It's pretty much 7 seconds on, and 7 seconds off. I suppose I could further tweak it to see how short I can make the ON time, but my knowledge of 555's is lost in a foggy memory from years ago.

Attached is the LTSpice circuit, which I duplicated on a breadboard, and then applied to the actual battery bank. BTW, that's the C# app I just finished last week to access and plot from my Labjack data acquisition unit, showing the input to the gate of the MOSFET. It came to the rescue just in time  :D

And, SUCCESS!!! The battery bank stays on indefinitely.

Any suggestions for shortening the duty cycle would be welcome. Thanks
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Offline engrguy42Topic starter

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #3 on: May 12, 2020, 02:04:51 pm »
If you need a really well built and full featured power bank, consider my pick, Huawei CP12S.

It is stupidly expensive at $45 for just 12000mAh, but it has a lot of features that are not common.

It offers the always on feature, which is enabled by double clicking its power button.

It can charge PD or FCP devices at up to 40W, including laptops and tablets.

It also can output 12V in QC mode, which is very rare. This made it perfect companion for my TS80 iron.

The only downside is it does not support UPS mode when output is not 5V. Other than that, it is an overall perfect power bank that fits in the most slim pockets.

Thanks, but it's something I rarely/never use in the first place, so replacing it isn't really under consideration. In fact, I could probably just tie a 22 ohm resistor to the output without all this stuff and be done with it.

But as it stands I can just look for a tiny plastic box, stuff these parts inside, and I'm good to go.

Thanks.
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: USB Battery Bank Auto Shutoff
« Reply #4 on: May 12, 2020, 02:35:57 pm »

Some battery banks don't have the auto-shutoff feature.

I have an old 13000mAh power bank here where the cells are so worn out that the capacity is only around 1,000mAh now...   but it doesn't auto shut down, so is great for powering an Arduino etc. for several days!
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #5 on: May 12, 2020, 02:37:33 pm »
I found this circuit:

https://www.electroschematics.com/pulse-generator-with-555/

But I think for long delays (tens of seconds) between pulses, you could need some kind of counter chip.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #6 on: May 12, 2020, 02:43:26 pm »

Some battery banks don't have the auto-shutoff feature.

I have an old 13000mAh power bank here where the cells are so worn out that the capacity is only around 1,000mAh now...   but it doesn't auto shut down, so is great for powering an Arduino etc. for several days!

Do you have a link to that one?  What I've found is that the circuits of these things have been "updated" over time to use new, cheaper, single-chip solutions that handle both charging and 5V output regulation, but that also include auto-off which can't be disabled.  So over time, they've pretty much all become auto-off even if they weren't that way a few  years ago.  Anyway, if you have a link to the one you have, I'd like to take a look at it.
 

Offline engrguy42Topic starter

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #7 on: May 12, 2020, 02:44:24 pm »
I found this circuit:

https://www.electroschematics.com/pulse-generator-with-555/

But I think for long delays (tens of seconds) between pulses, you could need some kind of counter chip.

You didn't see the circuit I posted?  :D
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #8 on: May 12, 2020, 03:01:45 pm »
I found this circuit:

https://www.electroschematics.com/pulse-generator-with-555/

But I think for long delays (tens of seconds) between pulses, you could need some kind of counter chip.

You didn't see the circuit I posted?  :D

Yes, but I thought you wanted to be able to generate a short pulse after a long delay, with both adjustable.  From what I've seen reported in the past, that will keep at least some of the powerbanks alive.  You could use the 555 to generate a clock, and something like a CD4020 or 4040 to generate the pulse.
 

Offline engrguy42Topic starter

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #9 on: May 12, 2020, 03:13:37 pm »
I found this circuit:

https://www.electroschematics.com/pulse-generator-with-555/

But I think for long delays (tens of seconds) between pulses, you could need some kind of counter chip.

You didn't see the circuit I posted?  :D

Yes, but I thought you wanted to be able to generate a short pulse after a long delay, with both adjustable.  From what I've seen reported in the past, that will keep at least some of the powerbanks alive.  You could use the 555 to generate a clock, and something like a CD4020 or 4040 to generate the pulse.

Thanks. I was hoping there's a way to adjust the R/C values in my existing circuit, or do some simple modifications, to tweak the duty cycle. This is one of those things that isn't really worth much investment, so if I can do some minor tweaks to what I have that's preferable.
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Offline engrguy42Topic starter

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #10 on: May 12, 2020, 03:26:53 pm »
Well after some searching I found you can apparently use this simple modification to get adjustable duty cycle on a 555...
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #11 on: May 12, 2020, 04:14:39 pm »
I keep having to remind myself, because I'm old, that the new way to deal with this kind of problem is to get a little 8-pin microcontroller like an ATTiny or PIC or MSP430 with its own internal oscillator, and program it to drive the mosfet with the exact pulse duration and interval you want.  That takes the place of all the 555 stuff, resistors, capacitors, pots, diodes, etc.  Cheaper, easier, more precise, fewer parts, less space, less power.

Anyway, I hope you'll report back with the final shortest, least frequent, lowest current, pulse you can get away with to keep the powerbank alive.  It may be that the total mAh penalty isn't all that great.
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: USB Battery Bank Auto Shutoff
« Reply #12 on: May 12, 2020, 04:24:20 pm »

Some battery banks don't have the auto-shutoff feature.

I have an old 13000mAh power bank here where the cells are so worn out that the capacity is only around 1,000mAh now...   but it doesn't auto shut down, so is great for powering an Arduino etc. for several days!

Do you have a link to that one?  What I've found is that the circuits of these things have been "updated" over time to use new, cheaper, single-chip solutions that handle both charging and 5V output regulation, but that also include auto-off which can't be disabled.  So over time, they've pretty much all become auto-off even if they weren't that way a few  years ago.  Anyway, if you have a link to the one you have, I'd like to take a look at it.

Mine is a "SCUD P130" but the same item was sold under many names, apparently - "Huawei AP007 13000mAh Portable Power Bank" and "FREMO P130" look exactly the same, for example.

Might be hard to find these now, they are definitely an old model.  I only found one for sale, and it wasn't cheap.
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: USB Battery Bank Auto Shutoff
« Reply #13 on: May 12, 2020, 04:26:28 pm »
I keep having to remind myself, because I'm old, that the new way to deal with this kind of problem is to get a little 8-pin microcontroller like an ATTiny or PIC or MSP430 with its own internal oscillator, and program it to drive the mosfet with the exact pulse duration and interval you want.  That takes the place of all the 555 stuff, resistors, capacitors, pots, diodes, etc.  Cheaper, easier, more precise, fewer parts, less space, less power.

Anyway, I hope you'll report back with the final shortest, least frequent, lowest current, pulse you can get away with to keep the powerbank alive.  It may be that the total mAh penalty isn't all that great.

That is exactly what to do for this kind of project, I think.  I abandoned a 555 project and used a Pro Mini Arduino simply because the timing of the 555 was less accurate, and it didn't do exactly what I wanted, and ended up being a lot more work than knocking up the 3 lines of code needed...   Welcome to 2020!
 

Offline engrguy42Topic starter

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #14 on: May 12, 2020, 04:27:10 pm »
Wow that last circuit I posted seems to work !!! At least in LTSpice...

Just need to tweak a bit to bring the OFF time down a bit. Coolness...
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Offline engrguy42Topic starter

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #15 on: May 12, 2020, 04:32:44 pm »
I keep having to remind myself, because I'm old, that the new way to deal with this kind of problem is to get a little 8-pin microcontroller like an ATTiny or PIC or MSP430 with its own internal oscillator, and program it to drive the mosfet with the exact pulse duration and interval you want.  That takes the place of all the 555 stuff, resistors, capacitors, pots, diodes, etc.  Cheaper, easier, more precise, fewer parts, less space, less power.

Anyway, I hope you'll report back with the final shortest, least frequent, lowest current, pulse you can get away with to keep the powerbank alive.  It may be that the total mAh penalty isn't all that great.

That is exactly what to do for this kind of project, I think.  I abandoned a 555 project and used a Pro Mini Arduino simply because the timing of the 555 was less accurate, and it didn't do exactly what I wanted, and ended up being a lot more work than knocking up the 3 lines of code needed...   Welcome to 2020!

And sometimes accuracy is irrelevant, as is spending any money and ordering stuff and starting from scratch when I have a perfectly good design already. Changing from 50% to any other duty cycle, like I said, is a nice-to-have but largely irrelevant.

Actually I'm kinda surprised there were no responses on how to design a PWM on an ever-so-popular 555. I thought you guys would be all over that.
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: USB Battery Bank Auto Shutoff
« Reply #16 on: May 12, 2020, 04:48:07 pm »
I keep having to remind myself, because I'm old, that the new way to deal with this kind of problem is to get a little 8-pin microcontroller like an ATTiny or PIC or MSP430 with its own internal oscillator, and program it to drive the mosfet with the exact pulse duration and interval you want.  That takes the place of all the 555 stuff, resistors, capacitors, pots, diodes, etc.  Cheaper, easier, more precise, fewer parts, less space, less power.

Anyway, I hope you'll report back with the final shortest, least frequent, lowest current, pulse you can get away with to keep the powerbank alive.  It may be that the total mAh penalty isn't all that great.

That is exactly what to do for this kind of project, I think.  I abandoned a 555 project and used a Pro Mini Arduino simply because the timing of the 555 was less accurate, and it didn't do exactly what I wanted, and ended up being a lot more work than knocking up the 3 lines of code needed...   Welcome to 2020!

And sometimes accuracy is irrelevant, as is spending any money and ordering stuff and starting from scratch when I have a perfectly good design already. Changing from 50% to any other duty cycle, like I said, is a nice-to-have but largely irrelevant.

Actually I'm kinda surprised there were no responses on how to design a PWM on an ever-so-popular 555. I thought you guys would be all over that.

I guess the reason is that it can be a lot more work to get a 555 circuit to do certain things than a $2 Arduino.  I tried this recently for a hobby project that needed something similar (a pulse every 15 - 30 minutes in my case) and it was surprisingly hard to get a 555 to do that.
 

Offline engrguy42Topic starter

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #17 on: May 12, 2020, 07:44:27 pm »
Houston, we have liftoff...

Got me some yummy PWM goodness. Tried the latest circuit I showed, it gives me 25% duty cycle (5 seconds ON, delivering 120mA, then  13 seconds OFF), and it keeps the battery bank on continuously.

Sweet. I think that's a wrap.
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #18 on: May 12, 2020, 10:11:36 pm »
That's great, but how about 1 second on, 13 seconds off?  Or 100mS on, or even 1mS on?
 

Offline engrguy42Topic starter

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #19 on: May 12, 2020, 10:19:33 pm »
That's great, but how about 1 second on, 13 seconds off?  Or 100mS on, or even 1mS on?

Do I owe you something??  :wtf:


 You're certainly welcome to do your own research, but personally I couldn't care less about what you seem interested in.
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #20 on: May 12, 2020, 10:45:42 pm »
No, certainly not.   Having gone this far, I just thought you might want to know how little current it would actually take to keep it alive.  But I guess that's not the case.
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: USB Battery Bank Auto Shutoff
« Reply #21 on: May 13, 2020, 01:58:06 am »

To get to the absolute minimum current to keep it alive will probably require a micro to do accurate timing, and go into deep sleep while it is waiting until the next "kick".

 

Offline engrguy42Topic starter

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Re: USB Battery Bank Auto Shutoff
« Reply #22 on: May 13, 2020, 07:34:46 pm »
Well, FWIW, this thing is all soldered and done, just waiting for a USB female plug and a box. Seems like a lot to go thru just to get a pulsed load, but hey, it should be of use for a long time.

I was surprised when it was all soldered that it actually worked !!! Now I have a solid 10 amp-hour, 5VDC supply.

Hmmm....do I need a boost converter?  :D
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: USB Battery Bank Auto Shutoff
« Reply #23 on: May 13, 2020, 09:12:31 pm »
Well, FWIW, this thing is all soldered and done, just waiting for a USB female plug and a box. Seems like a lot to go thru just to get a pulsed load, but hey, it should be of use for a long time.

I was surprised when it was all soldered that it actually worked !!! Now I have a solid 10 amp-hour, 5VDC supply.

Hmmm....do I need a boost converter?  :D

Looks good!  These 5V power banks are super useful for electronic projects. 

Would be cool to open one up and modify it inside.   Mine is completely sealed so it would not be a good candidate...  wonder if that is true of all of them...
 

Offline kjr18

  • Regular Contributor
  • *
  • Posts: 201
  • Country: pl
Re: USB Battery Bank Auto Shutoff
« Reply #24 on: May 15, 2020, 10:54:05 am »


Looks good!  These 5V power banks are super useful for electronic projects. 

Would be cool to open one up and modify it inside.   Mine is completely sealed so it would not be a good candidate...  wonder if that is true of all of them...

That would be difficult on some of them, as some of designs reuse parts inside for charging and boost, keeping smaller parts count. For it to work, they should has ups function. You don't really need to open them, just small box with plug and socket on the other side, even you could buy one of the cheapest usb doctors and use it's case for this purpose.
 
The following users thanked this post: SilverSolder


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf