I have some projects with Arduino and a separate battery power source and I'm tired of plugging and un-plugging my usb cable when to program the arduino using my laptop USB. Sometimes it even broke the tiny micro usb connector in the arduino.
So I want to put a on-off switch on the USB cable. When I'm about to program the arduino I disconnect the battery and turn on the cable, and when I want to test the programmed arduino and circuit, I turn off the cable, and just connect the battery. The USB cable would always be connected in both arduino and laptop.
So I want to do this. Put a led in parallel with the 5v and GND to tell me when the cable is "On" or "Off", so I don't mess with plugging the battery with the cable "ON"
Which would be the best setup? How do the data lines behave, if they are always connected between the laptop and arduino (when powered by a 7.4v battery)? Will the data lines be turned off also, if USB supply line is cut?
Is it best, or safer, to cut the power by the putting the switch in the 5V line (A) or in the GND line (B)?
Could and Arduino (or any clone that has an USB programming/power port), if connected to a battery (but still connected to this USB cable in an OFF switch position) be able to light the led, by "supplying" current to the cable? Even if the connection with the computer is cut?