Main Content

Basic Servo Control for Beginners

From simply sweeping an object back and forth to adding steering to your robot or R/C car, hobby servos are a great way to add some motion to your next project. Servos allow you to easily control the speed, direction and position [1] of the output shaft with just three wires!

This tutorial covers a few different ways to control servos along with a project demonstrating how to control a servo from an external input. We will cover some basics of controlling servos with one example that requires no programming at all. Then we will control the servos with code using the Arduino IDE and Python. Feel free to jump to the example you would like to work with depending on the parts and code environment you prefer.

Servo Motor Basics
Before we get to the examples in this tutorial, we’ll want to review a few basics about servo motors. For a detailed rundown of servos, their background, and how they work, take a look at our Hobby Servo Tutorial.

Standard vs Continuous Servos
SparkFun carries two types of hobby servo motors: standard and continuous rotation. There are several differences between the two types but for the purpose of this tutorial we’ll only review the primary distinctions between Standard and Continuous Rotation servos.

A standard servo moves on a rotation arc (usually 0-90° or 0-180°) and provides positional feedback to the controller. This lets you move it to a specific point on the rotation arc and the servo reports its position back to the controller. Standard servos work great for things like steering control in R/C applications, controlling a robotic gripper or controlling a pan/tilt bracket like we cover later in this tutorial.”

Link to article