Using Arduino to Program a Servo

You can use the Arduino microcontroller to program a servo. The Arduino software is free and supports Arduino controller products (as well as some other compatible products) to program servo motors. Here you can see the big picture of Arduino family products:

In the map, as long as a product includes PWM pins (which is applied to all products), you can use it to drive a servo motor and program it. If you’re not interested in investigating further functions that each advanced product provides, the Arduino Uno (or Sparkfun Redboard) is a good place to start.


You can read the basics of controlling servo motors (setting the speed and rotation angle of servo motors) here:
Makezine’s tutorial on Arduino’s Servo Library

* For those using a 180° servo motor, start here:
* For those using a continuous servo, remember that the command that sets the angle of a 180° servo motor (e.g.,ServoName.write(60)) instead sets the speed of a continuous servo. So, given a range of values from 0 to 180, a value near 90 stops the continuous servo motor, a value of 0 sets full-speed in one direction (“reverse”) and 180 sets the servo to full-speed in the other direction (“forward”).

You’ll need to use a USB cable to connect the controller to your laptop where you might have downloaded and installed the Arduino software from here to program your controller. You also need to use three jumper wires to connect the power, ground and signal of your servo motor to your controller. Jumper wires need male connectors on both ends because both the Arduino controller and servo motors have female headers.