Electronic – arduino – How to automatically disconnect from battery when USB +5v is present

arduinobatteriespowerswitchesusb

I'm creating a SMD PCB where space is extremely limited.
Usually, the application is powered by a battery (Single cell 3.7v lipo).
To charge the battery, I'm using a USB cable.

What I'd like is for the application to automatically switch to USB power instead of the battery whenever power from the USB is present.

A normally closed "switch" between the battery and load sounds ideal. The +5v from the USB would be used to open the switch. When the USB is disconnected (left floating) the switch would close and connect the battery again. Is there a simple way to achieve this? Am I overcomplicating it – would a diode on the positive terminal of the battery serve the same purpose?

As I say, space is extremely limited so I'm trying to achieve this with as few components as possible. I'm hoping I can find a single solution in say a SOT23 package or similar.

Here is a simplified schematic drawing.

The problem - how to automatically disconnect battery when USB power is present

Best Answer

There are IC's designed specifically for this, and in small packages too. One example is TPS2113A from TI. The TPS2121 is another option if you need higher current. Other suppliers like Maxim make devices as well. Search for "power mux IC".

Related Topic