Smart Power Bank Keep-Alive

Ever wanted to power a project from a USB power bank, only to have it keep shutting itself off because the current draw was too low? This project aims to fix that with these handy and slightly over-engineered USB modules containing a microcontroller, op-amp, MOSFET and a few other bits to create a pulsed adjustable constant current sink, as well as supporting USB 3 pass-through!

A quick hack to keep power banks alive is to use something like a 150R resistor across the power output to draw an extra 33mA, but some power banks might need as much as 100mA to stay on, requiring a 50R 1W power resistor. Usually, power banks don’t need to have current continuously flowing to stay on, where a 2 second pulse every 15 seconds might be enough to keep it alive. This pulsing technique drastically improves the battery life of the power bank, perfect for powering a small project for a few weeks. Some unbranded power banks were tested to find their required current draw and shutdown timeouts:

Power bank #Keep-alive currentTimeout
1100mA10 seconds
230mA16 seconds
310mA18 seconds

The smarts of this device is an ATtiny10 which controls the on and off cycling of the constant current sink (pulse duration and interval is adjustable via firmware). The current is adjustable via a small trim potentiometer from 0mA to 140mA and the supply voltage can be anywhere from 1.8V to 5.5V.

These power bank keep-alive modules are available to buy from my Tindie store! Or they can be ordered directly from me, send an email to

Designs and firmware are on my GitHub


2 pings

    • George on February 27, 2021 at 3:59 pm
    • Reply

    I’m curious about the choice of a P-channel mosfet here. It seems when the opamp lowers the gate voltage to turn it on, the source voltage would also drop, so the net effect would be to drastically lower the transconductance “gain”. And even if the gate is grounded, there will still be the Vgs threshold voltage across the mosfet, so the maximum shunt current is reduced.

    I’m used to seeing an N-channel used in this “low-side” configuration, and would appreciate an explanation of why you used the P-channel instead of an N-channel.

    1. Hey George, the main reason I used a P-MOSFET here was so that the drain, where the power is dissipated, can be directly connected to the large ground plane which helps with keeping the MOSFET cool. An N-MOSFET would have the drain connected to the supply voltage instead. However, I think SOT-23 package MOSFETs usually have the drain pad wire bonded to the pin the same way as the source and gate pins, so it probably doesn’t make much difference, hah.

      The circuit is a typical constant current source, but without an output load which then makes the MOSFET the load, dissipating all of the power. The load would normally sit between drain and ground.

  1. […] published another interesting project. This time it is a USB device that aims to keep your power bank from powering down due to low current draw. He […]

  2. […] Kemble blogs about a small USB pass-through which keeps a USB power bank (cell phone/mobile charger) from shutting […]

Leave a Reply

Your email address will not be published.

Are you human? *