8
\$\begingroup\$

I was about to make a self-powered USB device that works on its own and sometimes connects to a host. I realized my only option might be powering it with an isolated power supply. I want to fully understand the reason why it is dangerous to use nonisolated supply. The below image shows how I think the connections would be in the USB host and device:

Simple Representation

My thinking:

  • Let's take Earth and Neutral as 0 V (ignoring a few volts difference for now).
  • GND2 will swing between 0 V and -310 V
  • GND1 will always be 0 V
  • Massive currents on connection!

Q1) Some power supplies don't reference DC ground to Earth and it is floating. In that case, maybe it is safe to connect a nonisolated USB device and they float together?

Q2) If there was a way to connect device ground to Earth, would it be safe?

Q3) Is there a way to make a USB offline switcher application safe? Or safe and also legal?

One option I could think of is optocouplers, but it would overcomplicate, because the transmission is two ways. I want a simple solution. Simpler and cheaper than building/using a flyback converter.

Note: The device consumes 0.33 W at maximum.

\$\endgroup\$
2
  • \$\begingroup\$ If you are using only the Tx and Rx of the USB-to-UART converter, you can use dirt cheap digital isolator like CA-IS3721/CA-IS3722 (150Mbps) or π121U31/π122U31 (150kbps). \$\endgroup\$
    – kaosad
    Commented 11 hours ago
  • \$\begingroup\$ @CaveScientist What's the nature of your device? Majority of self-powered USB devices are powered by isolated AC-DC power supplies, as you've notices. Few exotic self-powered USB devices are powered by non-isolated power supplies, and they achieve isolation of the USB some other way. I wonder which category your device would fall into. \$\endgroup\$ Commented 8 hours ago

7 Answers 7

8
\$\begingroup\$

There are standards to follow when designing electronics. You theoretically can make whatever you want to design and test it. But if you were to sell it, you will have to go through the process of certification/validation.
These standards change, have expiration dates and become harder to comply as years go by, they become more strict.
For example for EU's Electromagnetic compatibility (EMC) standards, this link, go down to Summary list as pdf/xlsx file and you can download and see all the standards and which have been expired.
For safety standards in EU, Low voltage (LVD) test follow this link, go down and download Summary list as pdf/xls document and see the standards that are still valid or expired.

These standards don't tell you how to design your boards, they define how your boards should behave after you have finished your design. So, if you actually find a way to design your layout they way you describe AND pass these test, well, you might as well become rich and famous because I haven't seen your hookup being used in CE-rated devices, it would save up so much cost on components.

(There are some parts on the standards that DO tell you how to layout/proper distance your components actually, but this is done due to "pollution", aka how much dust you expect your device to gather after years).
standard distances Image source: from EN 61010-1:2010

An example for your case would be, if you were to get CE marking for your device, to follow transient tests and low voltage safety standards. Such standards examples include:

  • EN 61010-1 (Safety requirements for electrical equipment for measurement, control, and laboratory use)
  • CE marking process for electrical devices
  • EN 61326-1 (Electrical equipment for measurement, control and laboratory use – EMC requirements Part 1: General requirements) including testing and documentation according to EU directives

For example one test includes to bias with 8kV your AC phase. They also bias with 8kV your neutral as well because you might plug your device on the AC outlet the other way, so considering Neutral 0V will fail the test, as it will short the Main or neutral with your low voltages.

I want to fully understand the reason why it is dangerous to use non-isolated supply

The isolated power supplies are PHYSICALLY isolated with two coils very close to each other. This means they physically can not pass the main's voltage to low/DC voltage output, whatever happens (except extreme conditions like hitting the PS with a hammer I guess).

isolated ps
Image source

There are many things to take into account when designing AC/DC PS like Main's transients, what happens in case a component fails, lighting strikes etc.

Regarding your questions:

Q1) Some power supplies don't reference DC ground to Earth and it is floating, in that case maybe it is safe to connect a non-isolated USB device and they float together?

Whatever passes the EMI/EMC and safety tests. Selecting a proper AC/DC converter is also something you should properly assess. Some AC/DC converters use a safety capacitor with high enough leackage that will make you see 110V if you measure between the output of the AC/DC to the GND. Medical AC/DC power supplies usually solve this issue, they are just a bit more expensive.

Q2) If there was a way to connect device ground to Earth, would it be safe?

Again, you need to pass the safety tests for that. Its usually safer to connect the (every) return path to Earth because it makes it safer in case AC mains touches your low voltage, but you need to pass the EMC/EMI tests as well, where is you connect the GND/Earth together, makes it harder usually because there is this transient test that biases your mains, neutral and Earth with 2kV spikes so you want your electronics to stay away from Earth (usually)

Q3) Is there any way to make USB offline switcher application safe? Or safe and also legal?

Usually isolators is one way to do it. Other that passing the tests for CE/safety standards, I suggest following datasheet's recommendations and buying a alredy-existing AC/DC power supply. The AC/DC PS come with verification on some safety standards that you can see on their datasheets.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Thank you for explaining in terms of real-world practices. I will definitely use a standard compliant AC/DC power supply. The initial cost is nothing compared to getting verification for my custom power supply. Good perspective. \$\endgroup\$ Commented 2 days ago
5
\$\begingroup\$

Why is it dangerous? Devices and their external connections may not have live parts so that it becomes dangerous to touch the device itself or something connected to it that becomes also live. In comparison, you will also not design/make a floor lamp or a toaster with the metal parts wired to live, and you would do everything you have to in order to prevent such a fault from happening by accident.

  1. No, not safe. If you keep your custom device unisolated, and connect a USB cable to it, the exposed metal parts on the other connector on the cable are live. If you plug a battery-powered fully isolated laptop to your device, the laptop and all its exposed metal parts become live and it will be dangerous to use it - regardless of the laptop running on batteries or with floating supply. Connecting an earthed desktop PC blows the mains fuse as through the diode there will flow tens of amps short circuit current from Live to Earth through USB cable.

  2. There are ways - isolate the supply, or isolate the UART or isolate the USB. Only expose isolated parts

  3. Same options as #2.

\$\endgroup\$
2
  • \$\begingroup\$ Simple and plain facts thanks. And that isolation you talk about won't worth the hassle, I've seen some articles that discuss USB data isolation, oh boy... I must just get a galvanically isolated power supply. I just can't find anything less powerful and cheaper than HLK-PM03 and IRM-01-3.3. They have higher cost, less efficiency (in low currents) and redundant power capacity compared to offline switchers. \$\endgroup\$ Commented 2 days ago
  • 1
    \$\begingroup\$ @CaveScientist there are USB isolation chips and the PC side is powered from PC and the other side from your dangrous supply which needs to power the USB-UART chip and your MCU too. Likewise if you use a data isolator chip, you power USB UART and data isolator PC side from PC and the other side of isolator from hazardous unisolated side. \$\endgroup\$
    – Justme
    Commented 2 days ago
5
\$\begingroup\$

GND2 will swing between 0V and -310V

In addition to the risks you have identified, "GND2" and anything referenced to it is an immediate shock hazard. There needs to be suitably safety-rated insulation between "GND2" (or anything referenced to it) and anything a user can touch.

USB connectors are not designed to be touchproof, nor is the insulation on USB cables rated for mains voltages.

Some power supplies don't reference DC ground to Earth and it is floating, in that case maybe it is safe to connect a non-isolated USB device and they float together?

If everything is inside a suitable enclosure and everything has been carefully vetted, you could possibly do this, but I don't recommend it. If you really must do it, please add copious warning notices inside the enclosure, so the next guy doesn't get shocked.

And remember, the device on the other end of your USB connection is probably not designed to be an isolation barrier. If you connect your board to, say, a Raspberry Pi, and then connect a keyboard monitor and mouse to the Raspberry Pi, then even if those devices have floating power supplies or are bus powered, then all of those devices now have their "grounds" at a dangerous voltage.

Ethernet is isolated, but I would still not want to treat an Ethernet transformer as a safety isolation barrier, unless it was specifically rated for use as such.

Q2) If there was a way to connect device ground to Earth, would it be safe?

In normal operation, your device must maintain a good level of isolation between the mains input connections and mains earth. Some leakage is allowed, and using mains earth can sometimes allow the use of lower-rated isolation barriers, but it does not eliminate the need for isolation.

Is there any way to make USB offline switcher application safe? Or safe and also legal?

You need to have at least one isolation barrier between the mains input and any part of your system users could come into contact with.

My understanding is you generally have three options.

  1. A barrier that meets the standards for "reinforced insulation"

  2. Two separate barriers that meet the standards for "basic insulation" and "supplementary" insulation.

  3. A single barrier that meets the standards for "basic insulation" in combination with tying the safe side of your barrier to mains earth, so that if the single barrier fails, then fault current flows to mains earth rather than into the user.

Where you put those barriers is up to you. For low power applications, it usually ends up easiest to put it in the mains power supply. That keeps the "dangerous" part of the system as small as possible, which both makes certification easier and reduces the risk to your engineers during development.

On the other hand, there are situations where you do need to put significant electronics on the "dangerous" side.

If ease matters more than cost, then multiple manufacturers (at least Analog Devices and Texas Instruments) sell USB isolator ICs.

\$\endgroup\$
4
\$\begingroup\$

This connection would be very dangerous for the reason you described.

That has nothing to do with USB however, but with that circuit 2 is not galvanically isolated from mains, which is very dangerous.

If circuit 2 was galvanically isolated from mains, then regardless of whether its ground would be floating (SELV) or PE-bonded (PELV), it would be safe.

\$\endgroup\$
3
\$\begingroup\$

I want to fully understand the reason why it is dangerous to use non-isolated supply.

  • Because the user could be exposed to wall voltage on any metal parts, including the USB cable ends and plugs.

  • Differences in ground potential between devices can result in one or more devices breaking or catching fire.

Possibly approaches to your problem...

You didn't specify how much input wattage you need, but you can get a 60Hz isolation transformer for not that much money if the wattage is low (like <100W). Just put the transformer before your full bridge rectifier. As a bonus, the transformer can step down the voltage at the transformer output to like 6V or 24V, so you can just use a regular DC-DC supply rather than an offline switcher rated for high voltage operation.

Some Examples would be...

In the case where you decide not to isolate the whole device at the AC power input, its a lot cheaper and easier to isolate the digital signals (TXD, RXD, CTS, DSR, RI, DCD, DTR, RTS) on U3 rather than the USB signals (UD+ and UD-).

For low speed (like 9600bps) you can just use standard opto-isolators that cost like $0.10 ~ $0.20. One example would be the DPC817S-C-TR, which is available on DigiKey for like $0.12 in small quantities, or $0.06 in bulk.

For faster speeds use a digital isolator made by a variety of vendors like Analog Devices, Silicon Labs, Texas Instruments, etc. One example would be something like the ISO7742FDBQR, which costs like $1.45 in small quantities, and provides four isolated channels up to 100Mbps.

To power U3 on the isolated side of the USB, there are a variety of small board mount isolated DC-DC converter modules that cost under $5 each.

\$\endgroup\$
2
\$\begingroup\$

Is there any way to make USB offline switcher application safe?

Yes, there's a really easy but slightly clunky way to do it. Buy and use a shaver socket:-

socket

This one costs £14 and is professionally designed and manufactured. I use one for directly mains powering valves to ~340 VDC.

It might save your life.

\$\endgroup\$
8
  • 2
    \$\begingroup\$ I guess availability depends on where you live. For example we don't have those, except maybe in hotels for people that bring their own shavers with weird plugs. And are you sure those really isolate or are they simply autotranformers, or are they transformers at all? Some electronic type adapters simply clip the waveform for a 120VAC shaver to work and are rated only for very small power loads like shavers. \$\endgroup\$
    – Justme
    Commented yesterday
  • \$\begingroup\$ @Justme You really don't have those? What if you drop the razor into the sink and then fetch it out? \$\endgroup\$
    – Paul Uszak
    Commented yesterday
  • 1
    \$\begingroup\$ Nope, we don't. We simply don't do that of course. I mean, why would you have a sink filled with water and be shaving over it with a mains powered razor, that's literally against every basic electrical safety rules everyone here is aware of, so doing that would be known to be dangerous and so nobody would do that. In addition, bathrooms where such accidents are possibe, have been required by building code to have RCD protected outlets for nearly 30 years now. Which means even before that RCDs were certainly often used for bathroom sockets, just not mandatory. \$\endgroup\$
    – Justme
    Commented yesterday
  • 1
    \$\begingroup\$ Shavers today are often not even mains powered, they might have rechargeable batteries or if not then they still will have a low voltage isolating power supply (wall wart) so the device gets SELV rated power. \$\endgroup\$
    – Justme
    Commented yesterday
  • \$\begingroup\$ I've never seen one of these before. They seem to just not exist in the US, where the requirement is simply for outlets in bathrooms and other places where water is present to be protected with GFCIs. \$\endgroup\$
    – Hearth
    Commented 5 hours ago
1
\$\begingroup\$

You can buy a USB isolator built into an A female to A male plug .. It uses transformers both for feeding some bus power across and also for the bidirectional signalling. However it would be best to minimise the amount of circuitry at mains voltage. You never know when you or somebody else in the future takes the lid off the box and gets mains voltage when they probe the ground on the ICs..

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I would implement bidirectional digital isolator, but it would be an overkill. Plus, as you said no need to danger people especially on a project where I don't even consider a box for version one. I will go with galvanically isolated supply and cover AC pins with something like a silicon or epoxy (will research alter). Thanks. \$\endgroup\$ Commented 2 days ago

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.