Close or Esc Key

Arduino Projects   |   Raspberry Pi   |   Electronic Circuits   |   AVR   |   PIC   |   8051   |   Electronic Projects

Servo Motor

Written By: 

Nikhil Agnihotri

Servo MotorWhat are Servo Motors?


Servo refers to an error sensing feedback control which is used to correct the performance of a system. Servo or RC Servo Motors are DC motors equipped with a servo mechanism for precise control of angular position. The RC servo motors usually have a rotation limit from 90° to 180°. Some servos also have rotation limit of 360° or more. But servos do not rotate continually. Their rotation is restricted in between the fixed angles.
Where are Servos used?
The Servo motors are used for precision positioning. They are used in robotic arms and legs, sensor scanners and in RC toys like RC helicopter, airplanes and cars.
Servo Motor Applications in RC Helicopter
Servo Motor Applications in RC AirplanesServo Motor Applications in RC Airplanes
Servo Motors in Robotic  ArmsServo Motors in Robotic Arms
Servo Motor manufacturers
There are four major manufacturers of servo motors: Futaba, Hitec, Airtronics and JR radios. Futaba and Hitec servos have nowadays dominated the market. Their servos are same except some interfacing differences like the wire colors, connector type, spline etc.
Servo Motor Manufacturers
Servo Motor wiring and plugs
The Servo Motors come with three wires or leads. Two of these wires are to provide ground and positive supply to the servo DC motor. The third wire is for the control signal. These wires of a servo motor are color coded. The red wire is the DC supply lead and must be connected to a DC voltage supply in the range of 4.8 V to 6V. The black wire is to provide ground. The color for the third wire (to provide control signal) varies for different manufacturers. It can be yellow (in case of Hitec), white (in case of Futaba), brown etc.
Futaba provides a J-type plug with an extra flange for proper connection of the servo. Hitec has an S-type connector. A Futaba connector can be used with a Hitec servo by clipping of the extra flange. Also a Hitec connector can be used with a Futaba servo just by filing off the extra width so that it fits in well.

Hitec splines have 24 teeth while Futaba splines are of 25 teeth. Therefore splines made for one servo type cannot be used with another. Spline is the place where a servo arm is connected. It is analogous to the shaft of a common DC motor.
Structure of Servo Motor

Unlike DC motors, reversing the ground and positive supply connections does not change the direction (of rotation) of a servo. This may, in fact, damage the servo motor. That is why it is important to properly account for the order of wires in a servo motor.


Thanks for this article i was searching about for servo motors and finally i found what i wanted to learn.

okay carry on...


Hi there to all, the contents present at this website are genuinely remarkable for people experience, well, keep up the good work fellows.

thanks for this article. i wanted to know about servo motors.......

thank you i fully understand about servo motor very thanhs

give the detailed explain of electronic component in servo

 very informative article

 A article with all information about servo motor at one place. 

hi sir

this was really informative.I m using HS-311 servo mortors with ATMEGA 16 microcontroller.for making it rotate to 0degree i gave 0.33 us on pulse and 20 ms off pulse,for 90 degree i gave 0.95ms on pulse and for 180 degree......1.56 ms pulse.... it worked effectively.for2 servos i had to use 2 avr ports. i want to use 4 servos in only 1 port in ATMEGA 16,how can it be done without interfering with other servo's PWM??

super like.....its 2 good ....
really i impressed with this presentation
how will move servo from ic 555. 

i am really impressed with the explanation of servomotor. i now see that its a step ahead of the dc motor we used back in the days


thank u it was really helpfullyes

Informative post on servo motors. This post will really help in selecting a servo and in manufacturing it. Generally, people have to face problem while selecting a particular servo according to their requirement. Thanks a lot for this wonderful post.

very informative article

should post some relative circuit diagram to check the servo's working

hi plz attach pdf form of this artile for download tanx very informative article

nice information very usefull 


nice article

this is a really nice to learn all about the servo motor by the artical.


The post is really cool, thanks for sharing it here. Good thing someone shared it so we can all use it as guide and future reference when it comes to servo motor.

Anyway, it's nice to know that a lot of people shows interest at servo motors.:)

A very well done by the author. A very informational article with clear a well structured literature. A real joy to read . Once again WELL DONE!


I am new to electronics world i would like to know is there a way to reduce the speed of sservo motors without decreasing its toque. 

Thanks in advance.


Hi sir

Im using MG995 twoerPro servo motor interfacing with arduino.
im not getting result as programed 
I connected red to +5v
brown to ground

& yellow for signal to arduinos pin 9


and want to rotate 20 degrees like this

for (i=0;i<=180; i=i+20)

move 20 degree



here is the complete program (i tested with arduino uno board with vs2 and v0006 servo)



#include <Servo.h> 
Servo myservo;  // create servo object to control a servo 
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 += 20)  // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 20 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-=20)     // 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 

hy sir

i'm using pic 16f877A controller
i'wanna conrol a servo motor in such a way that pulses of different time period  are given to motor ........
i'm using CCs compiler
i've confusion to make the code
any 1 help me please

i'm tHankful to yOUh.. .. ..



thanks  a lot

Very good explanation. Better than text book and manual.

Very nice and awesome!

Really great post!!.Thank you for sharing this knowledge with us.Its a well written post i would share with my friends also.



I recently came across your blog and have been reading along. I think I will leave my first comment. I don’t know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

Thanks and Regards,

thanks for post

It does help me a lot knowing that you have shared this information here freely. I love the way the people here interact and shared their opinions too

Very Useful article for beginners like me .....




sir, I'm working with 6 servomotor robotic arm, which will pick up & place object,.......but I didn't get the o/p with my program........plz help


nice information

hi sir,


i'm using pic 16f877A controller..i'wanna conrol a servo motor in such a way that pulses of different time period  are given to motor ........
i'm using hitech compiler.i've confusion to make the code.any 1 help me please.

i need 0 to 90 of rotation and 90 to 0 of rotation ... pls send me the code to .. reply me as soon as possible...


Thanks ......

I'm having trouble understanding what the sw 1 goes to in the first ic 555. Can u help?

please help me 

i want make robot arm by using servo motor but i donot know which servo model can be used and any type 

servo which rotate 180 degree or 360 degree.

i will use pic16f877a .i want code for controll arm by micro c langague .


hi , i am using atmega32. i want to control servo motor with help of keypad 4*3 (eg. by pressing key '1' motor should rotate anticlockwise and by pressing key '4' it should rotate clockwise) atmega32 comes with pwm output(pin 21), i want some help in programing the output pin(21) with desire duty cycle generated by pressing key 1 or 4 to rotate servo motor acw or cw respectivly..


thanking you in advance..

Hi Sir


I am using ATMEGA16 for my robotic arm which has a servo motor 

I have connected the data pin of servo motor to Port B3 .

I need to control the position of servo motor using a 10k potentiometer.

The servo has to rotate only when i change the resistance through pot

Plese give me the code ,it is so important and also urgent


this website is remarkable. i learnt a lot from this web

Can anyone tell me whether servo motor can be run by Atmega-16 ?

Yes it can be... there is another article on this site detailing the avr code:

Can you tell me how to rotate a servo in the reverse direction?

Are you sure that there is nothing in the electronics as well that would prevent a 180 degree servo motor from making a full 360 degree rotation, once we file off the mechanical stops??

Are you sure that there is nothing in the electronics as well that would prevent a 180 degree servo motor from making a full 360 degree rotation, once we file off the mechanical stops??


I wrote a program for LPC1768 i connceted servomotor to 5v and motor is not rotating but when i keep on insertimg and removing my PWM output it is slightly can i solve this issue