I am trying to use usb battery bank as a backup power source for my diy project.
Project is using arduino to control transistors and to turn few devices (like pumps and lights) on and off. Power source is 12v 3a adapter.
I would like to have usb with battery connected always and if possible to charge it when main power is available.
Controller must know when main power is not available that it is running on battery.
This schematic is based on answer of Automatic Power Selection Circuit
simulate this circuit – Schematic created using CircuitLab
N Mosfet is added to detect if main power is not available.
Will battery charge if I remove D2 diode? If not how could I get charging to work?
Is there anything wrong with this circuit or is there better way to do this?
I added voltage regulator from 12v and diode to 5v. Is there something else required for battery charging? Battery is standard 2200ma usb battery pack for phones.