1
\$\begingroup\$

for a project I'm working on I am required to have two USB connectors:

  • the first is used to provide data and power to only one IC of the board
  • the second is used to provide power only to everything else on the board

Since the two USB connectors could be plugged to different sources (one to a PC for data transfer, one to a USB wallwart charger), what do I do with the grounds?

Should I tie them together or keep them separate?

My guts say to do the latter (keep the "data" ground away from the "power" ground, no touchy).

\$\endgroup\$
  • 2
    \$\begingroup\$ Tie them together. \$\endgroup\$ – Tom Carpenter Nov 4 '16 at 15:01
  • 1
    \$\begingroup\$ The data signals are referenced to the data ground, so you have to use that ground for the corresponding IC. Having two grounds would imply an optoisolation between the two parts. \$\endgroup\$ – pjc50 Nov 4 '16 at 15:19
  • \$\begingroup\$ I'd like to mention that the previous design of the project (not made by me) has both grounds tied together using direct vias to a common ground plane and the device works \$\endgroup\$ – MickMad Nov 4 '16 at 16:35
  • \$\begingroup\$ Yes, I'd expect it to work almost all of the time, but with ground loop noise; it's a little tricky to set up a test case in a normal domestic or office environment where you have two PSU grounds at different potentials. \$\endgroup\$ – pjc50 Nov 4 '16 at 16:43
3
\$\begingroup\$

If the grounds of two parts are not connected, the signals from one part will be misinterpreted by the other. You must either connect the grounds or use some sort of isolation circuit between the IC connected to the PC and other components.

I had a project where I had to do something similar. There I powered a device from external power source and used USB cable with V+ wire cut with no unwanted effects and I am pretty sure you can do something similar in your project.

\$\endgroup\$
  • 1
    \$\begingroup\$ Good point about cutting the V+ : back-powering a PC over USB can upset it in various ways, including failing to boot while the offending device is connected. \$\endgroup\$ – pjc50 Nov 4 '16 at 16:46
  • \$\begingroup\$ Yeah. I learned this lesson the hard way when cheapish powered USB3 hub killed one of USB ports on my laptop. Well, at least it made sure I will use it... \$\endgroup\$ – Algimantas Nov 4 '16 at 18:40
1
\$\begingroup\$

I would isolate the data line if this is going into a product design or a design that is sensitive to noise like analog or audio. If its just a microprocessor it's probably not going to be a big deal because digital electronics handle noise better. Why? Because the PC is grounded to earth on the AC mains and your USB power adapter probably is too. By tying the grounds together on your board it will make a conductive loop.

This is going to create a giant loop antenna and cause current to flow through the loop. This will create common mode noise and cause the ground of your board to bounce around on the mV to uV level (could be more depending on your setup).

If that kind of noise is acceptable then go for it, if not then provide isolation.

Another thing to keep in mind is if you had both power and data USB's plugged into the PC you will still have a loop, however you could twist the cables around each other and keep the loop area small, something to think about.

\$\endgroup\$
  • \$\begingroup\$ there is sensitive analog circuitry on the board indeed \$\endgroup\$ – MickMad Nov 4 '16 at 16:36
  • \$\begingroup\$ Another way you could do this is use a isolated wall wart or isolate both depending on your needs. If you have a sensor from your board on a cable that can also turn into an antenna, look into shielding and filtering depending on the level of sensitivity. A good book is Electromagnetic Compatibility Engineering by Ott \$\endgroup\$ – Voltage Spike Nov 4 '16 at 16:39
  • \$\begingroup\$ We had one of the previous designs tested for EMI and it did not pass due to ground shifts and whatnots. I'll probably use this component: analog.com/media/en/technical-documentation/data-sheets/… \$\endgroup\$ – MickMad Nov 4 '16 at 16:42
  • \$\begingroup\$ You could also use filtering on the power side too, they make lowpass usb filters or you can build it into the PCB on the power side to block high frequencies from getting in on the power line. \$\endgroup\$ – Voltage Spike Nov 4 '16 at 16:46
  • 1
    \$\begingroup\$ Chokes are good, anything else is more expensive but could be necessary. Any good experiment to see where noise comes from would be to disconnected the data line and still log data, if your situation improves then use an isolator, if not then you've got some other noise source to chase down. \$\endgroup\$ – Voltage Spike Nov 4 '16 at 16:53
-2
\$\begingroup\$

Yes, connect them together, however, be aware of ground loops. It it's an issue, if Fullspeed-USB is enough (12mbps) you can optocouple as pointed by pjc50.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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