0
\$\begingroup\$

I have this toy I am making for my toddler that includes Arduino Micro and Raspberry Pi Zero (plus 10 APA-102 RGB LEDs and audio amplifier that feeds a 3W speaker.

This all is powered through a 5V USB power bank. It serves nicely for a battery, also when the power bank itself is changing via the supply cable. The problem is that when the power bank supply cable is disconnected from the supply (usually a power adapter in wall socket), there's a brief power loss to the output sockets that causes reboot for both Arduino and Zero.

I am looking for a reliable solution to keep the devices powered for that brief moment. Something connected in parallel to the power bank output. Perhaps a reasonably large capacitor would do? I am afraid if the capacitor would discharge too quickly and damage the devices. A small rechargeable 5V battery could do, but that seems to be an overkill.

\$\endgroup\$
  • \$\begingroup\$ The capacitor will no more damage the devices, than the external supplies. However it may discharge through the power adapter or power bank if their inputs are shorted, and if they are not protected for that (which is unlikely). An input diode (just after external 5V supply) should take care of that. \$\endgroup\$ – Indraneel Dec 26 '18 at 22:51
  • \$\begingroup\$ How to calculate the required capacitance then? \$\endgroup\$ – Passiday Dec 26 '18 at 22:55
  • 1
    \$\begingroup\$ This of course cannot be answered in the way you want until you specify how long the gap is. Generally speaking though, it's going to be hard to do right - a powerbank is not a UPS and so is probably not the right solution for your project. Backing up still further, a pi is generally not what you want in a toy - a better solution would be something without delicate state an SD-card based filesystem, such that it would not be particularly bothered by power loss. That would probably also be something that let you do better optimization of power usage, ie, have an actual sleep mode. \$\endgroup\$ – Chris Stratton Dec 26 '18 at 23:08
  • 1
    \$\begingroup\$ You also need to specify how much power must be supplied while bridging the gap... \$\endgroup\$ – Chris Stratton Dec 26 '18 at 23:10
  • \$\begingroup\$ Please note that the Raspberry Pi is susceptible to SD card corruption if the power is suddenly cut off. You MUST have power backup of some type. To put the Pi to sleep use the desktop controls or type in 'sudo halt -h'. If the green LED is flashing or ON it means the CPU is busy and a power fail can be a serious problem. If the green LED is off for 20 seconds or more it is safe to cut the power. \$\endgroup\$ – Sparky256 Dec 27 '18 at 0:31
0
\$\begingroup\$

As Chris has said. "Engineering" this will be rather difficult. You need to know how much power will be required, and for how long, and furthermore what minimum voltage is acceptable before a reset occurs.

To get good performance, some kind of boost circuit will probably be necessary and basically the whole thing is going to get complicated fast.

So... I'll suggest a practical approach. I'm assuming the gap in power is <1s. Buy as large of a super capacitor as you can reasonably accommodate, and just.. see what happens.

Try a couple of these 5F 5.5v Supercaps: DGH505Q5R5

You may need a few additional parts parts like a diode on the power coming in, or maybe a resistor to limit the inrush current. But I would just start simple and go from there. Let us know if it works.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.