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?
Thanks!