Arduino Circuits

Servo Motor Position Control

A basic control circuit that positions a servo motor at 0, 90 and 180 degrees using a PWM signal.

22 November 20265 min read
Servo Motor Position Control circuit with an Arduino Uno and a servo motor built on a breadboard
Breadboard layout, components and jumper connections of the Servo Motor Position Control circuit.

Interactive circuit guide

Run the simulation, follow the build steps one by one and try it in our real app.

Real screenshot of our circuit simulator Stopped
Open in our app →

Step-by-step build

What is it for?

In this project a PWM signal from one of the Arduino digital outputs positions a servo shaft at 0, 90 and 180 degrees. A servo has three wires: the signal wire goes to an Arduino pin, the supply wire to a 5V line, and the ground wire to a single point shared by both the motor and the Arduino. The 220 ohm series resistor and green LED added to the signal line let you visually confirm that the control signal is arriving. On the breadboard, place the power rails first, then the signal and ground wires; check polarity twice before connecting power. Because servos draw current in sudden bursts, it is safer to take the supply from a separate 5V line rather than from the Arduino. This is a basic positioning project and the first step towards robot arms, camera steering and lid-opening mechanisms.

Parts list

The following components are used to build this project:

  • Arduino Uno × 1 — Generates the PWM signal for the servo.
  • Servo Motor × 1 — Converts the electrical signal into an angular position.
  • 5V supply line × 1 — Provides enough current for the servo.
  • 220 Ω resistor × 1 — Limits the LED current.
  • Green LED × 1 — Shows the control signal.
  • Ground connection × 1 — A single reference point for all ground terminals.

Build it step by step

  1. Place the Arduino on the left of the breadboard and connect its GND pin to the ground rail.Tip: pin 0 is ground; make that connection first.
  2. Put the servo motor on the right and separate its signal, supply and ground wires.Tip: servo pin 0 is signal, pin 1 is +5V and pin 2 is ground.
  3. Connect the 5V line to the servo supply pin and the servo ground to the common ground.Tip: the servo ground and Arduino GND must meet at the same point.
  4. Run a wire from an Arduino digital pin to the servo signal pin.Tip: do not confuse the signal wire with the supply wire.
  5. Connect the 220 Ω resistor and green LED in series on the signal branch, with the LED cathode to ground.Tip: the long leg of the LED is the anode; the resistor must always be in series.
  6. Upload the code and watch the shaft move between 0, 90 and 180 degrees.Tip: if the shaft jitters, the supply current is too low.

How it works

A servo motor holds its shaft at the requested angle thanks to the position feedback circuit inside it. The pulse width of the 50 Hz PWM signal produced by the Arduino sets the angle: roughly a 1 ms pulse means 0 degrees, 1.5 ms means 90 degrees and 2 ms means 180 degrees. The signal carries only a position command; the turning power comes from a separate supply line. For that reason a common ground between the servo supply and the Arduino supply is essential, otherwise the signal reference is lost and the shaft behaves randomly. The LED and series resistor are a simple indicator that confirms the control signal is present.

Layout tip: the Arduino Uno goes on the left of the board and the servo motor on the right. The 5V line feeds the servo supply pin; the servo ground and Arduino GND share the same ground row (common ground). The signal wire goes to an Arduino digital pin, and the LED and 220 ohm resistor are added in series on the signal branch.

What you learn

  • Explains the relationship between PWM pulse width and servo angle.
  • Knows that signal and power supplies must be separated.
  • Defends the need for a common ground with a reason.
  • Applies the use of a series resistor for an LED.

Tips

  • If the servo jitters, increase the current capacity of the supply line.
  • If the ground connection breaks, the servo either does not respond or jitters.
  • Keeping the signal wire long introduces noise.
  • Forcing the shaft mechanically damages the gears.

Try it yourself

  • Go to three angles: Turn the servo to 0, 90 and 180 degrees in sequence. The shaft reaches the target angle on every command.
  • Check the LED: Observe that the green LED lights when a signal is sent. The LED lights while the signal is present and the series resistor is fitted.

Getting the parts

If you want to build this project in real life, you can get the parts from hobidevre.com.

Frequently asked questions

What is this circuit for?

A basic control circuit that positions a servo motor at 0, 90 and 180 degrees using a PWM signal.

How does the circuit work?

A servo holds its shaft at the requested angle through internal feedback. The 50 Hz PWM pulse width sets the angle: about 1 ms is 0 degrees, 1.5 ms is 90 degrees and 2 ms is 180 degrees. The signal carries only a position command; the turning power comes from a separate supply, so servo ground and Arduino ground must be common.

What is the expected result?

The servo turns to 0, 90 and 180 degrees, the green LED lights while the signal is present, and the supply and ground connections are sound.

You may also like

Try the circuit in the simulator

Open the schematic in the browser, inspect the connections and follow the steps.