Powering Arduino from a power bank

Hi all. Found this one which is mentioned which seems to do exactly what people need: https://www.voltaicsystems.com/always-on

Paul

I had the same problem but solved it with a 555 timer and 3906 PNP transistor, this circuit draws about 200 mA for 1.6 seconds every 13 seconds, but you have to experiment a bit with the main capacitor and the resistors on the timer side of the 555 chip, because these power packs have different cut-off current settings.

See the website for the circuit diagram.

https://www.instructables.com/id/Current-Pulsing-Keeps-Power-Bank-Active/

It works fine for me!

This seems to be a recurring theme here. I guess the search does not yield clear enough results:

https://forum.arduino.cc/index.php?topic=497195.0 https://forum.arduino.cc/index.php?topic=298552.0 https://forum.arduino.cc/index.php?topic=307935.0

Keywords: Arduino Power Bank Suppress Power Bank Auto Shut Off Stop unwanted power down Inhibit power down of UBS battery

I wanted to see exactly what was happening so I hooked up my antique oscilloscope, after replacing the 47f cap with a 470pf cap to get a constant trace (see attached picture) and it shows the cycles being produced by the circuit mentioned above, just faster.

I picked up a 19000mAh powerpack for 20 Euros at Conrad Electronic, but similar to my other powerpack it is sealed. If I could open it I would probably be looking for a shunt resistor and capacitor controlling both current draw and the time until switching off. Both of which could be capped. Unfortunately opening this thing would mean destroying the nice case, not an option.

I am a bit skeptical about the 19000mAh so I am testing it first before recommending.

Usually, if it sounds too good to be true, it probably is!

The power rating of those power packs is anyway misleading. The mAh rating is at the internal battery voltage of 3.7 volts and not the (stepped up) output voltage of 5 volts. But even then, 19000mAh is quite respectable.

I think Google's motto is "Go break things", so I took that to heart!

I had an old 8000mAh powerpack and was wondering what happens if I feed current from the output back to the input.

What happened was, the powerpack stayed on for five minutes, the normal cutoff was about 20 seconds.

I don't know if I have done any long-term damage, but there seems to be no short-term damage and it didn't explode or even get warm.

Zotya: You don't need external circuit, you can use your Arduino itself for keeping the power bank running. Just put a 22R resistor between 5V of USB in and a pin (e.g. 1C) of ULN2803.

This seems simple. ULN2803 is a set of transistors in an IC, right? So a single transistor could work, too. That would maybe need an extra 330R resistor. This would also need one digital pin from the Arduino. If you use a PWM pin, you can easily set the frequency and the duty cycle, like every 5 seconds a 200 ms pulse. If you don't have a spare PWM pin, you need to set up a timer interrupt, which is basically the same thing. It would have a counter counting to 25, it would put say pin 4 high when counter is 0 and low when counter is 1.

Johan_Ha:
This seems simple. ULN2803 is a set of transistors in an IC, right? So a single transistor could work, too.

Johan_Ha:
If you use a PWM pin, you can easily set the frequency and the duty cycle, like every 5 seconds a 200 ms pulse.

That’s way to slow for the hardware PWM on most Arduino’s. But it’s slow so you can easily do it in code.

Johan_Ha:
If you don’t have a spare PWM pin, you need to set up a timer interrupt, which is basically the same thing.

Also no. Unless the Arduino is in sleep most of the time there is NO need for an interrupt.

Ok, the actual interrupt thing might be a little overkill, though it should be possible to set up an interrupt, which fires every 250 ms. If the following function would be called approximately every 250 ms, it would do the job, i.e. every 8th second a 250 ms high pulse is sent to port 4.

void keepAwake(void)
{
    static int last = 0;
    static bool hi = false;
    if (millis() - last > 8000) // cycle length 8 s
    {
        digitalWrite(4, HIGH);
        last = millis(); // record the time when pulse actually goes high
        hi = true;
    }
    else
    if (hi && millis() - last > 250) // wait until AT LEAST 250 ms has passed
    {
        digitalWrite(4, LOW);
        hi = false;
    }
}

For this to happen, one could use this library. This library is not a real interrupt library. It is based on polling. You need a timer.run() call inside your loop. The faster your loop runs, the more accuracy you get in timing the pulse. But in this case it shouldn't be very critical. If it is, just put more timer.run() calls inside your loop. Say you want the 250 ms pulse every 8 s, but your loop takes some 300 ms. Worst case is that your cycle will take 8299 ms and your pulse length will be 300 ms. This is quite unacceptable in many cases, but if the task is to keep your power bank on, it's quite ok.

One option, albeit rather wasteful of power, would be a small enough resistor in parallel with the arduino. If the 5V rail and GND rail of the USB power supply are connected by say a 1K ohm resistor then there will always be 5mA drawn, plus whatever current is necessary to satisfy the arduino (very very little). If you find what draw current the power supply shuts off below you can size a resistor to ensure it always draws enough current to stay on. Personally I was lucky and found a USB 5V lithium supply which doesn't cut off at low currents, a TECKNET 13000mAh device but they might hav chanegd the design since the one I bought was manufactured.

plus whatever current is necessary to satisfy the arduino (very very little).

An Arduino Uno takes about 30mA so it is much bigger than your 5mA from a resistor. I think the trip out point is closer to 100mA for the power bank I have.

I just tested a gmini 5200 mAh power bank. It seems to shut off after 24 s.
12 mA is not enough to keep it on, but 17 mA is. In other words, a 400 Ohm load is not keeping it on, but 300 Ohm does the job. A 100 ms pulse of 17 mA every 20 second keeps the power on. The power won’t go on just by connecting it to something that would draw more than 17 mA. Only the button on the PB can turn the 5 V on.

Next test is with an Anker Astro E1 power bank. This one behaves strangely. Even 25 mA is not enough to keep it on. While on, it stays on for 30 s. When off, connecting a 300 Ohm resistor will turn it on, but it won’t stay on even if the 300 Ohm is left on. I can’t figure out how big current is required for it to stay on. This PB is probably only for charging. I bet it stays on, if the initial current is over 1000 mA (it can deliver 2000 mA) and then the current fades with an even rate, as it would, when a phone actually is charged. So an uneven load caused by an Arduino and a few servos and a timed small 50 mA peak might not keep this PB awake. Which is strange, because I got this PB in a Raspberry Pi set. Perhaps the Raspberry Pi draws continuously enough to keep the Anker PB awake.

The conclusion is that a gmini GM-PB052L works fine with an Arduino, if you just give it an extra load of 300 Ohm (17 mA) for 100 ms every 20 s.

Turns out my Arduino clone, which is a 4duino pro, draws 15 mA, when it just runs a dumb program without anything attached to the pins. This is enough to keep the gmini PB running, without any extra timed load. But even a constant 38 mA is not enough to keep the Anker PB running. Another board of mine, a Netduino Ethernet, draws 110 mA, when nothing is connected to it. This is enough for the Anker PB to stay awake.

I just bought an ANKER 10000mAh ES1 Redux. PLugged it into an Arduino Mega 2560 Rev 3. Been quietly sitting there, on a stock (out of the box) Arduino since 10 am (i's not 4:45 pm). Hasn't powered down yet.

The next PB I'm going to test is the 26000mAh.

EJRONIN: I just bought an ANKER 10000mAh ES1 Redux. PLugged it into an Arduino Mega 2560 Rev 3. Been quietly sitting there, on a stock (out of the box) Arduino since 10 am (i's not 4:45 pm). Hasn't powered down yet.

Goes to show how much power the Mega wastes...

We made all our power banks with an Always On mode for IoT and maker projects. They do not shut off in no or low current applications. They all recover into Always On mode after being drained, the V50 also recovers after over temperature and under temperature events. See: https://voltaicsystems.com/v50/ and https://voltaicsystems.com/always-on/

Hi, I am using a PowerAdd Pilot X7 and found that if I turn on the torch the power stays on indefinately, even after the torch has been turned off again. Just hoping this may help someone :)

I've been lurking on the forums looking for workarounds for getting a powerbank to remain switched on when it's attached to a 9v guitar amp via a 3v/5v-to-9v step up usb cable. Sorry for interloping in your Arduino business!

CURRENT SET UP: Powerbank>>>3v/5v-to-9v USB>>>Guitar Amp (switches on only when guitar jack is inserted)

My Anker Powercore 10000 switches off after ~1m30s and Anker customers service say it will do that if consumption drops below 50ma. This is the proposed work-around I wanted to get your advice on.

In order to stop the Powercore switching off, to give it something about 50ma to power, I'm proposing opening up a male-to-female usb power cable and a small LED reading light like this...

https://www.amazon.co.uk/Flexibl-Portable-Reading-Computer-Notebook/dp/B07NWTZWGN/ref=sr_1_3?dchild=1&keywords=led+light+usb&qid=1599482196&refinements=p_36%3A-300&rnid=428432031&s=computers&sr=1-3

...and soldering the light in at a point along the cable, like this...

M A---------- (+) FEMALE L---------- (-) E

LED LAMP - + M || A-----||----(+) FEMALE L-----------(-) E

...and then plugging it into the 3v/5v-to-9v USB. So... NEW SET UP: Powerbank>>>Adapted male-to-female USB cable>>>3v/5v-to-9v USB>>>Guitar Amp (switches on only when guitar jack is inserted)

I'm hoping I'll be able to plug my guitar into the amp (creating a circuit) and switch on the powerbank, which will power the amp and stay awake thanks to the lamp but when I remove the jack from the amp the circuit will be broken, the lamp will go out and the powerbank will go to sleep. Do you think that would work?

mark_uk: Hi, I am using a PowerAdd Pilot X7 and found that if I turn on the torch the power stays on indefinately, even after the torch has been turned off again. Just hoping this may help someone :)

Really? Wow, that might be the answer I'm looking for.

Hello ,I read all posts about power supply arduino with power bank but nothing found about power supply with 5v 3 amps power bank. so is it safe to power supply and arduino uno or an arduino mega with 5v and 3 amps froma power bank ? I have supreme hama 10 hd power bank. thank you very much for help!

It is safe to supply a Uno or Mega from a 3Amp 5 Volt power bank.
The Uno or Mega would only draw the current required even if the power bank was 2, 3, or even 100 Amps.

You may still face the problem of the unwanted shutdown if the load is not sufficient to keep the power bank “alive”.