Serial and SPI port isolation - Page 1
Forum section: electronics / projects

author: Bertho
author_rank: Regular Contributor
timestamp: October 08, 2013, 01:22:16 pm
content: Some time ago I destroyed the USB port of my old laptop by means of a ground-loop. I had an FTDI USB/serial converter and a PIC programmer on the target and the laptop. The smell of burned electronics was not funny...That mishap inspired me to design NoLoop, an isolator for serial ports (FTDI breakout and FTDI Friend pin-compatible). NoLoop isolates all I/O pins and the power supply so that no ground-loop can occur. The SPI version only differs in that there are three outputs and one input, whereas the serial version has two inputs and two outputs.The design works by using a silicon RF isolator and passing the I/O signals over the RF bridge (standard chip used Si8441/Si8442). The power is coupled from primary to secondary side with a transformer and stabilized with an LDO on the secondary side.The schematics for both serial and SPI versions are on my homepagehttp://www.vagrearg.org/content/noloopincluding more images.

author: DutchGert
author_rank: Frequent Contributor
timestamp: October 08, 2013, 01:32:57 pm
content: Looks good but did u think about using the Analog Devices ADuM series?(http://www.analog.com/en/interface-isolation/digital-isolators/products/index.html)With those u dont need the transformer + LDO and even get a lot higher mas output current on a smaller overall footprint.

author: Bertho
author_rank: Regular Contributor
timestamp: October 08, 2013, 01:45:10 pm
content: Quote from: DutchGert on October 08, 2013, 01:32:57 pmI did consider a lot of options. One thing is that you still need to power the secondary side if you use the generic isolator chip versions. The specific versions (rs232) use a capacitive pump, but you cannot load that one on the secondary side. Besides, using the specific ADxx one is a costly affair. Anything with ADxx on it seems to be expensive ;-)Another advantage with the separate transformer is that you actually can load it. There is enough power to pull 150..200mA out on the secondary side (with secondary side added capacitor on Vcc, that is). If you update the FTDI chip's USB descriptor to have all power, then you can pull reasonable power through, isolated.

author: nctnico
author_rank: Super Contributor
timestamp: October 08, 2013, 02:59:06 pm
content: Quote from: Bertho on October 08, 2013, 01:22:16 pmThats not a ground loop but caused by an adapter which has half the mains voltage as a ground reference (due to mains filtering). Very annoying indeed. Tying everything to ground from the same outlet helps to solve this issue. Using series resistors (470 Ohm to 1k Ohm) on the data lines are a much cheaper fix for the same problem because they limit the current which flows into the ESD clamping diodes.

author: Bertho
author_rank: Regular Contributor
timestamp: October 08, 2013, 03:07:41 pm
content: Quote from: nctnico on October 08, 2013, 02:59:06 pmEhm, no, that was not the case. The laptop wasn't even connected to mains at the time this happened. What you are referring to is capacitive (and inductive) coupling through mains. Old-timers can remember the jolt you got from connecting printers to computers...The only two connections to the machine were a programmer and a usb/serial converter. The device under test was a split system with one very high current path. Part of that current flowed through the laptop. Not only the laptop had parts burn out, but also two micro-controllers on the target died.

author: Bertho
author_rank: Regular Contributor
timestamp: October 08, 2013, 03:12:28 pm
content: Quote from: nctnico on October 08, 2013, 02:59:06 pmBut the problem isnotin the data connection. Putting a limit in there has no effect whatsoever.The problem is that ground-currents can induce high potentials if they can loop. That can only be solved by breaking that ground connection. Either you go fully balanced without ground (like Ethernet) or you isolate through a optical/RF means which eliminates common-mode differences.

author: Bertho
author_rank: Regular Contributor
timestamp: October 08, 2013, 04:09:52 pm
content: Quote from: mojo-chan on October 08, 2013, 03:22:13 pmThere is an ADUM4160, which does USB isolation for you. There are two problems with it; 1) it is an expensive chip and 2) it can only do low and full speed USB lines.The price may be a secondary issue and may be low enough for one's budget, but doing SPI transfers at 30MBit/s on an FTDI MPSSE ports runs at the full high-speed USB-2.0 speed, so you need to do the isolation afterwards. I have yet to see full 480MBit/s high-speed USB isolator.

author: nctnico
author_rank: Super Contributor
timestamp: October 08, 2013, 05:21:03 pm
content: Quote from: Bertho on October 08, 2013, 03:12:28 pmThat depends. In theory a ground loop is what it is: a big shorted turn. With enough magnetic field you can induce a significant current to cause several milli-Volts acros a thin conductor. Enough to cause 'hum' in audio equipment if the ground hasn't been properly designed. IMHO something else went wrong in your setup. There may have been a dielectric breakdown which caused the current to flow through your equipment. Extra isolation could solve that ofcourse but I'd look for the root cause first. I've worked with big spot welders capable of supplying 50kA. Thats enough to make heavy copper wires move about 1cm due to the magnetic field but I never had problems with connected equipment (laptop, scope, etc) standing right next to it. But maybe you're working on an MRI machine...

author: Bertho
author_rank: Regular Contributor
timestamp: October 08, 2013, 08:11:51 pm
content: Quote from: nctnico on October 08, 2013, 05:21:03 pmI think you are mistaking a ground-loop with inductive coupling here. You describe exactly how induction works, but that is not the issue.A ground-loop is a phenomenon where currents in the ground connection lead to local differences in the ground- and signal-levels. A perfect grounding plan is star- or bus-shaped. However, if you connect ground-points wrongly or arbitrarily, then you run the risk of currents taking a path that it was not designed for.Example: connect devices A <-> B <-> C <-> A.If a current is running between A and B, does the connection BCA carry no current? No, there will be a parasitic current taking the wrong path because the currents distribute according to reciprocal of the effective impedance over the possible connection paths. This is per definition a ground-loop.For purely DC currents, it will be a simple calculation. However, if there are switch-currents on AB, then the wire-inductance will play a role and larges parts of the current may take the BCA route for short periods. Here is gets tricky. A current pulse over the BCA route may cause the local signal information to get lost because only the ground wire exhibits the change of potential. The local lifting/falling of ground may cause serious damage if they become too large. Secondary paths may exhibit transmission line properties which can amplify problems further.QuoteWell, you may have an opinion on that, but my post-mortem analysis clearly shows a different picture. I find it a bit odd that you can actually conclude anything as I have not given enough information for you to do the analysis.

author: branadic
author_rank: Super Contributor
timestamp: October 08, 2013, 08:31:40 pm
content: First of all, nice project.On the second view the transfer capacitance is higher (2pF for the SI844x) compared to simple opto coupler solutions (typ. 0,6pF for a simple PC 817 or low to 0,25pF for better types).

author: Bertho
author_rank: Regular Contributor
timestamp: October 08, 2013, 09:01:19 pm
content: Quote from: branadic on October 08, 2013, 08:31:40 pmThank you.QuoteI did look into opto-couplers but decided very early on that there are too many problems with them. Some of the reasons you can conclude from my comments below, but it is in no way an exhaustive list.The transfer capacitance is higher for the Si844x, but you'd need 4 opto-couplers for the same features. That makes also ~2..3pF. The NoLoop design was not to be of any particular specific use, but for general use. Situations like where you just know "here I must isolate now while testing this stuff". For a permanent (embedded) design, you always look for a more specific solution.The second problem with most opto-couplers is that they are slow. There are, of course, faster ones, but they are also expensive. The PC817 has a cut-off frequency of ~80kHz. The Si844x runs guaranteed at 500kHz or 75MHz (1MBit/s and 150MBit/s depending A or B version). The propagation delay of a PC817 is 3..4us whereas the propagation delay of a Si844x is ~6ns. That is three orders of magnitude difference.Third problem with opto-couplers is the current consumption. You need 3..5mA per channel for effective control (and more if it needs to go fast). The Si844x has mosfet inputs and the current consumption of the entire device is between 3mA (idle) to ~20mA (running at 150MBit/s). The opto-coupler would need buffers for driving and extra support electronics for the output. You'd at least want an opto-coupler with digital outputs, increasing the cost.So, considering the options, it is not strange to find that opto-couplers are more and more pressed into a niche, where the specifics of the opto-coupler are a requirement. Other places with high speed communication are more and more using the RF-based couplers because they are better for the particular job and simply more cost-effective.

author: Alexei.Polkhanov
author_rank: Frequent Contributor
timestamp: October 09, 2013, 12:13:39 am
content: Quote from: Bertho on October 08, 2013, 01:22:16 pmHow exactly did that happen? I would be very curious to see some analysis of that situation with rough schematics. Ground pin of a USB connector which is connected to ground plane on Laptop's PCB should be able to pass significant current, same for desktops - that is why you get people shocked by 30V+ potentials and computers keep working. So it must be a situation when you setup resulted in higher/lower potential on D+/D- or VBUS. When you insert USB connector it touches the outer body of USB jack and at the time when VBUS contacts touch the VBUS pins potential between VBUS and GND on both sides should be within range even if some current is flowing through the ground plane.I rarely see any protection on USB besides TVS diodes, but there are also devices like TPD4S014 which suppose to protect overvoltage on VBUS up to 30V. I have never seen USB ports being damaged on brand name consumer devices and all cases I have seen any damage on USB at all was because wrong pins were connected which is hard to do with standard connectors. The benefit of having isolation is to be able to have WORKING USB in situations with positive grounds etc., but that has little to do with protection. In other words isolation IS NOT protection and reverse is true as well. So you will burn your isolation circuitry instead of USB chip - what is the difference?

author: Bertho
author_rank: Regular Contributor
timestamp: October 09, 2013, 01:16:58 am
content: Quote from: Alexei.Polkhanov on October 09, 2013, 12:13:39 amAttached rough schematic of the setup that fried my laptop's usb.The main current runs from the PSU to the HV-pump. The pump is switching at 24V with 0-6A with about 200Hz. The load is on a capacitor that is pumped by the switch. The switching is controlled by the Control board and has some feedback. The thick line indicates the ground of the system.What happens is that the control-board loops the ground with the pump-board. Since it is switching quite a bit of power, it will divide the ground current between the pump-board and the control-board from the PSU. The effect is that the control-board is lifted from the absolute ground in a way that is quite significant.The computer also has two ground connections via the two USB lines. These ground-lines will now take part in the loop because the control board's ground and the pump-board are not on the same ground anymore. If this was a steady-state current, then the computer would probably cope with this. The DC-lift is generally not high enough to have the datalines vs. ground come over a critical boundary. However, we are switching high currents and that gives rise to transmission line effects (the pulses do no take equal time depending path). It should also be noted that the connections were made with test-wires and clips and not with proper wiring (a real mess'o'wire) and the DC-resistance of the primary high-current path to the pump was too high (about equal to that towards the controller). Also, the power wiring exhibited too much inductance (just a wire-mess). The effect was that parts of the switch pulses were amplified and could generate potentials lethal for the USB port.The pulses I could later confirm (after the computer already had taken damage) with some test-measurements and the local ground-vs-dataline peaked at +/-100V. If either serial or programmer connection has been isolated, then I still had damaged the control board, but the computer would have been fine.Lesson learned, don't make ground-loops. And especially not if you are doing quick-and-dirty testing[edit: fixed typos]

author: Alexei.Polkhanov
author_rank: Frequent Contributor
timestamp: October 09, 2013, 03:11:20 am
content: Assuming that computer was not damaged by too much current flowing through ground link formed by two USB ports - I think programmer and Serial would not have been able to survive that when computer did not. I see how it can happen if one of ground connections of computer to serial or computer to programmer were broken and as result +5V on serial relative to its ground turned into something like -10V relative to computer's ground. Tying grounds together like I show on second pic send picture would have protected computer. Sounds like something was not grounded properly.

author: Bertho
author_rank: Regular Contributor
timestamp: October 09, 2013, 11:36:42 am
content: Quote from: Alexei.Polkhanov on October 09, 2013, 03:11:20 amThey didn't.