SERVO MOTOR

TINKS045

  1. A servo motor is an electrical device which can push or rotate an object with great precision.
  2. If you want to rotate and object at some specific angles or distance, then you use servo motor Servo can rotate approximately 180 degrees (90 in each direction).
Features:-
  1. Operating Voltage is +5V typically
  2. Torque: 2.5kg/cm
  3. Operating speed is 0.1s/60°
  4. Gear Type: Plastic
  5. Rotation : 0°-180°
  6. Weight of motor: 9gm
  7. Package includes gear horns and screws.
Applications:-
  1. Used as actuators in many robots like Biped Robot, Hexapod, robotic arm etc.
  2. Commonly used for steering system in RC toys
  3. Robots where position control is required without feedback
  4. Less weight hence used in multi DOF robots like humanoid robots.

    

#include <Servo.h>

Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards

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

void setup() {
myservo.attach(7); // 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 >= 0; 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
}
}