I made an LM386 audio amp that can be powered by either a 5V USB port or a 9V battery. A USB port is the primary power source, and the battery makes it convenient to use the amp without one, but I only want the battery to power it when the USB cable is not plugged in. Right now I have a slide switch to manually toggle between the power sources, but I would prefer to automate this.
From the googling that I have done, it seems that the preferred way to automatically switch between power sources is diode ORing. The problem with this is that if both power sources are connected, the one with higher voltage is used, which is the opposite of the behavior that I want.
I've seen several schematics for more complicated circuits, but if it's more advanced than adding a few discrete components, I'm not interested in using it for this simple project. Is there a simpler way to accomplish what I want, or would I have to use a bunch of MOSFETs or an IC?
From the googling that I have done, it seems that the preferred way to automatically switch between power sources is diode ORing. The problem with this is that if both power sources are connected, the one with higher voltage is used, which is the opposite of the behavior that I want.
I've seen several schematics for more complicated circuits, but if it's more advanced than adding a few discrete components, I'm not interested in using it for this simple project. Is there a simpler way to accomplish what I want, or would I have to use a bunch of MOSFETs or an IC?