Author Topic: Probing usb powered circuit. Should I be scared?  (Read 4748 times)

0 Members and 1 Guest are viewing this topic.

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Probing usb powered circuit. Should I be scared?
« on: October 18, 2018, 01:30:49 pm »
Hi there.

I've just been gifted my first oscilloscope, so I'm not an expert on anything in that respect.

I have to troubleshoot a circuit which is powered through an arduino nano connected via usb to my mac. I was trying to use the ground pin as a reference for the probe, but then I saw this: https://youtu.be/xaELqAo4kkQ

and now I'm scared... Should I remove the power from my laptop before probing and use just the batteries? Or is it safe to use the gnd of the arduino as a ref?

Thanks
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: fi
Re: Probing usb powered circuit. Should I be scared?
« Reply #1 on: October 18, 2018, 01:35:55 pm »
OK to use the Arduino GND since the circuit is galvanically isolated from mains.
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Probing usb powered circuit. Should I be scared?
« Reply #2 on: October 18, 2018, 01:37:39 pm »
OK to use the Arduino GND since the circuit is galvanically isolated from mains.

Oh ok, thanks. I did not know that the usbs/arduino are galvanically isolated.

Cheers
 

Offline glarsson

  • Frequent Contributor
  • **
  • Posts: 814
  • Country: se
Re: Probing usb powered circuit. Should I be scared?
« Reply #3 on: October 18, 2018, 01:46:10 pm »
You don't know if the USB supply is isolated.

A small phone charger style USB power supply most likely is, but a USB connector on a stationary PC connected to a grounded power outlet probably isn't.

Don't assume, meassures first.
 
The following users thanked this post: Moriambar

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Probing usb powered circuit. Should I be scared?
« Reply #4 on: October 18, 2018, 01:53:05 pm »
You don't know if the USB supply is isolated.

A small phone charger style USB power supply most likely is, but a USB connector on a stationary PC connected to a grounded power outlet probably isn't.

Don't assume, meassures first.

Ok, I'll measure it!
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11473
  • Country: ch
Re: Probing usb powered circuit. Should I be scared?
« Reply #5 on: October 18, 2018, 04:08:10 pm »
OK to use the Arduino GND since the circuit is galvanically isolated from mains.
An absolutely wrong assumption. Computer USB sockets are almost universally grounded through to earth ground. The only major exception, really, is laptops that don't have an earth ground connection. (In the case of Mac laptops, they are grounded if using the 3-prong cord.)
 
The following users thanked this post: Moriambar

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Probing usb powered circuit. Should I be scared?
« Reply #6 on: October 18, 2018, 06:11:12 pm »
OK to use the Arduino GND since the circuit is galvanically isolated from mains.
An absolutely wrong assumption. Computer USB sockets are almost universally grounded through to earth ground. The only major exception, really, is laptops that don't have an earth ground connection. (In the case of Mac laptops, they are grounded if using the 3-prong cord.)

Well I measured my mac laptop, and with the 3 pronged chord I get that usb GND is ~1k to mains earth. So I guess I will have to use the two pronged one when powering circuits that I have to test with the scope, I guess…

Thanks.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: Probing usb powered circuit. Should I be scared?
« Reply #7 on: October 19, 2018, 10:34:27 am »
OK to use the Arduino GND since the circuit is galvanically isolated from mains.
An absolutely wrong assumption. Computer USB sockets are almost universally grounded through to earth ground. The only major exception, really, is laptops that don't have an earth ground connection. (In the case of Mac laptops, they are grounded if using the 3-prong cord.)

Well I measured my mac laptop, and with the 3 pronged chord I get that usb GND is ~1k to mains earth. So I guess I will have to use the two pronged one when powering circuits that I have to test with the scope, I guess…

Thanks.
1k to mains earth will be no problem for most applications. With a 5V supply, the highest leakage current will be 5mA, which won't damage anything.
 

Offline Mr. Scram

  • Super Contributor
  • ***
  • Posts: 9810
  • Country: 00
  • Display aficionado
Re: Probing usb powered circuit. Should I be scared?
« Reply #8 on: October 19, 2018, 10:39:33 am »
As a rule of thumb I wouldn't power circuits under test from computers you care about. Sooner or later you'll blow at least one USB port from it, and possibly worse.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11473
  • Country: ch
Re: Probing usb powered circuit. Should I be scared?
« Reply #9 on: October 19, 2018, 10:45:22 am »
OK to use the Arduino GND since the circuit is galvanically isolated from mains.
An absolutely wrong assumption. Computer USB sockets are almost universally grounded through to earth ground. The only major exception, really, is laptops that don't have an earth ground connection. (In the case of Mac laptops, they are grounded if using the 3-prong cord.)

Well I measured my mac laptop, and with the 3 pronged chord I get that usb GND is ~1k to mains earth. So I guess I will have to use the two pronged one when powering circuits that I have to test with the scope, I guess…

Thanks.
Literally the only thing to watch out for if the USB is grounded is to only ever connect the scope ground to the Arduino ground (which is the normal situation anyway). Done it many times with my Mac desktop, which is where my Arduino development is done. Sometimes there was various noise, which was cured by firmly tying the grounds together, and by having the scope ground as short as possible (i.e. standard good practice).
 
The following users thanked this post: Moriambar

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Probing usb powered circuit. Should I be scared?
« Reply #10 on: October 19, 2018, 11:02:38 am »
OK to use the Arduino GND since the circuit is galvanically isolated from mains.
An absolutely wrong assumption. Computer USB sockets are almost universally grounded through to earth ground. The only major exception, really, is laptops that don't have an earth ground connection. (In the case of Mac laptops, they are grounded if using the 3-prong cord.)

Well I measured my mac laptop, and with the 3 pronged chord I get that usb GND is ~1k to mains earth. So I guess I will have to use the two pronged one when powering circuits that I have to test with the scope, I guess…

Thanks.
Literally the only thing to watch out for if the USB is grounded is to only ever connect the scope ground to the Arduino ground (which is the normal situation anyway). Done it many times with my Mac desktop, which is where my Arduino development is done. Sometimes there was various noise, which was cured by firmly tying the grounds together, and by having the scope ground as short as possible (i.e. standard good practice).

So let me get this straight: you are saying that it is safe (both for the scope and the mac) to tie the grounds together (even with the current that will be ensured by the ~1k resistance), and that the only mistake I can make is to tie the scope ground to anything else than the arduino ground, right?

I'm sorry if I sound a bit confused: I am; both being a beginner and a non-native speaker is hindering me.

Thanks
 

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Probing usb powered circuit. Should I be scared?
« Reply #11 on: October 19, 2018, 11:05:00 am »
As a rule of thumb I wouldn't power circuits under test from computers you care about. Sooner or later you'll blow at least one USB port from it, and possibly worse.

well the problem is that I only have that one computer and the circuit is programmed and powered by that... Apart from galvanically isolating the laptop from mains, and the alternative to unplug/restart the circuit powered from somewhere else (which will make me lose the computer-arduino serial communication) is there anything else you think I can do to use scope&laptop together?

Cheers!
 

Offline Mr. Scram

  • Super Contributor
  • ***
  • Posts: 9810
  • Country: 00
  • Display aficionado
Re: Probing usb powered circuit. Should I be scared?
« Reply #12 on: October 19, 2018, 12:26:52 pm »
well the problem is that I only have that one computer and the circuit is programmed and powered by that... Apart from galvanically isolating the laptop from mains, and the alternative to unplug/restart the circuit powered from somewhere else (which will make me lose the computer-arduino serial communication) is there anything else you think I can do to use scope&laptop together?

Cheers!
You could isolate the connection between the device and laptop. There are devices you place between the DUT and your laptop which allow you to isolate the connection. Another option would be to use a USB hub or card that acts as a sacrificial device in case things go wrong, although it isn't guaranteed that it will take the hit alone.
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Probing usb powered circuit. Should I be scared?
« Reply #13 on: October 19, 2018, 12:30:48 pm »
I would recommend specifically a powered USB hub. Over the course of several years, I blew one USB port on a MacBook by drawing too much power from it. (In this case, it wasn’t a short, but was simply drawing far too much power from the port. A powered hub would have protected me there I’m fairly sure.)
 

Offline Mr. Scram

  • Super Contributor
  • ***
  • Posts: 9810
  • Country: 00
  • Display aficionado
Re: Probing usb powered circuit. Should I be scared?
« Reply #14 on: October 19, 2018, 12:34:48 pm »
I would recommend specifically a powered USB hub. Over the course of several years, I blew one USB port on a MacBook by drawing too much power from it. (In this case, it wasn’t a short, but was simply drawing far too much power from the port. A powered hub would have protected me there I’m fairly sure.)
A powered hub would offer you better chances, but without verifying the exact construction there's no saying what would actually happen.
 

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Probing usb powered circuit. Should I be scared?
« Reply #15 on: October 19, 2018, 12:42:01 pm »
Oh lord, there seems to be no end to this, what have I done?   :D
 

Offline GeoffreyF

  • Regular Contributor
  • *
  • Posts: 234
  • Country: us
Re: Probing usb powered circuit. Should I be scared?
« Reply #16 on: October 19, 2018, 01:01:15 pm »
Always check the grounds to assure they  are at the same potential. At the least your scope measurement will not be accurate if there is even a small amount of current flowing through the ground or a difference in ground potentials.

Technicians supporting rock concerts also check this before a performance. In a mild case, there is a hum which ruins the performance. If the potential difference is enough it can kill.  An example would be a microphone amplifier connected on one side of the stage and a guitar amplifier on the other.   The grounds are far enough apart that there can be an even lethal potential difference.  Nowadays, most use wireless transmitters which removes the problem.

I once saw this problem in a friends kitchen. The metal case of the refrigerator had that false texture which represents current flow.  Someone had done an amazingly bad job of connecting the mains socket for the fridge and it was not properly grounded.  I fixed it and fortunately nobody was hurt before that.

"The art of electronics" by Paul Horowitz and Winfield Hill discusses this from a measurement and safety point of view.  I recommend the book for many reasons but one of them is that.
US Amateur Extra W1GCF.
 
The following users thanked this post: Moriambar

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Probing usb powered circuit. Should I be scared?
« Reply #17 on: October 19, 2018, 01:04:34 pm »
Always check the grounds to assure they  are at the same potential. At the least your scope measurement will not be accurate if there is even a small amount of current flowing through the ground or a difference in ground potentials.

Technicians supporting rock concerts also check this before a performance. In a mild case, there is a hum which ruins the performance. If the potential difference is enough it can kill.  An example would be a microphone amplifier connected on one side of the stage and a guitar amplifier on the other.   The grounds are far enough apart that there can be an even lethal potential difference.  Nowadays, most use wireless transmitters which removes the problem.

I once saw this problem in a friends kitchen. The metal case of the refrigerator had that false texture which represents current flow.  Someone had done an amazingly bad job of connecting the mains socket for the fridge and it was not properly grounded.  I fixed it and fortunately nobody was hurt before that.

Ok, I'll try and measure...

Quote
"The art of electronics" by Paul Horowitz and Winfield Hill discusses this from a measurement and safety point of view.  I recommend the book for many reasons but one of them is that.

I have the book (although I have not read it cover to cover, just skimmed about some parts that interested me), can you please point me to where they discuss this? It sounds interesting
 

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 6426
  • Country: de
Re: Probing usb powered circuit. Should I be scared?
« Reply #18 on: October 19, 2018, 01:26:47 pm »
Oh lord, there seems to be no end to this, what have I done?   :D

This thread is no longer yours...  ;)

Actually, the thread is doing fine.
Everybody is actually still discussing the original topic! :)
 

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Probing usb powered circuit. Should I be scared?
« Reply #19 on: October 19, 2018, 01:34:56 pm »
Oh lord, there seems to be no end to this, what have I done?   :D

This thread is no longer yours...  ;)

Actually, the thread is doing fine.
Everybody is actually still discussing the original topic! :)

I meant that I thought to ask a simple question and to get a boring universal answer... Instead this interesting discussion has come along, and I hope to learn the most from it
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11473
  • Country: ch
Re: Probing usb powered circuit. Should I be scared?
« Reply #20 on: October 19, 2018, 02:34:40 pm »
So let me get this straight: you are saying that it is safe (both for the scope and the mac) to tie the grounds together (even with the current that will be ensured by the ~1k resistance), and that the only mistake I can make is to tie the scope ground to anything else than the arduino ground, right?
Yes. Tying the grounds together actually reduces the chances of problems. I routinely tie together scope ground and Arduino ground when scoping Arduino circuits.

I'm sure many more mistakes are theoretically possible, but yes, the main one is just to remember that the scope ground is earth ground (and thus Arduino ground, USB ground, etc), so don't connect the scope ground to anywhere else in the circuit but ground.

Of course, this is all assuming you are working with normal low voltage stuff. Don't even think of probing mains or other high voltage stuff until you're much, much more experienced and know how to do it properly. (I would not consider myself to be properly educated on how to do that.)

Finally, if you are powering your circuit (such as an Arduino) from a battery or isolated power supply (like most DC power supplies are), and USB is not connected (or the Macbook is not plugged in), then your circuit is "floating" and you can put the scope ground anywhere you like.

I'm sorry if I sound a bit confused: I am; both being a beginner and a non-native speaker is hindering me.
It can be confusing for beginners regardless. And your English is excellent! So don't worry. :)

Part of the confusion is that the discussion has forked in two directions: one is the scope ground question, the other is protecting the computer's USB socket from damage.

As a rule of thumb I wouldn't power circuits under test from computers you care about. Sooner or later you'll blow at least one USB port from it, and possibly worse.

well the problem is that I only have that one computer and the circuit is programmed and powered by that... Apart from galvanically isolating the laptop from mains, and the alternative to unplug/restart the circuit powered from somewhere else (which will make me lose the computer-arduino serial communication) is there anything else you think I can do to use scope&laptop together?
What I do, like many people, is to use an AC adapter (or lab power supply) to provide 7-12V DC to the Arduino's DC input jack. (9V is typical, but lower will let the Arduino's voltage regulator run cooler.) When you do this, the Arduino automatically stops pulling power from USB — but still retains the data connection.

The suggestion others have made, of using a powered USB hub in between, is an effective and simple way to protect the computer's USB ports in case you make a mistake. So it's certainly not a bad idea at all!
 
The following users thanked this post: Moriambar

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11473
  • Country: ch
Re: Probing usb powered circuit. Should I be scared?
« Reply #21 on: October 19, 2018, 02:39:38 pm »
I would recommend specifically a powered USB hub. Over the course of several years, I blew one USB port on a MacBook by drawing too much power from it. (In this case, it wasn’t a short, but was simply drawing far too much power from the port. A powered hub would have protected me there I’m fairly sure.)
Out of curiosity, do you know how much current you drew?? Macs made since 2007 can provide 1A (or more) per USB port, above the 500mA maximum of standard USB. (Of course, this is only supposed to be drawn after power negotiation.) Both overcurrent and dead shorting them should cause the port to go into overcurrent protection and turn off, with a message to that effect on screen.


Thinking aloud: wouldn't it also work to make a USB protector of sorts, that simply adds an inline fuse that would blow in a fault condition?
 

Offline GeoffreyF

  • Regular Contributor
  • *
  • Posts: 234
  • Country: us
Re: Probing usb powered circuit. Should I be scared?
« Reply #22 on: October 19, 2018, 02:58:14 pm »
Grounding is covered in section 8.16 of the third edition
Chapter 9 also has a lot of useful information.

"Practical Electronics for Inventors" by Paul Scherz and Simon Monk is also good (and perhaps better for this discussion)
2.10 talks about Grounds
2.22 talks about Mains power
Figure 2.90 is really great for this discussion.

Going back for finding these references, I am reminded that there is much overlap between the two books but Practical Electronics starts at a somewhat more basic level in some aspects.  The art of electronics is more for people who are looking to create projects that support college and graduate school experiments while practical electronics is more oriented towards people who want to invent something for it's own sake or as a business opportunity.

Geoff
US Amateur Extra W1GCF.
 
The following users thanked this post: Moriambar

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Probing usb powered circuit. Should I be scared?
« Reply #23 on: October 19, 2018, 03:22:27 pm »
Yes. Tying the grounds together actually reduces the chances of problems. I routinely tie together scope ground and Arduino ground when scoping Arduino circuits.

I'm sure many more mistakes are theoretically possible, but yes, the main one is just to remember that the scope ground is earth ground (and thus Arduino ground, USB ground, etc), so don't connect the scope ground to anywhere else in the circuit but ground.
Did measure a 0.076V stable difference between the usb ground and the usb gnd. I connected the scope gnd to it and nothing blew up. Great!

Quote
Of course, this is all assuming you are working with normal low voltage stuff. Don't even think of probing mains or other high voltage stuff until you're much, much more experienced and know how to do it properly. (I would not consider myself to be properly educated on how to do that.)

Finally, if you are powering your circuit (such as an Arduino) from a battery or isolated power supply (like most DC power supplies are), and USB is not connected (or the Macbook is not plugged in), then your circuit is "floating" and you can put the scope ground anywhere you like.

Yes, the only project I have that goes up over 5V is a motor one featuring a 12V DC motor, so I think I'll be safe. And, although I understand about "putting the grounding anywhere when you're floating", I feel like for now it's best for me to grow a habit to use the normal gnd, and maybe be extra careful and change it only when needed and floating

Quote

It can be confusing for beginners regardless. And your English is excellent! So don't worry. :)


Part of the confusion is that the discussion has forked in two directions: one is the scope ground question, the other is protecting the computer's USB socket from damage.
Thanks. Yes, both issues are important here…




Quote
What I do, like many people, is to use an AC adapter (or lab power supply) to provide 7-12V DC to the Arduino's DC input jack. (9V is typical, but lower will let the Arduino's voltage regulator run cooler.) When you do this, the Arduino automatically stops pulling power from USB — but still retains the data connection.
Well I did not know this. Great! I have a PSU albeit old and crusty (but it was free!) and I can use that one! Thanks

Quote
The suggestion others have made, of using a powered USB hub in between, is an effective and simple way to protect the computer's USB ports in case you make a mistake. So it's certainly not a bad idea at all!

One can never bee too safe. Thanks a lot, now all is way clearer.
 

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Probing usb powered circuit. Should I be scared?
« Reply #24 on: October 19, 2018, 03:23:09 pm »
Grounding is covered in section 8.16 of the third edition
Chapter 9 also has a lot of useful information.

"Practical Electronics for Inventors" by Paul Scherz and Simon Monk is also good (and perhaps better for this discussion)
2.10 talks about Grounds
2.22 talks about Mains power
Figure 2.90 is really great for this discussion.

Going back for finding these references, I am reminded that there is much overlap between the two books but Practical Electronics starts at a somewhat more basic level in some aspects.  The art of electronics is more for people who are looking to create projects that support college and graduate school experiments while practical electronics is more oriented towards people who want to invent something for it's own sake or as a business opportunity.

Geoff

Great thanks, also for the book recommendation!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf