Referring laptop USB to Mains ground - bad idea?

Go To Last Post
20 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So I'm working on a project using a Curiosity Nano board for development. The Curiosity board sits on a custom PCB which has a mains voltage resistance divider to read the mains voltage, and a few outputs, along with its own capacitive power supply with full-wave rectification (similar to ones used in energy meters; not isolated from mains). The final product will be powered entirely by this supply, and I plan to power the AVR on the curiosity from this supply as well instead of from the USB port on it. However, I'd also like the on-board nEDBG connected to my computer for programming and debugging during testing, which would mean that the USB ground gets connected to the ground of the mains capacitive power supply. I'm afraid this might put my rather expensive computer at risk if something goes wrong, which I'd like to avoid. Am I correct in thinking this? What are my options here? 

Thanks!

-Sam

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 3

samay wrote:

...would mean that the USB ground gets connected to the ground of the mains capacitive power supply. I'm afraid this might put my rather expensive computer at risk if something goes wrong, ...

 

Not only the computer but also you.

 

You MUST put some isolation in there. When I'm working on such projects I always start with the DUT being fed from an isolation transformer AND ALSO have a USB isolator between it and the PC. The PC is also usually a laptop running on batteries.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

samay wrote:
What are my options here?
USB isolator (typically)

Protect Equipment with USB Isolators - B&B Electronics

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Tue. Jul 28, 2020 - 03:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
You MUST put some isolation in there. When I'm working on such projects I always start with the DUT being fed from an isolation transformer AND ALSO have a USB isolator between it and the PC. The PC is also usually a laptop running on batteries.

 

Absolutely! +1000

 

And I'd keep one hand in my back pocket when near that circuit too, you can't be too careful!

 

Jim

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Tue. Jul 28, 2020 - 05:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks! Do the inexpensive ones work fine with programmers/debuggers? 

-Sam

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Candyman, it took a little work but I found some further data on the Amazon USB Isolator you linked to:

 

Sigh...Now what changed???

I can't adjust the image's size.

 

I understand what a 1500 V Digital USB Isolator is.

The "Digital" part of the description sounds like Marketing Hype, as the last time I looked at the USB spec it was all digital, no analog, by default!

 

What, one might wonder, does "Audio Power" have to do with this device?

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From what I've gathered today from looking at USB isolators, a lot of people use these to get rid of high frequency hums in audio equipment, recorders, MIDI devices etc. I guess that's what they're referring to.

-Sam

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

They work fine with programmers, never had a problem on multiple PCS, win7, 10, different programmers, etc.   I even use one with a 20ft long usb buffered extension cable...works (as an isolated buffered 20 ft usb cable).

I can move my avr programmer 10ft away to my bench and use my pc on my desk.

 

They supply both power & data across the barrier

 

yes, they are also used to eliminate digital audio gnd loop hummm

 

I have maybe  5 or 6 of these of various varieties...the first 2 I bought maybe 6 years ago

 

A lot of them have a jumper or switch for "high" speed mode...I only use for usb2, not sure if any/all are usb3 compat.  I only need to move a few hundred KB.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Tue. Jul 28, 2020 - 09:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I have personally blown boards doing exactly this.  Fortunately, the boards went before the controller PC did.

 

Having an isolation transformer on your bench is a wonderful idea if you're doing anything with the AC mains - And they're stupid cheap - just buy two identical junk transformers from your local junk store and wire them up back-to-back, and you're in business.  S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
not sure if any/all are usb3 compat.
a few

USB 3.0 SuperSpeed 1kV Isolator | Saleae

 

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Tue. Jul 28, 2020 - 10:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Usually, when I have stuff connected to the mains like this, I always go for an isolation transformer if not more.  I've learned the hard way, more than once.  I helped design big ol' 400A to 4KA circuit breakers.   Saw some weird stuff, isolation is your friend.   

Just gettin' started, again....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm afraid this might put my rather expensive computer at risk if something goes wrong, which I'd like to avoid. Am I correct in thinking this? What are my options here? 

 

From what you've described of your circuit, the 0V point is nowhere near mains ground. Before you go any further I'd suggest you ponder this and understand the implications. I think you'll find this would be at around 1/2 mains voltage so connecting this to your laptop would make it rather dangerous. Nothing would have to 'go wrong' - it is a design feature. 

 

You could isolate USB, or my usual method is to prototype the circuit using a transformer and/or isolation devices so that the bulk of the work is done at a safe voltage. You really want to avoid working with circuits that have high voltages floating around even if it is electrically isolated. So think about structuring your development so you minimise the risk -  of electrocution, fire and things exploding possibly causing eye damage.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, @avrcandies. Good to know!

-Sam

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can find out about isolators, generally, at the Analog Devices web site. They are big in isolators. Others of course, also, but that is something they are proud of. You can learn more than you want, there.

 

Note from the block diagram, that USB is converted to/from "digital" on each side of the isolator. That means that the isolator does NOT handle native USB signals., Though it does not show it, the isolator also isolates power. I should deliver close to 1 standard unit of USB power to the isolated side. 50mA? Don't recall what it is, at the moment.

 

It really behaves like a 1 port hub that just happens to be galvanically isolated.

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

Last Edited: Wed. Jul 29, 2020 - 04:45 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yep, every single isolator I've seen uses AD's chips to get the job done.

-Sam

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I see that most of the isolators come with a little switch for selecting low speed or full speed, a few don't have these switches. Is the low speed setting actually required anymore for use with programmers/logic analyzers etc?

-Sam

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A few don't have these switches.   Some have jumpers instead..I've never messed with the adjustments, but I probably use low speed anyhow...you are only pushing a handful of bytes around for a few moments for programming.   I can wait an extra 1/2 second for a download.   Maybe more critical for logic analyzer/real time usage.    The ADUM datasheets might say something about it.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think it has to do with USB specifications of the device - Low speed (1.5 Mbps) or Full speed (12 Mbps), so perhaps the wrong setting could make the device not work properly. I think most USB chips have FS capabilities now, like the SAMD21 in the curiosity boards. Of course, even LS is more than fast enough for our kind of requirements. 

-Sam