Author Topic: Mains powered device with USB comms  (Read 1323 times)

0 Members and 1 Guest are viewing this topic.

Offline StefanoTopic starter

  • Contributor
  • Posts: 14
  • Country: it
Mains powered device with USB comms
« on: November 24, 2022, 05:08:38 pm »
Hello,
I'm working on a PCB heater that is powered from mains and is controlled via an ESP32. (I'm the guy from the mosfet post)

I've never made a device powered from mains that also has a USB port (ESP32 programming), and I was wondering if the two grounds can be simply connected together, or special care needs to be taken.

I attached the schematics (look at power and usb section), in essence:

Mains 230V --> AC/DC brick (12V) --> Switching voltage regulator (3.3V) --> ESP+CH340+USB

The USB port will be connected to a PC or anything that can read a serial port.

The 5V of the USB is not used, so the pins are left floating, but the ground pins are connected to the GND plane of the circuit.

My understanding is that there needs to be isolation when you are dealing with earth to avoid creating ground loops, in my scenario however, the enclosure of this device is 3D printed and the brick doesn't have any connection to earth ground, so I'm only dealing with Live and Neutral from mains.

Can I connect the USB Gnd to the same Gnd coming from the AC/DC brick or do I need to take special care of that?

Thanks

 

Offline RJSV

  • Super Contributor
  • ***
  • Posts: 2120
  • Country: us
Re: Mains powered device with USB comms
« Reply #1 on: November 24, 2022, 11:33:36 pm »
   I would think a single ground connection won't create a ground loop, but later, your stuff connected (to USB) would have to be evaluated.
Does the 12 V supply 'ground' have a metal box connection, or any metal panels ?  Might be connected back to mains ground, which would be Earth ground.
Shouldn't be problem, unless some fault or insulation break (is touched), and also that earth ground.
 

Offline TimNJ

  • Super Contributor
  • ***
  • Posts: 1656
  • Country: us
Re: Mains powered device with USB comms
« Reply #2 on: November 24, 2022, 11:36:22 pm »
How would you power your circuitry if you do not connect the (-) of the AC/DC brick? What is the alternative you are thinking about?

You have no explicit earth connection so what loop do you think could be possible? Between where and where?
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4946
  • Country: si
Re: Mains powered device with USB comms
« Reply #3 on: November 25, 2022, 06:33:29 am »
You can find mains powered USB devices that do one or the other.

Some are non grounded "double insulated" devices that just have 2 prongs on the mains plug. This is usually things like TVs and printers.

Some have a full 3 prong plug and will typically have a connection between USB GND and mains earth. Most test equipment with USB on the back is like this.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Mains powered device with USB comms
« Reply #4 on: November 25, 2022, 06:46:59 am »
You'll want to verify, but the power brick should produce a fully isolated DC voltage. If it's some kind of non-isolated converter then you need to replace it with one that is isolated. The output of an isolated converter can be treated more or less like a battery, it is not connected to the input.
 

Offline StefanoTopic starter

  • Contributor
  • Posts: 14
  • Country: it
Re: Mains powered device with USB comms
« Reply #5 on: November 25, 2022, 08:43:38 am »
Quote
You'll want to verify, but the power brick should produce a fully isolated DC voltage.
Indeed it is, from the DS: "High I/O isolation test voltage up to 4200VAC".

Quote
You have no explicit earth connection so what loop do you think could be possible? Between where and where?
I have no reason to think a gnd loop can be formed, I was just woundering if special care needs to be taken in connecting the grounds together.

Quote
Some are non grounded "double insulated" devices that just have 2 prongs on the mains plug. This is usually things like TVs and printers.
Yes indeed my device will be just like one of those two.

Quote
Does the 12 V supply 'ground' have a metal box connection, or any metal panels ?  Might be connected back to mains ground, which would be Earth ground.
Nope, just a plastic case and four pins, live, neutral, V+ and V-.

Quote
Shouldn't be problem, unless some fault or insulation break (is touched), and also that earth ground.
The plug will have 2 prongs and the device will be kept inside its enclosure, so everything is fine.

Thanks a lot guys.
 

Offline xmris

  • Contributor
  • Posts: 46
  • Country: gb
Re: Mains powered device with USB comms
« Reply #6 on: December 04, 2022, 01:23:07 pm »
probably silly comment from me -not an electronics pro- but if you are going to use a 2-prong AC that is non 'polarised', don't you need double-fusing there?
READY.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11473
  • Country: ch
Re: Mains powered device with USB comms
« Reply #7 on: December 04, 2022, 02:46:18 pm »
Can I connect the USB Gnd to the same Gnd coming from the AC/DC brick or do I need to take special care of that?
Your AC/DC supply doesn’t have a ground at all. It has a floating output whose negative pole you’re using as the 0V reference of your circuit.

Yes, we normally call the 0V reference in our circuits “ground”, but don’t confuse it with an actual earth ground (such as the PE (protective earth) in an AC cable). Your 0V reference doesn’t become an earth ground until you connect it to earth ground. The USB ground might be at earth ground (like with a desktop PC) or not (like with a laptop running on battery). Consequently, you must design USB circuits with the assumption that USB ground is connected to earth ground.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12855
Re: Mains powered device with USB comms
« Reply #8 on: December 04, 2022, 03:07:01 pm »
This becomes critically important when the USB device has high power DC supplies or loads in it or controlled by it.  Its far too easy to create a ground loop that will destroy your PC motherboard by passing excessive current through its USB ground traces. 

e.g. any 3D printer with PSU 0V/negative tied to Mains PE/Ground, and a non-isolated USB interface can destroy your PC if the negative/ground wire between the PSU and the controller comes loose.  All appears normal at first (except it wont power up if the USB lead is unplugged), as the return path for the controller's power is via the USB lead, and the ground wires in the PC and 3D printer power leads.  Then as soon as you start a print (or preheat) the bed heater turns on, and its typically 15A load current has to return via the same undesirable path.  If you are very lucky, the USB lead has a high quality low resistance shield connection at each end, and the PC USB A socket shield is well grounded to chassis and it will simply melt your USB lead.  However if that ground return current tries to flow through the motherboard, expect your PC to let the magic smoke out.
 
The following users thanked this post: tooki

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16607
  • Country: us
  • DavidH
Re: Mains powered device with USB comms
« Reply #9 on: December 04, 2022, 04:51:16 pm »
Your "AC/DC brick (12V)" should be providing a galvanically isolated 12 volts, so the USB ground connection will not create a ground loop.

For safety, it may still be desirable to use a galvanically isolated USB connection.
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2389
  • Country: gb
  • Recovering Electrical Engineer
Re: Mains powered device with USB comms
« Reply #10 on: December 05, 2022, 11:34:55 am »
Double fusing creates more problems than it solves.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11473
  • Country: ch
Re: Mains powered device with USB comms
« Reply #11 on: December 05, 2022, 11:51:57 am »
How so?
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7369
  • Country: nl
  • Current job: ATEX product design
Re: Mains powered device with USB comms
« Reply #12 on: December 05, 2022, 12:08:32 pm »
How so?
Nothing guarantees that the phase will break. Could be the neutral connection that breaks.
OP: If you don't expose the USB connection on the outside, that solves your problem. Not everything needs to be user programmable.
 
The following users thanked this post: xmris

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: pl
Re: Mains powered device with USB comms
« Reply #13 on: December 05, 2022, 03:22:15 pm »
Captain Obvious makes an observation: the board has no earth connection to start with.

So what was the question again? :)
People imagine AI as T1000. What we got so far is glorified T9.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Mains powered device with USB comms
« Reply #14 on: December 05, 2022, 08:34:05 pm »
Captain Obvious makes an observation: the board has no earth connection to start with.

So what was the question again? :)

It does if you plug the USB port into a desktop PC. The USB cable shield and DC ground of a PC is connected to earth ground.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11473
  • Country: ch
Re: Mains powered device with USB comms
« Reply #15 on: December 06, 2022, 12:19:43 am »
How so?
Nothing guarantees that the phase will break. Could be the neutral connection that breaks.
And the consequence of this is...?
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: pl
Re: Mains powered device with USB comms
« Reply #16 on: December 06, 2022, 05:29:23 am »
It does if you plug the USB port into a desktop PC. The USB cable shield and DC ground of a PC is connected to earth ground.
And the original question is about connecting USB’s ground to “the other ground”. There is no other ground, in particular on the high voltage side.

People imagine AI as T1000. What we got so far is glorified T9.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Mains powered device with USB comms
« Reply #17 on: December 06, 2022, 07:35:44 am »
It does if you plug the USB port into a desktop PC. The USB cable shield and DC ground of a PC is connected to earth ground.
And the original question is about connecting USB’s ground to “the other ground”. There is no other ground, in particular on the high voltage side.

"Ground" is often used to describe the negative terminal of a DC supply, it doesn't always mean earth ground. Since the power supply provides galvanic isolation this is not an issue, but from what I could tell that was the question the OP was asking.
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2389
  • Country: gb
  • Recovering Electrical Engineer
Re: Mains powered device with USB comms
« Reply #18 on: December 06, 2022, 07:49:03 am »
Becasue the neutral can blow leaving the live connected without the fault conditon being controlled. This can fool you into thinking mains is not present when it is. There is no phase to ground protection
Double pole fusing makes sense in some shukoland distribution schemes or other situations where the power socket allows L and N to be reversed.
This is why double pole fusing is mandatory in medical devices.

We call ground "earth" in the UK to avoid the ambiguity. We call GFCI's RCDs to make clear the difference. Britsh electricity is a kwality item.
In my local experience "ground" is a term more commonly used in DC systems.
Hi and Lo, more problems! Telecoms -48V, mmmm.

Ref adds to the problem. It might be an AC or DC ground/ earth/ ref/ frame earth/ common. I might be a protective connection or not.
Grounds may connect to earth or may of the above of course. We need a better word for return conductors. I know, Return Conuctors!

A good understanding of earthing and bonding is needed.
Electricians talk a diferent languge and we need to translate carefully....... I choose my fuses to have the right poppage factor as an Ohmage to the Amperage of the Volteration.
« Last Edit: December 06, 2022, 08:43:16 am by Terry Bites »
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: pl
Re: Mains powered device with USB comms
« Reply #19 on: December 06, 2022, 08:42:55 am »
"Ground" is often used to describe the negative terminal of a DC supply, it doesn't always mean earth ground. Since the power supply provides galvanic isolation this is not an issue, but from what I could tell that was the question the OP was asking.
I know what GND is.

Do you think OP speaks about DC side GND, against which USB data lines are already referenced? And builds the entire question around 230V mains, focusing on this being their first project that incorporates mains-powered PCB and USB, if it’s not relevant to what what they’re asking about?

I do not and believe they are concerned about main’s earth.
People imagine AI as T1000. What we got so far is glorified T9.
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2389
  • Country: gb
  • Recovering Electrical Engineer
Re: Mains powered device with USB comms
« Reply #20 on: December 06, 2022, 08:50:05 am »
It sounds like the PSUs are not galvanically isolated in his power systems. If they were he wouldnt have the wierd behaviour when connecting the scope gnd. Still OP's, as ever, need to give us a drawing instead of leaving it to our imagination.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf