External power supply problem

Hi, I have an arduino uno r3 running a servo based on the inputs from a sharp ir range sensor. Things work fine when the Arduino is powered through USB port. The servo and sensor is running off the Vin on the board. The sketch works fine this way. But when I disconnect the USB and power the Arduino by providing regulated 5 V power to Vin(the servo and sensor runs from the regulated power now), the servo has a mind of its own. So, help me with the external power supply problem. You can get a better picture at: http://www.youtube.com/watch?v=Fnipmf4_WL0&feature=youtu.be

The servo HAS TO BE ON ITS OWN POWER! not through the Vin, make it run on a 9 volt battery pack. You can run the ARD from the battery pack too if it has a high enough current output. The sensor may only be able to have 5 volt only, so that has be powered by the 5 volt pins on the ARD.

The servo works fine when powered off the Vin when Arduino is on USB power. But when extn. 9V is connected it goes its own way. Other sketches which involved the sensor and LEDs work fine with extn. supply

This is i think because of the voltage drop on the voltage stabilizer on the arduino board. You should power it more than 8V

Are the grounds connected? This is a very common error / oversight.