3

I just started with electrics a few months ago, but now I am obsessed but still have MUCH to learn. What I am doing is essentially trial and error.

I needed a longer USB cable to a printer so I took a USB cable I had, cut it close to each end of it and then took the thickest 4 cables I could find and connected them to the USB connectors/ends. My idea was simply the thicker the better, the lower resistance the better. But it didn't work! The computer did not recognize the printer.

I read some more on USB and then I saw something about a need for 90 ohm impedance (imped... what?). Read some more and learned that impedance is sort of like AC resistance. After that I connected a 10 ohm resistor to D+ and a 20 ohm resistor to D- (not 90 ohm I know but that's all I had). Then I tested the cable again and it miraculously worked! I was quite confused that lower resistance is not always better in a cable.

design

My question is if my thinking is correct when I think that when measuring a DIY USB cable with a multimeter the resistance (sort of impedance) should be as close to 90 ohms as possible?

Some additional info added after asking

  • Cable length is about 2.5 meters (which is less than maximal 5 meters).
  • I measured with a multimeter before and after the adding of the resistors and + connected to +, - to -, D+ to D+, D- to D-, so I think the "wiring" is/was correct. It is not entirely unlikely that the connection was loose though and something fell out, but not that I noticed.
  • My extended cable works almost all the time except that sometimes when starting the printer then a USB network card connected to the same computer (as the printer) stops working/is disconnected, so I have to remove then reinsert the USB network card and it works again (so no permanent damage ;) ). And sometimes (after a long time of inactivity) it my computer looses connection to the printer (at least it doesn't print on command) and that is fixed by switching off the printer then switching it on again.
fredrik.hjarner
  • 420
  • 6
  • 12
  • No. It is superficial. Search for impedance matching. Cables wil have zero or some mOhms resistance – User323693 Jul 09 '15 at 13:23
  • What this question really needs is an answer about cable characteristic impedance and transmission-line effects ... – brhans Jul 09 '15 at 13:23
  • @Umar: I dont understand. Me adding the resistors and then it suddenly is not because of the reasons I think (that is that impedance gets closer to 90 ohms)? – fredrik.hjarner Jul 09 '15 at 13:27
  • @brhans SE answers are not intended to be books. – Matt Young Jul 09 '15 at 13:27
  • @brhans: That sound complicated (for me). I have read a little bit on that but what I have found is currently above my level. – fredrik.hjarner Jul 09 '15 at 13:28
  • While definitely not in accordance with the spec, series resistors can help absorb reflections resulting from an impedance mismatch, so it is not entirely inconceivable they may have turned a non-working setup into a barely working one. However, it is also possible that you had a wiring mistake which *incidentally* got corrected at the same time you added the resistors. USB is not a long-haul standard - if you want to push the unrepeated limits, buy a long cable or assemble one from cable intended for that purpose, and try to avoid any splices or connections that are not close to an end. – Chris Stratton Jul 09 '15 at 13:44
  • @ChrisStratton: Thanks! "which incidentally got corrected at the same time you added the resistors" that is not entirely unthinkable. "cable intended for that purpose, and try to avoid any splices" I see. I guess if I want to get further I need to understand and measure things like signal reflections and learn about cable characteristics which probably requires some more time and perhaps also equipment. Or simple settle with this "barely working one". – fredrik.hjarner Jul 09 '15 at 13:58
  • You might even have been able to get it working simply by twisting the data lines together (one turn every few inches). And possibly by using thinner wire for the data lines, if you've used really thick wires. You can have splices, but not "stubs" (such as the naive way of twisting the two bare ends to be joined together). Joins have to be a straight line. I've successfully run USB over non-USB cables before but only short distances. – pjc50 Jul 09 '15 at 14:58
  • @pjc50: Thanks! But I don't understand why and if that would work. After reading https://en.wikipedia.org/wiki/Twisted_pair I see that twisted pair is used to minimize sensitivity to EMI (and also to reduce created/emitted EMI from the pair) so I guess that would make my cable better ONLY if I have a problem because of EMI (which I may or may not have). Why a thinner cable could solve my problem, I do not know (because of increased resistance of a thinner cable and thus increased impedance??) – fredrik.hjarner Jul 09 '15 at 15:31
  • Thinner stranded cable is better for "skin effect", although I'm not sure that's the important thing here. – pjc50 Jul 09 '15 at 16:01

3 Answers3

5

USB cables are not simply "4 wires". They have certain properties that need to be met so that the data signals can travel through the cable. Your thick wires will not have the correct properties causing the data signals not to travel properly, instead they are suppressed and reflected resulting in the USB connection to fail.

Bimpelrekkie
  • 80,139
  • 2
  • 93
  • 183
  • Thank you. This is/was probably my fundamental misunderstanding. The most of the cabling I've done is with jumper wires on an Arduino and then I have not needed to think about different cable characteristics, and also I have not ever read anyone talk about characteristics of jumper cables in (simple) Arduino projects. I mean if using a breadboard then there will sort of be splices all over the place. I assume that cable characteristics is sometimes almost entirely irrelevant, but sometimes it is very relevant (for example USB cables...) depending upon what the cable is being used for. – fredrik.hjarner Jul 09 '15 at 14:13
  • Exactly, USB works at signal frequencies where cable properties start to matter. The signals from/to an Arduino are significantly lower in frequency and distances are smaller so there cable properties matter much less. – Bimpelrekkie Jul 09 '15 at 14:33
3

You may find this previous question helpful - Custom USB Impedance question.

Essentially, your problem is that impedance is not resistance (in the most general sense). Rather, resistance is impedance at DC and slightly higher frequencies. Since USB2 sends data at 480 Mbit/sec (peak) you need to consider questions of inductance and capacitance at GHz frequencies. Not only that, these issues have to apply over the entire cable length, so they become questions of geometry and spacing, rather than just adding a couple of components.

WhatRoughBeast
  • 59,978
  • 2
  • 37
  • 97
1

For your USB cable, you need a differential impedance of 90 ohms between the lines and a 45 ohms on single-end wire impedance.

I think it is a hard project for a beginner, a more simple project could be to implement USB track on a PCB, but still that is pretty hard and not trivial.

For PCB, you can use the Saturn PCB toolkit that let you calculate differential impedance.

MathieuL
  • 1,126
  • 1
  • 9
  • 22
  • Thanks. Mhm. So the 90 ohms thingie is BETWEEN cables (i other words: the cables SHOULD affect each other and not be totally isolated from each other). So if impedance is measured on a correct USB cable the impedance on a single cable (in isolation) (btw just D+, D- or also the power lines?) should ideally be 45 ohms? And, just guessing here, the BETWEEN the cables should be as in a coaxial cable, that is I can't just add 90 ohm resistor between the cables. But... I could try for fun with a 90 ohm resistor connecting D+ and D- the cable and see what happens and if it would work better. – fredrik.hjarner Jul 11 '15 at 14:29
  • Differential impedance is determine by the cable geometry, width, distance between the cable, the conductor choice, the dielectric between the 2 cable. It is cause by high frequency, and it takes a lot more than just basic electronics knownledge. – MathieuL Jul 11 '15 at 14:32
  • It is a complex problem that require simulation with software like FEMM or Matlab. Plus, you need good knownledge about high frequency design. – MathieuL Jul 11 '15 at 14:33
  • Aha "differential impedance". I see. At least now I have a better understanding of how NOT to do it and why it doesn't work perfectly. – fredrik.hjarner Jul 11 '15 at 14:38
  • Impedance isn't resistance, impedance refer to V-I relation in a dynamic system ( frequency). Resistance is the V-I relation in a static system ( DC ) . – MathieuL Jul 11 '15 at 14:39
  • Yes, I see. But if one only has a resistor then impedance is the same as resistance (but with capacitance and inductance it's different and (for me) more complex/complicated) as far as I understand. (And then there is this signal reflection problem in AC as well, or something like that). – fredrik.hjarner Jul 11 '15 at 14:47
  • Yes, in that particular case, but impedance is mainly made to describe dynamic system in linear equation. Look at the V-I relation of a cap or a inductance, it is a dynamic system. So impedance are mathematical tool to represent dynamic system into linear system. – MathieuL Jul 11 '15 at 15:02
  • Signal reflection happen at high frequency. It is more connected to wave transmission and electromagnetism than electronics. – MathieuL Jul 11 '15 at 15:03