Servo motor behaviour

Hi i just bought a servo. The problem i m facing is that when i move it from 180 degree to 90 degree it move to 95 or 100 degree first then to 90. Means like it have not breaks . Kindly suggest me something to stop it direct 90 degree.

Another problem is when it goes to 0 degree . It starts vibrating there. It have very weird behaviour at 0 degree.

It starts vibrating there. It have very weird behaviour at 0 degree.

The servo is probably straining against the internal hard stop which might damage the servo gears. Servos almost always need to be externally powered as powering from the arduino may cause issues. Below is some very simple servo test code you can use to find the mechanical rotation limits of your servo.

//zoomkat 7-30-10 serial servo test
//type servo position 0 to 180 in serial monitor
// Powering a servo from the arduino usually *DOES NOT WORK*.

String readString;
#include <Servo.h> 
Servo myservo;  // create servo object to control a servo 

void setup() {
  Serial.begin(9600);
  myservo.attach(9);
  Serial.println("servo-test"); // so I can keep track of what is loaded
}

void loop() {

  while (Serial.available()) {
    char c = Serial.read();  //gets one byte from serial buffer
    readString += c; //makes the String readString
    delay(2);  //slow looping to allow buffer to fill with next character
  }

  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured String 
    int n = readString.toInt();  //convert readString into a number
    myservo.write(n);
    readString="";
  } 
}

i m giving it external power already but it is still vibrating at 0 degree like it try to move below the 0 degree.

adeel_52:
i m giving it external power already but it is still vibrating at 0 degree like it try to move below the 0 degree.

Then don't send it to 0 deg unless you want to break the servo.

and what to do for moving the servo at 90 degree it did not stop it slightly gos above 90 and then came back to 90.

If the servo is powered from the arduino, then get an external power supply.