For awhile now, I've been doing small arduino projects to learn the coding structure associated with it. Recently, I ordered some small, 5 volt servos to experiment with motor control. Using the provided "sweep" and "knob" examples provided, my main goal was to simply establish control of the servo. Regardless of how the code was structured, however, the servo always turned as far as it could clockwise. A lot of troubleshooting went on, and I found that the code would work if the servo was powered by the arduino, that is, the power, ground, and communication wires were all wired into the board. I found that the servo misbehaved because I was using an external 5 volt power supply attached to the power and ground wires, with the communication wire attached to my arduino.
This leads me to my question: why does my servo only work if all three leads are plugged into the arduino? Why can't I use an external power supply if my communication wire is attached to the arduino? Ultimately, I'd like to operate a few servos simultaneously, and I'm concerned that it may result in damage to my arduino.
Any input is appreciated. Thank you all.