To be specific the hardware I am using in my project:
https://www.adafruit.com/product/3176I connect a Lipoly battery to the Feather M0 JST-PH battery connector. When USB is plugged into the Feathers micro USB, if the battery needs charging, it will charge via USB. Last night while working on the project, the power to my entire neighborhood went out. Yet, much to my amazement, my PC's motherboard RGB lights were still functional. Additionally, quite a few USB devices that were connected to the back of the PC continued to be powered up. Upon first seeing this I was like WTF? There is no AC power anywhere in the house. How is this happening? At the time I had the M0 Feather connected to it's battery as well as to my PC's USB. When I disconnected the USB from the Feather, everything went dead in the PC and the other USB devices. As a test I plugged another Feather into an adjacent USB port and it powered up and came to life via VBAT on the VBUS.
Attached to this post is a partial schematic of the USB and battery charging as well as the power and filtering circuitry on the Feather M0.
VBAT is connected to VBUS via a Schottky diode D1 which is presented to the IN pin of the 3V3 LDO U2. VBUS is supplied to the feather from the PC via the micro USB connector X3. During normal operation,VBUS is at a higher voltage than VBAT, so the Schottky diode D1 blocks VBAT from being applied to the IN pin of the LDO, thus VBUS supplies voltage to the 3V3 LDO. The moment that AC power was lost, VBUS from the PC = 0V. At this point D1 is forward biased and VBUS on the Feather = VBAT minus the small voltage drop across D1. On a fully charged battery this will be on the order around 4V. VBUS on the Feather connects directly to the VBUS pin on the micro USB connector X3. Thus, that voltage will find its way to the PC. The battery voltage needs to be prevented from being applied to VBUS at X3. From what I can tell, the PC's motherboard has a number of 4-port USB hubs, and each hub appears to have it's own separate VBUS voltage. So the USB ports that were common to the same USB hub the Feather was connected to was being powered by the Feathers battery. Apparently, some of the RGB controllers that are built into the motherboard seemed to share a common VBUS voltage source that was ultimately supplied via VBAT from the Feather.
In my opinion this is a pure BS design. WTF is wrong with Adafruit engineers? The USB 2.0 spec states that no USB device, whether bus powered or self powered can drive the VBUS on its upstream facing port. Let's fix it! How would you implement a fix?
TIA,
Nikki