Servo

A Servo is basically a small electric motor & gearbox that knows where it is in rotation. It does this by including a potentiometer(pot) in the frame of the servo. As the motor rotates gears turn the pot. Servos are limited in how much they can turn often you will find they can only turn 180 degrees, but you can find 360 degree servos.

Inner workings


A servo usually contains a very compact gearbox, converting speed to force. A microcontroller, which is often placed inside the case, uses a potentiometer to determine the exact position of the servo. The microcontroller accepts pulses of 20ms length (50hz). 

Availability

 * 5Hz Electrónica Servo Grande
 * SparkFun.com Large Servo
 * SparkFun.com Small Servo
 * SparkFun.com Continuous Rotation Servo

Controlling the servo
To control the servo, you have to send pulses to it. One pulse has a total length of 20ms. The pulse is composed by a 0.9ms to 2.1 high pulse, and the rest is low. On a pulselength of 0.9 seconds, the servo will move to one side of it. On a pulselength of 2.1 second, the servo will move to the other side. By varying with that time, you can set the position of the servo.

Code
Servo