Arduino Forum

Using Arduino => General Electronics => Topic started by: ppeterlin on Mar 03, 2015, 09:45 pm

Title: Powering Arduino from a power bank
Post by: ppeterlin on Mar 03, 2015, 09:45 pm
Hello everybody,

I seem to have run into a problem with powering Arduino from a power bank (external USB battery). Arduino seems to be running fine for 30 s, then the power bank switches off. This happens with two power banks: Yoobao YB-659 (maximal discharge current 1 A) and Maxell MPC-R5200BK (maximal discharge current 2 A). My setup consists of an Arduino Uno, a data logging shield, a temperature/humidity sensor, and an LCD display (whithout the background lighting); all in all, it should be WAY beyond 1 A. Both power banks can successfully charge a cell phone, a e-book reader etc. What is going on?

My guess is that in addition to maximal discharge current, power banks also have some minimal discharge current, and shut off if the discharge current is below this threshold. They treated my Arduino as "leakage" and shut off. Does this make sense to anybody? Can somebody recommend a solution? Ideally, updating a firmware of the power bank... :)

Thank you in advance,
Primoz
Title: Re: Powering Arduino from a power bank
Post by: DrAzzy on Mar 03, 2015, 09:49 pm
Yes, that's what's happening.

I doubt you'll be able to update firmware; I think there's more hope for a hardware hack.
Title: Re: Powering Arduino from a power bank
Post by: Paul__B on Mar 03, 2015, 09:58 pm
My guess is that in addition to maximal discharge current, power banks also have some minimal discharge current, and shut off if the discharge current is below this threshold. They treated my Arduino as "leakage" and shut off.
Yep.  That's exactly what the manual (http://uk.maxell.eu/Uploads/ShopItemDownloads/00/00/11/60/ShopItemDownloadFile_FILE/5200mAh-Power-Bank-User-Manual-EN.pdf) says - though not in so many words.

So why?

Well, the "power bank" contains a 3.6V lithium battery, so to put out regulated 5V, it contains a power up-converter.  The power converter is not perfectly efficient so it uses some power to operate even if there is no load, and of course, you are running the indicator LEDs.  To prevent the power converter itself and the LEDs from discharging the battery, it does not turn on at all until you press the "Power" button, and if it detects that it is not being used significantly for 5 seconds, it turns itself off to prevent discharge.



Title: Re: Powering Arduino from a power bank
Post by: cattledog on Mar 04, 2015, 07:10 am
Low load turn off is a "feature" or many battery chargers. Some of them have an "always on" setting.

There are several threads I have found which document using a pulsed load to keep the battery pack running. http://www.dorkbotpdx.org/blog/paul/battery_pack_load (http://www.dorkbotpdx.org/blog/paul/battery_pack_load)

This solution did not work with a charger I had, and it is dependent upon the charger you have.
Title: Re: Powering Arduino from a power bank
Post by: stormizer on Nov 14, 2016, 10:43 am
I have the same issue and endup with this simple circuit.
What it does is basically giving a short burst of to fool the powerbank every something second.
https://www.dorkbotpdx.org/blog/paul/battery_pack_load (https://www.dorkbotpdx.org/blog/paul/battery_pack_load)

This particular arrangement works for my XiaoMi PowerBank (20A).
Total power drawn is roughly 3.5mAh (per hour), so its not too bad.
Assuming it runs at 5v (from the USB)... 0.0035Ah x 5v = 0.0175Wh
If you run it for 24 hours.. 0.0175Wh x 24 = 0.42Wh
Assuming the powerbank only holds 15A (x3.7v = 55Wh) ...
this circuit will finish the battery in about 4 months.
Title: Re: Powering Arduino from a power bank
Post by: workhard on Nov 15, 2016, 11:09 am
stormizer Thank you very much! I've been looking for this for a year!
What do you think: does the circuit below require the same endup that you did?
(https://ae01.alicdn.com/kf/HTB1JvMsKVXXXXb7aFXXq6xXFXXXe/205957859/HTB1JvMsKVXXXXb7aFXXq6xXFXXXe.jpg)
From left to right:
1) 5V 1A Micro USB 18650 Lithium Battery Charging Board Charger Module+Protection Dual Functions TP4056 (as Ali says)
2) 18650,3.7 V Battery
3) Mobile booster ( 3.7 to 5V DC-DC step up, as far as I undertsand)
Thank you!
Title: Re: Powering Arduino from a power bank
Post by: septillion on Nov 15, 2016, 11:35 am
No, the booster has no off mode. (How would you turn it on without a button?)
Title: Re: Powering Arduino from a power bank
Post by: workhard on Nov 15, 2016, 01:18 pm
septillion, Hi! The circuit above has been borrowed from here (https://ru.aliexpress.com/item/1PCS-5V-1A-Micro-USB-18650-Lithium-Battery-Charging-Board-Charger-Module-Protection-Dual-Functions/32467578996.html?spm=2114.13010308.0.0.8gqEat&detailNewVersion=&categoryId=400103)
Do you mean by "button" ON\OFF power switch?
Title: Re: Powering Arduino from a power bank
Post by: septillion on Nov 15, 2016, 01:28 pm
For example. Or a push button like most power banks etc. But the boost converter has non of that. It's as simple as power in = power out.

Same goes for the charger/protection board. As long as the battery has enough power (aka, not empty) and there is no short circuit / overload there is power at the output.
Title: Re: Powering Arduino from a power bank
Post by: workhard on Nov 15, 2016, 02:46 pm
septillion, thank you!
What is the best place for an ON/OFF switch here? Is it between 1 and 2, or 2 and 3?)
1) Micro USB 18650 Lithium Battery Charger Module+Protection Dual Function.

2) 18650,3.7 V Battery

3) Mobile booster ( 3.7 to 5V DC-DC).
Thanks
Title: Re: Powering Arduino from a power bank
Post by: septillion on Nov 15, 2016, 04:20 pm
Between 1 and 3. Those charger/protection modules don't draw jack so no need to disconnect the battery from it. This way you can still charge the project when the switch is off.
Title: Re: Powering Arduino from a power bank
Post by: workhard on Nov 15, 2016, 08:34 pm
septillion, I'm grateful to you for answering all my questions! Now I have to order all this stuff to try it out.
 
Title: Re: Powering Arduino from a power bank
Post by: wrybread on Feb 22, 2018, 02:39 am
Old thread I know, but I finally found a power pack that doesn't turn off automatically. All the ones made by TalentCell. This one for example:

https://www.amazon.com/gp/product/B00ME3ZH7C/ref=oh_aui_detailpage_o09_s00?ie=UTF8&psc=1

I should mention that I've only tested the one in that link, but I believe they all stay on permanently. Very refereshing after fighting auto power off for so long.
Title: Re: Powering Arduino from a power bank
Post by: BabyGeezer on Feb 22, 2018, 02:19 pm
is it just me, or is it strange that people want to use a power bank as a power source ?!

just because they both "provide electrical power" doesn't mean that they are the same thing.

it's all down to how they are designed to be USED !
(the bank is a portable unit to *recharge* your battery - the power *source*)

look at it this way - would you think of taking a battery charger, solder cables to it's positive and negative terminals, and then try to power something with it ?!?!
Title: Re: Powering Arduino from a power bank
Post by: septillion on Feb 24, 2018, 10:48 am
What's so strange about it? It's convenient (except for the auto power off). And there is nothing charger about a power bank, it's just a 5V voltage source. All the charging magic needs to be done in the device connected. That's why a power bank isn't called mobile charger ;) And yes, the name USB charger / phone charger when you mean this (https://www.externebatterij.nl/media/catalog/product/cache/4/image/950x/040ec09b1e35df139433887a97daa66f/a/u/aukey_quick_charge_3.0_usb_charger_18w.jpg) is misleading / "wrong". It's simply a USB power source.
Title: Re: Powering Arduino from a power bank
Post by: adwsystems on Feb 27, 2018, 07:02 pm
Heading along the same path as septillion. What is the difference between a power bank and lithium ion battery and a USB charger with a voltage boost circuit (such as https://www.adafruit.com/product/2465)?
Title: Re: Powering Arduino from a power bank
Post by: Zotya on Oct 01, 2018, 07:09 pm
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. Then supply signal to pin 1B of ULN2803 from Arduino for 250 ms in every 5 sec. This signal "sinks" the current provided by the power bank through the resistor. For me this configuration is working fine.

So the only external component you need is the resistor and a ULN2803. You can set the optimal timing of the signal in the sketch to find the minimal power consumption which still keeps the power bank running.
Title: Re: Powering Arduino from a power bank
Post by: tduffett on Nov 21, 2018, 11:48 pm
To keep it real simple, I added an LED & resistor to my circuit off to the side and it apparently draws enough to avoid the auto shut off problem. Obviously uses constant power so depending on your application this may or may not be optimal.
Title: Re: Powering Arduino from a power bank
Post by: Paul__B on Nov 22, 2018, 01:51 pm
look at it this way - would you think of taking a battery charger, solder cables to it's positive and negative terminals, and then try to power something with it?
Don't know about soldering cables, but using the clips, I use one to test motors and stuff and to run my tyre pump.   :smiley-lol:
Title: Re: Powering Arduino from a power bank
Post by: plobit on Dec 09, 2018, 03:13 pm
I've found a very simple solution, that works at least with my power bank (Silicon Power SP power S105, sold by Costco).
This power bank does not switch off when it is being charged (through the micro-usb plug).
So, I just make it believe it is being charged by supplying 5V to the power pin of the micro-usb cable... Since connecting directly the micro-usb input to the other usb output or the 5V pin of the arduino would draw a lot of current (charging the power bank with its own power output!), I connected a 27 ohm resistor in between (I've not tried with higher values for smaller current yet).
It worked: no switching off for a whole afternoon and night while running an arduino uno measuring a chinese calliper, and very little power wasted. On the other hand, I had no luck with the pulsed load solution with my power bank...
Title: Re: Powering Arduino from a power bank
Post by: pallen33 on Dec 16, 2018, 10:35 am
Hi all. Found this one which is mentioned which seems to do exactly what people need: https://www.voltaicsystems.com/always-on (http://)

Paul
Title: Re: Powering Arduino from a power bank
Post by: Pugwash on Dec 21, 2018, 12:54 pm
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!
Title: Re: Powering Arduino from a power bank
Post by: 6v6gt on Dec 21, 2018, 01:11 pm
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=497195.0)
https://forum.arduino.cc/index.php?topic=298552.0 (https://forum.arduino.cc/index.php?topic=298552.0)
https://forum.arduino.cc/index.php?topic=307935.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
Title: Re: Powering Arduino from a power bank
Post by: Pugwash on Dec 21, 2018, 03:54 pm
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!
Title: Re: Powering Arduino from a power bank
Post by: 6v6gt on Dec 21, 2018, 04:23 pm
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.
Title: Re: Powering Arduino from a power bank
Post by: Pugwash on Dec 21, 2018, 08:53 pm
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.
Title: Re: Powering Arduino from a power bank
Post by: Johan_Ha on May 02, 2019, 07:59 am
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.
Title: Re: Powering Arduino from a power bank
Post by: septillion on May 02, 2019, 04:21 pm
This seems simple. ULN2803 is a set of transistors in an IC, right? So a single transistor could work, too.
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.

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.
Title: Re: Powering Arduino from a power bank
Post by: Johan_Ha on May 04, 2019, 02:27 pm
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.
Code: [Select]

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. (https://dev.playground.arduino.cc/Code/SimpleTimer)
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.
Title: Re: Powering Arduino from a power bank
Post by: Infraviolet on May 05, 2019, 07:14 am
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.
Title: Re: Powering Arduino from a power bank
Post by: Grumpy_Mike on May 05, 2019, 07:22 am
Quote
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.
Title: Re: Powering Arduino from a power bank
Post by: Johan_Ha on May 05, 2019, 06:55 pm
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.
Title: Re: Powering Arduino from a power bank
Post by: Johan_Ha on May 05, 2019, 08:59 pm
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.
Title: Re: Powering Arduino from a power bank
Post by: EJRONIN on Sep 10, 2019, 10:47 pm
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.
Title: Re: Powering Arduino from a power bank
Post by: wvmarle on Sep 13, 2019, 04:51 pm
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...
Title: Re: Powering Arduino from a power bank
Post by: voltaicjeff on Oct 29, 2019, 03:27 pm
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/