USB D-/D+

I understand the green wire in a USB wire is data- and the white is data+the problem is I don't understand what that means. Is data+ the serial signal in both directions and data- is the grounding for that connection? Is so, why isn't all the grounding done by black? Or: Is the data plus from a bigger device to a smaller one and data- a smaller one to bigger one? I.e: smaller one = Arduino board, bigger one = CPU. If so how do you know which one is the larger device and which one is the smaller one? I.e: a computer plugged into a tablet.

Data+ and Data- are differential signals, so to check the signal you just "measure" the difference between these two wires and you're not interested in the levels these wires have in relation to GND and Vcc. This way the signal is almost immune against interference and other electrical noise that might occur to the cable.

The same principle is used in other serial standards (RS-422, RS-485), although the wires may be called differently there.

pylon:
Data+ and Data- are differential signals,

What I am reading is when Data+ is high, Data- is low and when Data+ is low. Data- is high.

I would have thought there should have been a clock with both incoming and out going data in the same strand. i assume the clock is part of the data discussed,.

The clock is built into the data itself: "USB uses a differential transmission pair for data. This is encoded using NRZI and is bit stuffed to ensure adequate transitions in the data stream. On low and full speed devices, a differential ‘1’ is transmitted by pulling D+ over 2.8V with a 15K ohm resistor pulled to ground and D- under 0.3V with a 1.5K ohm resistor pulled to 3.6V. A differential ‘0’ on the other hand is a D- greater than 2.8V and a D+ less than 0.3V with the same appropriate pull down/up resistors." NRZI description: http://www.ece.ualberta.ca/~elliott/ee552/studentAppNotes/2001f/interfacing/usb/appl_note.html

See page 7,8,9 here as well for pictures of signals and what is represented http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=7&cad=rja&uact=8&ved=0ahUKEwj2vNHU8qHSAhWJ6yYKHS-JCJ8QFghDMAY&url=http%3A%2F%2Fwww.cypress.com%2Ffile%2F134171%2Fdownload&usg=AFQjCNES4gjSYHO9kAs8bVkB-qmXdGXdcA

I started this thread because I wanted to have some information to build a USB switch to attach two Arduinos to my PC and flip a switch to change which one I am communicating with. I think the simplest way to do this would be a 3 pole double throw switch. The three poles would be: Data+, Data-, and ~5V (to prevent the second board from taking too much power from the selected one). Ground would be connected bypassing the switch.

I bought a commercial version of such a mechanical switch and one of my notebook USB ports is dead since I used it. I guess that's the reason why the pins of a standard USB connector have different lengths. There must be a time difference between connecting the power pins and the data pins.