loading
The Servo motor is a amazing device that can turn to any specified position within 180 degrees of motion.

The big difference between this and other motors is the fact that it has a built in gear box and the controller inside so its comes as a ready package which is far more accurate. Another big difference is the fact that most servo motors can only turn within 180 degrees of motion instead of the 360 that most dc motors turn.

Servos are commonly found in rc toys, like cars (to control steering) or rc planes (to control rudder movements)

Step 1: The Different Types of Servos

Servos come in many shapes and sizes, so which one is best for you and your project, well that depends on what it's needed for. Most projects will probably do just fine with the Tower Pro micro servo (the blue one) the great thing about this servo is that it is very accurate, very light and very inexpensive however they can not move a lot of weight making them good for small moving parts like sensors. The next servo is much stronger it's called the tower pro mg995 and it's great for moving heavier objects like robot body parts (arms or legs). The last one I will talk about is the 360 degrees servo which if you haven't guess yet can turn a whole 360 degrees these normally have quite high torque mainly because they are used as driver wheels on robots.

These are the most common 3 I have used but don't be fooled there are many more out there

Step 2: How to Get It Running With Your Micro Controller (arduino)

Servos can only work when they are told what to do by a micro controller so to get your servo running nicely you will need:
- an arduino
- a computer with arduino IDE
- the appropriate connection cable for your arduino
- a servo
- jumper wires
- The servo library's (which can be found here http://playground.arduino.cc/ComponentLib/Servo)
And a bread bored
Plug your servos signal cable into pin 9
And the Vcc cable into the 5v pin and ground into ground
Then upload this code:

#include

Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created

int pos = 0; // variable to store the servo position

void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}


void loop()
{
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}

Step 3: How a Servo Works

Here is the best description of servos I've ever read by an author at servo city if you find it helpful please give them a visit
"Servos are controlled by sending them a pulse of variable width. The source wire is used to send the pulse. The parameters for this pulse are that it has a minimum pulse, a maximum pulse, and a repetition rate. Given the rotation constraints of the servo, neutral is defined to be the position where the servo has exactly the same amount of potential rotation in the clockwise direction as it does in the counter clockwise direction. It is important to note that different servos will have different constraints on their rotation but they all have a neutral position, and that position is always around 1.5 milliseconds (ms).
The angle is determined by the duration of a pulse that is applied to the control wire. This is called Pulse width Modulation. The servo expects to see a pulse every 20 ms. The length of the pulse will determine how far the motor turns. For example, a 1.5 ms pulse will make the motor turn to the 90 degree position (neutral position).

When these servos are commanded to move they will move to the position and hold that position. If an external force pushes against the servo while the servo is holding a position, the servo will resist from moving out of that position. The maximum amount of force the servo can exert is the torque rating of the servo. Servos will not hold their position forever though; the position pulse must be repeated to instruct the servo to stay in position.

When a pulse is sent to a servo that is less than 1.5 ms the servo rotates to a position and holds its output shaft some number of degrees counterclockwise from the neutral point. When the pulse is wider than 1.5 ms the opposite occurs. The minimal width and the maximum width of pulse that will command the servo to turn to a valid position are functions of each servo. Different brands, and even different servos of the same brand, will have different maximum and minimums. Generally the minimum pulse will be about 1 ms wide and the maximum pulse will be 2 ms wide.
Another parameter that varies from servo to servo is the turn rate. This is the time it takes from the servo to change from one position to another. The worst case turning time is when the servo is holding at the minimum rotation and it is commanded to go to maximum rotation. This can take several seconds on very high torque servos." Information provided by servo city

Step 4: Thanks for Reading

Thanks to everyone who read this I do hope you learnt something and as always if you have any question please leave them in the comments and I'll try my best to get back to you.
Pretty good intro.
<p>Thanks for your instructable. I'm new at this electronics stuff and appreciate anything that is written at the level I can understand.</p>
<p>Supa, just what I was looking for great detail A1+++</p>

About This Instructable

4,701views

105favorites

License:

Bio: I'm a 18-year-old high school student, I love engineering, film production, design and everything in between.
More by electronics for everyone:Emergency Keyring Phone Charger Salvaging Rechargeables for Projects  Portable Light Panel  
Add instructable to: