Author Topic: USB isolator to prevent earth/ground loop when connecting microcontroller to PC  (Read 10977 times)

0 Members and 1 Guest are viewing this topic.

Offline TadaspadasTopic starter

  • Newbie
  • Posts: 9
  • Country: gb
Hello everyone,

I am facing a ground/earth loop problem when connecting my device to the PC through the USB cable. The device has a sensor immersed in conductive water together with other electronics there, some of which are potentially connected to the earth. When I want to log data I connect the microcontroller through the USB cable to a PC workstation and suddenly I create an earth loop through the socket and the grid. The microcontroller is sending data to the computer at 2 Hz frequency with a baud rate of 115200.

In order to prevent this issue, I should use an optocoupler or other type of isolator. The question is whether these cheap 12 Mbps isolators will be quick enough to transfer data to the computer and what potential alternatives do I have?

If any of you have used good USB isolators, please give me your recommendations.

Kind regards,
Tadas
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3034
  • Country: us
There are high-speed optoisolators, e.g. the 6n135/6 rated for 1 megabaud:

https://www.vishay.com/docs/83604/6n135.pdf

Also found this forum thread:

https://www.eevblog.com/forum/reviews/chinese-usb-isolator-test/
« Last Edit: June 17, 2021, 02:18:37 pm by ledtester »
 

Offline TadaspadasTopic starter

  • Newbie
  • Posts: 9
  • Country: gb
Hi ledtester,

Thanks for your contribution. However, I think it is a bit misleading suggestion. I am talking about full microUSB isolation, not only a single line optocoupler, as you identified in the link above.

Also, to add more info to the case, I would prefer a complete device rather than spare components, due to a short time scale as this unexpected problem needs tp be resolved quickly. Thanks
 

Online bdunham7

  • Super Contributor
  • ***
  • Posts: 7812
  • Country: us
You can get the Analog Devices eval board:

https://wiki.analog.com/resources/eval/user-guides/circuits-from-the-lab/cn0419

As far as whether a particular cheapo isolator from Aliexpress will work in your application, it's hard to tell and you may just have to try a few.  I would think even the slow ones would be fast enough, but there are always random issues that can come up.
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 
The following users thanked this post: Tadaspadas

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2596
  • Country: us
What is the device that you are connecting to the PC? Is it a microcontroller in a device you made, or is it a USB to serial adapter or something?  Honestly chances are the answers to those questions don't really matter because the 12Mbps that most of those isolators offer is a hundred times more throughput than the 115kbaud you need to transport, so even with protocol overhead that shouldn't be an issue at all.  I think most of the ones you find on the internet use the same AD4160/3160 parts, so all should perform about the same as the CN0419 eval board you can get directly from Analog Devices.  It may be more a of a question how good their isolated power supplies are, especially if your device is relatively high power, but if necessary you should be able to provide a separate power supply and only use the isolator to carry the data.
 
The following users thanked this post: Tadaspadas

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2297
  • Country: gb
+1 for the ADUM3160

It's used on the USB isolators you can find on eBay, e.g.
https://www.ebay.co.uk/itm/324127452071

 
The following users thanked this post: Tadaspadas

Online Terry Bites

  • Super Contributor
  • ***
  • Posts: 2388
  • Country: gb
  • Recovering Electrical Engineer
I've also used the CN0419 and it worked fine. Not cheap, but probably chepaer than blowing up your kit.
USB over network wired or wirelss is a bit slow but very cheap to implement. USB over wire is by definition isolated. You can upgrade the magnetics if you need to. 4kV is avaialble.
USB to bluetooth ADU2B02P?? Never tried it. Hate bluetooth.
 
The following users thanked this post: Tadaspadas

Offline TadaspadasTopic starter

  • Newbie
  • Posts: 9
  • Country: gb
Thank for all contributions.

To ajb,
What is the device that you are connecting to the PC? Is it a microcontroller in a device you made, or is it a USB to serial adapter or something?
I am using an arduino Due microcontroller board in this prototype. Everything inside the box, including my own made PCB, is powered by isolated power supply, so there is no earth tied connection coming to the main system. Investigations shown that the USB connector causes the main issue. I have read about these ADUM4160 modules and it seems that it is mainly used in all cheap USB isolators, while others rely on a better Silanna ICE09USB chips (which is discontinued already for a couple of years).

Also, it is worth mentioning that I am not powering anything through the USB port, since Arduino Due is supplied from +12V "inside the box" converter. This ground/ earth in this case is just a reference for USB serial data transfer.
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2596
  • Country: us
Yeah, your application isn't terribly demanding so I doubt that any of those isolators would be a problem as long is they're not *complete* garbage.  Alternatively, you could redirect your output to one of the UARTs on the Arduino and connect it to an offboard USB-Serial adapter through a regular digital isolator IC (or even optocouplers).  That would be a good deal cheaper and if you've already got a couple of optos and one of those little FTDI boards (or equivalent) on hand you've got your solution right there.
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6227
  • Country: fi
    • My home page and email address
I regularly use cheap eBay ADuM3160-based isolators with Arduino-compatible microcontrollers.  They are direct implementations of the datasheet, and only the isolated DC-DC converter on them varies (providing isolated 5V from the host computer); they also typically provide less power than they draw from the host (due to losses).  I would not expect more than 350mA (while drawing max. 500mA from the host computer).

In Europe, the Olimex USB-ISO is a viable option too.

The ADuM3160 datasheet is short and the circuit really is very simple, and the CN0373 reference design (lower left corner of figure 1) shows you really only have a couple of resistors (24 Ohm 1% for 12 Mbit/s operation, none for 1 Mbit/s) and a couple of capacitors, and maybe a ferrite bead; plus whatever circuitry you need for the isolated 5V-5V DC-DC conversion.  Which isn't much.

Personally, I just checked the DC-DC converter on my cheapies when I bought them, and verified they are isolated DC-DC converters (and they were), and they seem to work absolutely fine for me.  (Whenever I poke around with the connections on my microcontrollers, I use an isolator as a final safety measure against my own butterfingery.  In theory, USB should be tolerant of even shorting USB 5V to ground, but with my luck, I'd manage to release the Magic Smoke without the isolator somehow.)

Do note that the ADuM3160-based ones typically have a dip switch selecting 1 MBit/s (low-speed USB) and 12 MBit/s (full-speed USB); I always use mine in the 12 MBit/s mode.  These do limit the speed, and high-speed USB (480 MBit/s) wont work – or rather, they work, but will be limited to 12 MBit/s.
Using Teensies and ATmega32u4 Pro Micro clones (with Arduino Leonardo boot loaders), I get the same ~ 1 Mbyte/sec transfer rate over the isolator as I do without.  (These all have native USB, and not an USB-to-serial converter like most Arduinos have.)
« Last Edit: June 17, 2021, 05:03:53 pm by Nominal Animal »
 
The following users thanked this post: perieanuo

Offline fordem

  • Regular Contributor
  • *
  • Posts: 234
  • Country: gy
There's perhaps a much simpler approach - use a laptop and power it off of the battery when isolation is required.

This, I believe, you will find is the norm in the UPS industry, field techs carry laptops which are required to perform diagnostic tests on units that should be properly grounded, but may not be, depending on the fault that particular unit may have developed.  I've seen Dell Latitudes used with dual battery slots, those can be kept running without AC power for as long as you have charged batteries available, I currently use a T-series Thinkpad with one internal & one external battery - this like the Dell units, can be run without AC power for as long as there are charged batteries.
 
The following users thanked this post: EEEnthusiast

Online Miyuki

  • Frequent Contributor
  • **
  • Posts: 903
  • Country: cz
    • Me on youtube
Here is not yet available any high-speed USB isolator?  :-//
 

Online Gyro

  • Super Contributor
  • ***
  • Posts: 9470
  • Country: gb
Here is not yet available any high-speed USB isolator?  :-//

I believe there are a few fully packaged off the shelf commercial products, but at high cost.

You need to check their specs very carefully to make sure you aren't accidentally buying a USB2 full speed rather than USB2 high speed. Some advertisements are quite misleading.
Best Regards, Chris
 
The following users thanked this post: Someone

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3709
  • Country: us
 

Offline bson

  • Supporter
  • ****
  • Posts: 2269
  • Country: us
You could also modify your board to have a floating VCP serial chip (such as Silabs CP210x) powered off USB.  Then all you need is to isolate RX/TX with a pair of optocouplers between the VCP IC and your microcontroller.  This way you get all the convenience of plugging directly in to USB on a host or hub, without additional isolator boxes and stuff.
« Last Edit: June 17, 2021, 11:32:11 pm by bson »
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9005
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Here is not yet available any high-speed USB isolator?  :-//
There is - it's called a Raspberry Pi running USB/IP.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 
The following users thanked this post: Gyro

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6227
  • Country: fi
    • My home page and email address
There's perhaps a much simpler approach - use a laptop and power it off of the battery when isolation is required.
I do that too.  I personally don't need the isolator to break ground loops, but to protect my more expensive hardware from my butterfingery when I experiment with microcontrollers.  Technically, USB is supposed to handle even VUSB-GND shorts indefinitely, but spending 8-18€ for an isolator to be certain was a no-brainer to me.

The ones I got off eBay do have nice isolation, BTW, typically 1 kV (due to the cheaper DC-DC converters used).  They really are very simple devices, with just a few passives (resistors and capacitors) in addition to the ADuM3160 and DC-DC isolator parts.  There is nothing to cut out to reduce price, so as long as those two components are legitimate, and the board itself looks okay (not a reject or something), they really are acceptable for the task here.

The Olimex one has one very useful additional feature: you can use an isolated DC supply, 8 - 15 VDC, to supply up to 750mA at 5VDC to the device.  This supply is not isolated from the device, it is directly provided, so you do need to use an isolated AC-DC supply.

If it matters any, putting an ADuM3160 to your own design in externally provided devices, is similarly trivial.  Keep traces short and according to the datasheet, use the recommended passives, and it will Just Work.

(Similar ground loop and noise issues occur with 3D printer and other robotics controller boards, if connected to a PC via USB.  These controllers almost always share motor ground with logic ground, you see.  This is also why most 3D printers are not connected to your PC via USB so you could control them directly from software (and disconnect the USB after "uploading" the files to an SD card), and instead you have to use a physical SD card to transfer the files.)
 

Online croma641

  • Contributor
  • Posts: 40
  • Country: it

There's a new T.I. USB2 ISOUSB211 High/Full/Low Speed Isolated USB Repeater, now in pre-production :


1 Features
• Compliant to USB 2.0
• Supports low speed (1.5 Mbps), full speed (12
Mbps) and high speed (480 Mbps) signaling
• Automatic speed and connection detection
• Programmable equalization to compensate board
trace loss in high speed mode
• CDP advertising on downstream side
• Supply OK indication on opposite side
• Supports automatic role reversal
• High CMTI: 100 kV/μs
• VBUS voltage range: 4.25 V to 5.5 V
– 3.3 V and 1.8 V internal LDOs
• Meets CISPR32 class B emissions limits
• Ambient temperature range: –40°C to +120°C
• Small footprint 28-SSOP package
• Safety-related certifications:
– 8000-VPK VIOTM and 2121-VPK VIORM
(Reinforced and Basic Options) per DIN VDE
V 0884-11
– 5700-VRMS isolation for 1 minute per UL 1577
– IEC 62368-1, IEC 60601-1 and IEC 61010-1
certifications
– CQC, TUV and CSA certifications
– All certifications planned


https://www.ti.com/store/ti/en/p/product/?p=XISOUSB211DPR


 
The following users thanked this post: Ed.Kloonk, edavid, voltsandjolts, Kalvin, Miyuki, TimCambridge, spostma, Nominal Animal

Offline niconiconi

  • Frequent Contributor
  • **
  • Posts: 350
  • Country: cn
This year I've considered, tested (and am still testing) a few ASIC solutions for 480 Mbps USB galvanic isolation, and I plan to write a detailed article about it, but here's a quick summary. TI's new ISOUSB211 ASIC is going to be the real game-changer, solves the problem completely, and it will also make my entire year's experiments, described below, almost meaningless. If you just want a working 480 Mbps USB 2 solution, don't read this post, just wait for TI's ISOUSB211.

- There are ASICs specifically made for this purpose, for example the Silanna USBB. But they are not available on the open market, so they practically don't exist. On the other hand, I found there are some useful USB ASICs you can actually buy, they're designed for cable length extension. But these chips can be abused for galvanic isolation, with an important caveat: device compatibility and performance is not guaranteed (more on that later).

* WCH CH317 (both CH317Q & CH317L): USB 2.0 extension ASIC via Ethernet. Made by the same company, WCH, known for its CH341 USB serial chips. The CH317 ASIC has a custom USB controller, the USB traffic is converted to Ethernet (but not TCP/IP) traffic in its proprietary protocol and sent to the on-chip Ethernet MAC, then it outputs the data via Gigabit Ethernet's RGMII interface. Just connect a Gigabit Ethernet PHY, and you're good to go. The chip on the far-side converts Ethernet to USB. The Ethernet transformer is for galvanic isolation. If that's not enough, you can also use Ethernet PHY with fiber-optics support for optical galvanic isolation, or - since it's standard Ethernet data in RGMII - even an FPGA for handling it in your own way.

---(USB)---> CH317 ---(RGMII)---> Ethernet PHY ---> Transformer ---> Ethernet cable

Result: Bad performance, no faster than 80-100 Mbps. So while USB 2 HS is technically supported, usefulness is very limited. Basically only usable for flash drives. Don't buy any device based on the CH317.

Why? An educated guess is that USB 2.0 HS is not designed for long-distance communication in mind, but this chip is designed for up-to-kilometer extension, so it possibly uses some underhanded tricks to work around the problem - basically emulating a USB device on the near-side based on the data from the from far side, and vice verse. For example, if the far-side is not ready yet, the near-side may simply fake a NAK to trick the host to wait longer. Obviously such emulation can't be perfect, which limits compatibility, and also with a serious performance penalty.

* Norelsys NS1021: USB 2.0 extension ASIC via CAT-5e/coax/phone line/USB cable. This ASIC has likely a custom USB controller with proprietary protocol, its output is a single-pair of true differential & DC-balanced signal, which then can be sent for transmission over single-pair phone line, CAT-6, or coax. Because it's truly differential, an AC-coupling capacitor or RF transformer can be used for isolation. The variant NS1021E, uses two differential pairs, so a 100 Mbps Ethernet transformer can be used. Full performance is advertised by the company, likely because it's only designed for a 50-meters extension, so it's is much less invasive to the USB logic than CH317.

A potential limitation is that the output uses either full or half-duplex signaling (unsure, not documented), so the signal is bidirectional, not unidirectional, so again, same problem just like USB 2 HS traffic itself - you can't treat it as a standard digital signal output and hook it up to a standard differential transceiver like an FPGA or a SFP+ module, which limits your option. Ethernet or RF transformers cannot be relied upon for isolating serious voltages or high-frequency noises (but at least for the noise, the signal is now truly differential, you can just use common-mode chokes to suppress it).

Result: work in progress.

- USB 3.0 isolation

* VL670/VL671 USB-3 to USB-2 transaction translation ASIC.

There's also a way to solve this problem indirectly, by first creating an isolated pure USB-3 port (USB 3 is a system of its own with its own SSTX/SSRX connections, it's only backward compatible with USB 2 because the USB standard requires all USB 3 port to include the D+/D- connection to a legacy USB 2 controller, so theoretically you can have USB 3 without USB 2 support, which is what we're doing here).

Then, we use the VL670/VL671 USB-3 to USB-2 ASIC to provide USB-2 support. The VL670/VL671 translates the legacy USB 2.0 traffic and transparently upgrades the device to an USB 3.0 SuperSpeed device by emulation. Just like a USB extension controller, this is not a perfect solution, device compatibility is limited due to imperfect emulation. But can be useful.

Why USB 3? Because it's much easier than USB-2.

USB 2 HS (480 Mbps) uses a nonstandard differential signaling scheme that is not truly differential - it also has single-ended signals like Single Ended Zero, essentially making USB 2 HS incompatible with standard differential transceivers, so you must use a USB 2 PHY and work at logic level rather than electrical level. Worse, the signaling has been further bastardized by using half-duplexing, the D+/D- signals are bidirectional, so you actually have to design a USB controller to read the protocol to do bus arbitration. The protocol, due to its synchronous and half-duplex nature, also has timing constricts that can be hard to meet.

On the other hand, USB 3 is much simpler. It uses two pairs of unidirectional, 8b/10b encoded, CML-like differential signals, and operates asynchronously. This type of signal is commonly found in almost all high-speed digital systems. For example, you can literally just run the USB 3 signal into an SFP+ 10 Gigabit Ethernet optical transceiver (an SFP+ 10 Gigabit Ethernet transceiver is protocol-agnostic, it can be used to transmit any differential signal), and bingo, an isolated USB 3 port. Even better, it's fiber-optics, it can easily isolate 10 kV or more, including fast transients. (well, full-spec compliance, with proper support of power management is difficult, but a port that somewhat "works" to a certain degree for many applications is easy to create).

Result: Successful. Almost done by now. VL670/VL671 was a success. Compatibility is good enough for my purposes. the USB 3 to SFP+ transceiver is work in progress, but an early prototype was almost a success. Implementing full-spec compliance, with proper support of power management was originally my long-term goal.

Also attached are two considered but discarded solution.

- The first solution is using a USB 2 PHY, the analog side is D+/D-, and the logic side is the ULPI or UTMI, which is basically a parallel digital data bus, and hook it up to a FPGA. Then use the FPGA to forward its logical status to another FPGA and its USB 2 PHY. Communicate and synchronize the status of both FPGAs with high-speed SERDES, isolate the parallel SERDES interface with high-speed digital isolators. But this is also difficult and it's only an option if you're an USB expert (I'm not), it means you're basically designing a custom USB controller. Also, theoretically, the second FPGA and the SERDES are not necessary, perhaps you can use a single FPGA, two USB PHYs, and put isolation on the ULPI/UTMI interface instead. But this data bus has more serious timing constraints and I'm not sure how practical it is.

Result: idea considered but discarded, difficult and expensive, but can be an option for USB experts. Some industrial products use this solution.

- The second possible solution is Inter-Chip USB or HSIC. It's basically USB but uses LVCMOS logic without analog PHY, avoiding the analog transceiver headache entirely. There are also USB-to-HSIC hub chips to convert USB to HSIC and vice verse. It looked promising and seemed to make things much easier at first glance, I felt like one can just put relatively dumb logic at the HSIC interface without caring too much about the protocol at all. But HSIC is still uses bidirectional, half-duplex signaling, so you still need to create a USB controller to read the protocol, do bus arbitration, with the USB and HSIC-bus latency constraints.

Result: idea considered but discarded.
« Last Edit: November 28, 2021, 07:32:42 am by niconiconi »
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9005
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
* WCH CH317 (both CH317Q & CH317L): USB 2.0 extension ASIC via Ethernet. Made by the same company, WCH, known for its CH341 USB serial chips. The CH317 ASIC has a custom USB controller, the USB traffic is converted to Ethernet (but not TCP/IP) traffic in its proprietary protocol and sent to the on-chip Ethernet MAC, then it outputs the data via Gigabit Ethernet's RGMII interface. Just connect a Gigabit Ethernet PHY, and you're good to go. The chip on the far-side converts Ethernet to USB. The Ethernet transformer is for galvanic isolation. If that's not enough, you can also use Ethernet PHY with fiber-optics support for optical galvanic isolation, or - since it's standard Ethernet data in RGMII - even an FPGA for handling it in your own way.

---(USB)---> CH317 ---(RGMII)---> Ethernet PHY ---> Transformer ---> Ethernet cable

Result: Bad performance, no faster than 80-100 Mbps. So while USB 2 HS is technically supported, usefulness is very limited. Basically only usable for flash drives. Don't buy any device based on the CH317.

Why? An educated guess is that USB 2.0 HS is not designed for long-distance communication in mind, but this chip is designed for up-to-kilometer extension, so it possibly uses some underhanded tricks to work around the problem - basically emulating a USB device on the near-side based on the data from the from far side, and vice verse. For example, if the far-side is not ready yet, the near-side may simply fake a NAK to trick the host to wait longer. Obviously such emulation can't be perfect, which limits compatibility, and also with a serious performance penalty.
How does USB/IP using Raspberry Pi compare? Or perhaps the CH317 could perform better with the host side implemented as software communicating via a NIC?

The CH317 could also be interesting to add a USB device port to a PC via a NIC.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Online Miyuki

  • Frequent Contributor
  • **
  • Posts: 903
  • Country: cz
    • Me on youtube
How does USB/IP using Raspberry Pi compare? Or perhaps the CH317 could perform better with the host side implemented as software communicating via a NIC?

The CH317 could also be interesting to add a USB device port to a PC via a NIC.
I expect it to have rather poor performance as you have a slow interrupt response with any user oriented OS. I'm not sure if R Pi or common x64 (it might brute force it at cost of high load) CPU has a fast enough interrupt handler for reaching reasonable speeds even on bare metal levels.
« Last Edit: November 28, 2021, 01:06:37 pm by Miyuki »
 

Online Terry Bites

  • Super Contributor
  • ***
  • Posts: 2388
  • Country: gb
  • Recovering Electrical Engineer
 

Online Gyro

  • Super Contributor
  • ***
  • Posts: 9470
  • Country: gb
Save yourself the headache: ADUM3160 from AD

https://www.ebay.co.uk/itm/274596660101?hash=item3fef3c8385:g:gFcAAOSw2Ppfxha-

The ADUM3160 has already been discussed further up the page. The discussions today relater to USB High Speed (480Mbps) isolation -  The ADUM3160 only supports Full Speed (12Mbps).


Edit: The USB hub function on the linked one might be handy in certain situations though, I hadn't seen one of those.
« Last Edit: November 27, 2021, 07:18:33 pm by Gyro »
Best Regards, Chris
 
The following users thanked this post: niconiconi

Offline niconiconi

  • Frequent Contributor
  • **
  • Posts: 350
  • Country: cn
I've just received the XISOUSB211 chip ("X" stands for pre-production preview) I ordered from TI today. I'm still working on the development board design. I'll publish the full design and PCB layout when it's finished.
 

Offline engineer_in_shorts

  • Regular Contributor
  • *
  • Posts: 122
  • Country: gb
Olimex do a USB isolator capable of 12MBit. Stocked in farnell as well. Part number is USB-ISO
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf