Single Board Computer Two Power Sources Wiring

Thread Starter


Joined Feb 14, 2022
I have a Single Board Computer. I can power it both off a cell phone power bank or straight from the wall. The wall adapter is 5V/2A. The battery is a 10000mAh. The battery can be charged with 2A or 1A. The output is 2.1a max. The wall adapter has a barrel connector, and the power bank has usb.
I want to add a switch. First, to turn the computer on and off. Secondly, with the switch I want to be able to use both the 5V/2A. wall plug and the battery at the same time. The wall plug should power the battery. If the wall plug is not plugged in, the battery would power the device.

Does anybody know what other components I would need or how to wire this to make this work?

The switch:
The single board computer:
The cell phone battery:
The power wall charger:


Joined Jan 27, 2019
Welcome to AAC.

You need a USB battery bank with passthrough charging. That allows the power supply to charge the battery but the battery transparently takes over the output when the power supply is not providing any power.

There are ready made battery banks with that feature, but you can also buy a low voltage UPS like this one which provide all the functionality in a purpose built device.

Or, if the Orange Pi is pin compatible with Raspberry Pi hats, you can use something like this.



Joined Mar 14, 2008
So you also want the push-button switch to alternately turn the power on and off to the computer?

Below is the LTspice simulation of a circuit to do that using two CD4049 inverter gates (one IC package) and a P-MOSFET to control the load voltage.
The P-MOSFET must be a logic-level type (Max Vgs(th) <2V).

Last edited: