SG90 servo plugged into Arduino isn't working.

So I am pretty new to Arduinos, and I’m still learning the code, but I have the gist of everything, and I wanted to learn how to use a servo motor, in hopes of modifying the code to my own projects. I plug in the 5v+ into the correct port, the ground into the correct port, and pin 8 into the signal port on the servo. I have uploaded the code from many tutorial online, but not a single one seems to work. I get zero movement, not even a little budge.

I am using the SG90 Micro Servo, and I see no reason for it to have broken. It has not been touched at all, the motor has hardly been turned, and it’s been sitting in one of my drawers for about a month without being touched. I’m using this tutorial, primarily. I upload the following code taken from the tutorial:

#include <Servo.h>

Servo servo;
int angle = 10;

void setup() {
  servo.attach(8);
  servo.write(angle);
}


void loop() 
{ 
 // scan from 0 to 180 degrees
  for(angle = 10; angle < 180; angle++)  
  {                                  
    servo.write(angle);               
    delay(15);                   
  } 
  // now scan back from 180 to 0 degrees
  for(angle = 180; angle > 10; angle--)    
  {                                
    servo.write(angle);           
    delay(15);       
  } 
}

In the end, I still get no movement, and no errors returned to the IDE. I get the same result whenever I upload code from any other tutorial I find online.

Should I buy a new servo to see if it’s just broken or is it a problem on my end? Thanks.

Most servos draws more current than the Arduino safely can provide.
That said, there are many tutorials that power an SG-90 (~650mA stall) directly from Arduino's 5volt pin.

Try if the servo isn't hard stuck.
You should be able to move the horn ~180 degrees with a bit of gentle force.
Leo..

The 5V output of an Arduino cannot be used to power motors or servos, despite the terrible tutorials.

Use a 4xAA battery pack instead, and make sure to connect the grounds.

Wawa:
Most servos draws more current than the Arduino safely can provide.
That said, there are many tutorials that power an SG-90 (~650mA stall) directly from Arduino's 5volt pin.

Try if the servo isn't hard stuck.
You should be able to move the horn ~180 degrees with a bit of gentle force.
Leo..

I just tried to rotate it, and it was tough to move, but I'm not sure how much torque these things have or I'm just weak. I was able to rotate it about 360 degrees.

My SG-90 servos only rotate 180 degree, and are fairly easy to turn.
I suspect your servo has mechanical problems, like stripped gears.
Leo..

Hopefully you have another servo to try. That one is toast.

jremington:
The 5V output of an Arduino cannot be used to power motors or servos, despite the terrible tutorials.

This Arduino site has that bad tutorial, so I would say you could claim a new Arduino if you destroy it.
Leo..

Alright, thanks guys for the help. I'll grab a fresh servo from my radioshack and give it a try. Also, if I'm going to plug it in with a 4x AA battery pack, do I plug the battery pack directly to the servo 5v+ and gnd, and my Arduino into the signal port?

Yes, and also connect servo ground to Arduino ground.
Leo..

Wawa:
Yes, and also connect servo ground to Arduino ground.
Leo…

Thusly, ala zoomkat:

servo-wire.jpg