When using USB and external power, how should I isolate the grounds

atmegaisolationpowerusb

I want to connect USB to my ATmega32U4 microctroller, which is powered by an external power supply. I was thinking it might be possible that the USB +5V/GND would be different than the +5V/GND I am getting from external supply. From some reading, this seems unlikely if the external power is a wall wart, but would be possible if the power source was a battery or some non-earth grounded power supply.

The ATmega32U4 has a UGND pin for "USB Pads Ground". Can I connect the USB cords GND wire to this and keep the other GND pins connected to the external power supply? Should I even worry about this if I assume I will never use a battery? (I am planning on always using a wall wart)

Best Answer

I'm almost1 certain that in your scenario you can connect the ground of USB to the ground of the wall-wart and not worry about it. Wall-warts2 have isolation transformers. Its ground is floating. When you connect the floating ground to the other ground, they will equalize, and there will be no current between the grounds because of the difference in ground potential.

Many of the self-powered USB devices have USB ground connected to the external power ground.

1 "Almost", because I have to go by a verbal description rather than a schematic or a block diagram. 2 Properly made wall-warts. I'm not talking about the fake ones from China on eBay.