61

I want to use a very long USB cable to place a webcam in a different room. The maximum length that I found was five meters.

  1. What is the maximum length of a USB cable?

  2. What is the maximum length achievable when using USB extension cables?

2

3 Answers 3

62

5 meters is the maximum USB cable. You can get further by connecting USB hubs serially (maximum of 5 hubs chained this way). You can't just use USB extension cables due to timing issues.

From the USB FAQ:

Q1: How long of a cable can I use to connect my device?
A1: In practice, the USB specification limits the length of a cable between full speed devices to 5 meters (a little under 16 feet 5 inches). For a low speed device the limit is 3 meters (9 feet 10 inches).

Q2: Why can't I use a cable longer than 3 or 5m?
A2: USB's electrical design doesn't allow it. When USB was designed, a decision was made to handle the propagation of electromagnetic fields on USB data lines in a way that limited the maximum length of a USB cable to something in the range of 4m. This method has a number of advantages and, since USB is intended for a desktop environment, the range limitations were deemed acceptable. If you're familiar with transmission line theory and want more detail on this topic, take a look at the USB signals section of the developers FAQ.

Q3: How far away from a PC can I put a USB device?
A3: With the maximum of 5 hubs connected with 5m cables and a 5m cable going to your full speed device, this will give you 30m of cable (see section 7.1.19 for details). With a low speed device, you will be able to get a range up to 27m, depending on how long the device's cable is. With a straightforward cable route, you will probably be able to reach out 25m or so from the PC.

Q4: I need to put a USB device X distance from my PC. What do I do?
A4: If X is less than 25m or so (see previous question), buy a bunch of hubs and connect them serially with 5m cables. If you need to go farther than that, put another PC, or maybe a laptop, out where you need the device to be and network it with the first PC using something that's intended to be a long-range connection, such as Ethernet or RS-485. If you need to use nothing but USB, consider using USB based Ethernet adapters to hook the PCs together.

6
  • 11
    Just FYI, it's not really a timing issue, since using hubs doesn't mitigate the signal's propagation time. Rather, the maximum cable length is due to line capacitance/inductance issues, and the signal's voltage loss along the length of the cable. If the cable was too long, the digital logic levels might not be triggered properly at the receiving end. Each hub "resends" the signal so-to-speak, which is why this solution works. Aug 9, 2011 at 16:21
  • 7
    @Breakthrough No, the signal voltage is easy enough to amplify; I think it is about the timing on the single link. The problems from capacitance and inductance are - if you look closely - exactly the timing issue; The signal is spread in time direction. But even the latency can be relevant inside the link protocol; It get's much easier if you can use a full round trip for each byte you transfer - no need to keep track what may need repeating on a glitch. And the latency over five hubs is just the same for the device to computer link ;) Aug 29, 2014 at 7:02
  • Those 5 hubs connected in series, do they need to have an external power supply? or is it enough with the power supplied by the USB connection itself?
    – GetFree
    Oct 25, 2014 at 9:52
  • 1
    @getfree usually you need to power the hubs separately. If you know the hubs power consumption and the end devices power need, you can calculate whether your 500 mA from the source will be enough. Over longer stretches the village drop might be enough to need at least some posted hubs in the sequence.
    – TafT
    Apr 12, 2018 at 5:16
  • What is a "low speed device" and how do i check if my one belongs into those?
    – Youda008
    Apr 27, 2020 at 8:47
38

All answers are incorrect if OP meant the link operating at High-Speed USB2.0 communication speed (480 Mbit/s).

The length of a USB communication link is limited by the USB architecture of having five hubs in the link. The USB protocol requires that USB devices send back handshake packets as ACK, NAK, NRDY, etc. These responses must come back to host within a specified time-out, which is set to 1.7 µs. The host controller hardware would set a flag/interrupt if the response is not received in time after 1-2-3 attempts, which would mean the link failure.

Now, what was the basis for this 1.7 µs limitation? It is based on a worst-case round trip of handshake packets. All is explained in USB 2.0 specifications, Section 7.1.19.2. There are three factors:

  1. Physical signal integrity over a twisted-pair differential for a realistically manufacturable cables (impedance matching, cable uniformity, signal loss). This came out as 5 m cable length limit per segment. A 5 m cable has an estimated one-way propagation delay of 26 ns per USB specifications. All six cables will have the round-trip delay of about 300 ns.

  2. Digital signal propagation delay along the hub's repeater path, which is limited to by suggested architecture to 40 HS bit times, which is about 80 ns per hub one-way. Five hubs will have the round-trip delay of about 800 ns.

  3. A USB device is allowed to respond in 192 bit times, which is 400 ns.

So, total response time is 1500 ns. The specification allows some slack, and extends the time-out to 1700 ns.

Therefore, the limit for media propagation time is 1700 ns - 400 ns = 1300 ns, or 650 ns one way. If you can manufacture a cable that has such a low loss over 650 ns of wave propagation that it can deliver an open signal eye meeting USB far-end template, a host with a single USB device can work with it. Taking 26 ns per 5 m, it comes down to 125 m of cable. This is the maximum theoretical limit.

I'd love to see if this kind of cable can be made. Personally I had a good no-error link with 40 ft (12 m) cable made of Cat 5e. But it depends on quality/sensitivity of receivers on both ends of a link.

ADDITION: The above answer is valid only for overall USB HS communication protocol. However, there is another functional limitation on the maximum cable length in USB: it is related to high-speed disconnect function. The HS disconnect in USB is based on an idea that a disconnected cable would reflect the signal back, so the reflection adds up to the driven voltage leading to doubling of signal amplitude at the transmitter. As designed, the HS host sends micro-frame markers (called SOF) every 125 us. For the purpose of cable disconnect detection the SOF packet has an elongated end-of-packet, ~83 ns long (normal EOP is 16.6ns long).

If the USB cable is disconnected at host port, no problem. But if a device (with its termination) is disconnected at far end of a long cable, the reflection must come back within 83 ns, the amplitude will double up, and a special comparator in the PHY receiver will register the "HS disconnect" condition. This sets the cable limit of having 41.5 ns one-way propagation delay. Assuming 6" propagation speed per 1 ns, this requires the cable to be less than 250" long, or about 6.5m long.

This limitation takes place only if you want to sense a clean and fast disconnect. With longer cable the host port will be eventually disabled due to protocol error, so not much problem at the end.

5
  • 1
    How did you check the error rate on your setup?
    – ZAB
    Dec 15, 2016 at 1:14
  • 1
    @Ali Chen, thanks for this incredibly informative information post! +1
    – Sam
    Dec 17, 2016 at 15:28
  • 1
    @ZAB The experiment was done between two highly polished USB2514B hubs, with all care about traces and connectors and termination self tuning. The CATC USB Protocol Analyzer was between the host and first hub, and the cable was between the 1st hub and the second hub. There were no protocol errors, at all. The eye diagram was on the lower side of specifications, of course. Feb 9, 2018 at 18:42
  • @AliChen Have you ever tried constructing a long USB 3.0 cable using Cat 5/6? Jun 13, 2018 at 16:49
  • @pseudosavant, no, I didn't try, at that time there was no USB3 yet. But the USB3, as a full-duplex bus, doesn't have the restrictions described above, transactions can be deferred and responses in different pipes can go out-of-order, and not limited by short timeout. The working cable length is solely determined by cable quality - uniformity, cross-talk, and high-frequency losses. Jun 13, 2018 at 22:12
16

According to USB specifications, cables longer than 5 meters would cause a too large signal propagation delay to work.

But I've managed to build a 10 m/30 ft passive USB 2.0 extension cable that worked just fine. All I did was to use an FTP Cat 5e AWG24 100 ohm cable with one twisted pair for data (D+ and D-; I used the green pair), and the other three twisted pairs for power (V+ and V-; in parallel solid to solid and stripe to stripe).

I've had no problem using any USB device over this cable. A quick test with a USB storage device measured ~ 292 Mbps, same as when connected without the extension cable.

4
  • Others had success with 10m cables too: forum.cakewalk.com/…
    – inf3rno
    Feb 13, 2018 at 7:23
  • What speed did you manage to get? Did you get USB 3 SuperSpeed 5 Gbps? Aug 12, 2020 at 12:15
  • 1
    @CristianCiupitu At the time I did this for USB 2.0 and it was for a low bandwidth use case, 10-20 Mbps. I just did a test now with the aforementioned cable, and it transferred 1.5GB in 41 sec, so ~ 292 Mbps (480Mbps is ideal, it will never be reached). I have not build a cable for USB 3.1 which requires 2 extra pairs. Also, the higher bandwidth will require better shielding.
    – Chris
    Aug 14, 2020 at 14:49
  • I've put several "off the shelf" 5m and 10m USB extensions in serial and managed to get it to work with a keyboard up to 45m. Though all combinations was not reliable it worked to at least 25m in any configuration.
    – hultqvist
    Aug 22, 2022 at 10:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .