As a fun geek project I'm working on extending my old early 2000's USB webcam's length by about 30 feet by splicing it into CAT5 and then re-splicing it back into a USB connection. I'm actually mounting it into the peephole on the door of my apartment. However, I can't get the USB cam to detect in Windows when extended with my setup. Device works fine and is detected when not extended.
When it comes to electricity I only know the basics. That is why I don't know where my error is and I'm begging here for help or ideas.
I understand that USB simply cannot be lengthened by using a long cable. You'll have voltage drop and the device at the end will then fail. You can use repeaters and actual devices electronic devices to extend it though. But that costs money and no longer makes it a fun project to learn from. There are also devices to convert USB to actual ethernet and back to USB, but i'm not using ethernet, I'm just using a cat5 cable for it's wires and am not attempting to use any ethernet protocols or anything, just extending a serial cable.
From reading on the internet, sometimes you can get lucky and extend it with Cat5 depending on the circumstances:
http://www.instruc...out-USB-using-UTP/ Also, someone looks like they began on here:
http://forum.allab...thread.php?t=35780 but the discussion sidetracked.
My setup is this:
Device minus it's USB cable (using it's USB pins on circuit board) <---> 10' cat5 patch cable <---> 20' cat5e cable <--> USB cable with male end <---> Computer.
I'm just trying to keep USB as USB and extend it by sneaking some cat5 in the middle of the span. Sorry if this is tedious to read, but I decided it'd be best to include all details.
THE CAMERA:-The camera's USB cable connects to the camera's board via a plug and socket. The wires in that USB cable appear to use official USB wire colors which is a clue to what the pins on the camera's board do by seeing what colored wire goes to what pin.
-It has 6 pins (and wires). 5 of which are in a socket on the board which the USB cable plugs in to and a 6th pin/wire which is a ground directly to the board out side of the socket.
-Here is a breakdown of the pins:
Note: Pin numbers are pins on the device, not official USB pin numbers.
Pin 1 - Red - Vcc +5v (confirmed with multimeter while connected to computer)
Pin 2 - Black - Assuming Gnd
Pin 3 - Green - Assuming Data-
Pin 4 - Black - Assuming GND (Another one?!)
Pin 5 - White - Assuming Data+
Pin 6 - Fat Black - GND (The above 5 pins goto a socket on the board of the camera. I think it connected to the shielding of the USB cable which connects to this board)
CONNECTION TO CAT5:Since this cable is intended not to be multi-purpose and only for this camera I decided to solder my cat5 directly to the bottom of the board instead of using the camera's existing USB cable and going from there. Then I can solder wires onto little points on the back of the board which correspond to the pins sticking out from the front side of the board and I won't mess the pins soldering in case I want to revert. I also needed to do it this way so the unit will fit in my doors peephole.
At first I used these instructions from Instructables site to convert from USB on the board to wires in the Cat5:
USB Color to CAT5 Color
red --> white/orange & orange,
white --> white/green,
green --> green,
black --> all the rest
However since I had 6 pins on my camera board (not 4) like in the Instructables converion I had to do something else. I assumed all 3 of the black wires were grounds. So my conversion from device to cat5 looked like this to use all of the ground wires:
USB Color to CAT5 Color
Pin 1 Vcc (red) --> white/orange & orange(twisted),
Pin 2 GND (black) --> white/brown
Pin 3 D- (green) --> green
Pin 4 GND (black) --> brown
Pin 5 D+ (white --> white/green
PIN 6 (big black) --> blue & white/blue
I decided to use all of what I think are grounds and bundle them into one wire/connection down to the end of this cable. Possibly this is what is leading my to failure.
CAT5 BACK TO USB:At the other end of the Cat5 I then converted back into a male USB cable so that for example on the male usb pin 1 is red and carries 5v from the computer to the device. I'm not going to list the exact conversion here, but basically the Vcc, D- and D+ run through the entire setup from device to male USB plug in the correct pinouts at the at male usb plug. I've triple checked that I haven't reversed my pin orders or anything. As for the grounds, they're all consolidated into one wire/connection to the correct pin for GND on the male USB plug.
RESULTS:All throughout the process I was checking my work for stupid mistakes using a multi-meter. That means none of my soldering was messed up and I was able to trace a connection from the device to the end of my extended cable on each pin.
BUT when plugging in the device I am getting USB Device Not Recognized popup in Windows. Without my extension the device connects and detects perfectly.
So my first check was voltage to the device to see if that evil voltage drop got me. When plugged in and measured on the board of the device it metered to 5.13 volts. Isn't that
exactly what USB outputs by default? I think I should be good there.
So my next check was resistance (which I have a very basic understanding of) on the data+ and data- wires which weren't doubled up. I am not sure of the correct units, but on my meter I was getting these ohm values:
Touching 2 contacts of the meter together as a test: 0.2
Length of original USB cable on device: 0.4 to 0.5
Full extended length (D+ / D- pins): 1.8ish
I was concerned about the increased resistance introduced with my added cable. Possibly that is what was breaking my connection? I then learned (well re-learned) that if your increase the cross section of the wire it reduces resistance. I decided to take my blue wires (blue and white/blue) and instead of using them for the big ground on the board I would instead use them to double up my D- and D+ pins down the length of the cable assuming that the remaining brown wires (brown & white/brown) can still cover the two small grounds.
The result for doubled up D-/D+'s was down to 1.1 resistance. Getting closer to the same as the original USB cable (0.4 resistance). Does it work?! No, of course not.
In retrospect though, I might have found an error. I'm not sure. The two sets of wires each carrying the D+ and D- signals aren't twisted pairs. They're mixed sets of the blue and brown pairs. I understand that twisted pairs act as shielding possibly even lessening resistance? Perhaps if I use proper twisted pairs instead of mixing and matching wires on the D-/D+ it might work?
Things on my 'things to still try' list:-Use twisted pairs on D- and D+.
-Shorten the length of my cable. I'm at about 35 feet. I'm going to try to trim off 5-10 feet if possible if I can still reach between my door and computer.
Things I'm not sure about:-Is my wiring from the device to cat5 correct? I'm confused by the multiple (and two types) of Ground instead of just one ground pin and how I should properly handle multiple grounds them.
-Am I missing another concerns besides voltage, resistance, and length?
-My cat5 is actually a blend of two cables soldered together. One white so it matches my wall around my door-frame which leads to a ugly green one for the rest of the length to hide behind furniture. The white cable is a patch cable and each individual wire in it is made of multiple small 'threads' of copper. However, the green cable is from a spool and meant for serious wiring and each of its individual wires are solid copper. Even though they're both cat5, would it cause any problems? Of course everything is soldered nicely (err I mean effectively) and verified with a multimeter.
-Other things?
The main thing that is confusing me is that where ever I read about extending USB the voltage drop is the main issue people bring up. However for me (by luck) my voltage is perfect. What am I fucking up here?
Thanks for any ideas, or even just replying!
-t
Edit:
Ultimately what I'm trying to make is these:
Edit2: I've confirmed that the multiple grounds on the device all interconnect. So I hope to assume that a ground is a ground. I feel better about bundling all 3 black wires from the device into one line for the usb end.