I'll explain what I'm trying to achieve first. I basically want to control a 4 wheeled robot through an Arduino but I need the Arduino to get the commands from a computer. I've already setup the circuitry for controlling the robot motors (H-bridges, encoders, etc) and I just need to send GPIO signals to that circuit. As I need to get the instructions from the laptop, I need to power the Arduino through the USB connection. Now here's where the problem comes in.
If the Arduino gets its source power from the laptop but needs to communicate with an external circuit, what happens to the ground? I'm pretty sure the Arduino will need to have a common ground with the external circuit's power source for this to work. My worry here is what will happen if the battery sends a spike current through the ground connection and fries the Arduino (I've heard this can happen). Is there some way I can protect the Arduino from this or is this some better solution that I'm missing here?