0
\$\begingroup\$

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)

\$\endgroup\$
2
  • \$\begingroup\$ @RespawnedFluff There is a diagram in the datasheet (fig. 25-1) that depicts a self-powered device where UGND is connected to the same ground as the supply. \$\endgroup\$ Sep 27, 2015 at 17:49
  • \$\begingroup\$ @NickAlexeev: Yes I saw myself, that I so deleted my old comment. I was confused by the "self-powered" terminology for a sec. They have super-tiny font for the power supply in that diagram. \$\endgroup\$
    – Fizz
    Sep 27, 2015 at 17:50

2 Answers 2

1
\$\begingroup\$

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.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Re: "Its ground is floating". If it's class II (@samoz: has a square-in-square on it). There are some reputable brick-style PSUs that don't have that (nor claim it). I have a dual output 12V/5V one that doesn't. Nor does one of my (original HP) laptop supplies have that. In both cases, these being class I supplies, the output negative is connected to the input earth, so you can check that too with an ohmmeter, samoz. \$\endgroup\$
    – Fizz
    Sep 27, 2015 at 17:32
0
\$\begingroup\$

You cannot have two ground references for one IC (or connected circuit).

You need to make sure that all the grounds are at the same potential.

If you cannot guarantee that they will be at the same potential you need to implement isolation of the data and ground.

If you only need the USB for simple comms you could possibly keep the USB interface IC running on USB power and just isolate the comms.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.