
Bu projeyi gerçekten kurmak istersen parçaları hobidevre.com'dan temin edebilirsin →
Build it for real
To build this project for real, get the parts from hobidevre.com → hobidevre.com →
More build guides: hobidevre.com/blog
Create a free account — save your progress and get more circuits →
No installationWhat is it for?
In this project a servo motor runs in two modes. In continuous sweep mode the shaft moves from 0 to 180 degrees and back; in set mode the potentiometer wiper value determines the angle directly. The servo signal pin connects to an Arduino digital output, its supply pin to a separate 5V line and its ground pin to the common ground. One end of the potentiometer goes to 5V, the other to ground and the wiper to an analogue input. A yellow LED and a 220 ohm series resistor show that the sweep signal is active. On the breadboard, place the power rails first, then the signal and ground wires. Because a servo draws current in bursts, the supply line must have enough capacity and the servo ground and Arduino GND must meet at the same point. This circuit is the basis of radar-like scanning and interactive steering applications.
Parts list
The following components are used to build this project:
- Arduino Uno × 1 — Produces PWM and reads the analogue input.
- Servo Motor × 1 — Performs the angular sweep movement.
- 10 kΩ potentiometer × 1 — Provides the angle reference.
- 5V supply line × 1 — Reference voltage for the servo and potentiometer.
- 220 Ω resistor × 1 — Limits the LED current.
- Yellow LED × 1 — Shows the sweep state.
- Ground connection × 1 — A common point for all ground terminals.
Build it step by step
- Place the Arduino and servo; connect GND to the common ground.Tip: do not forget the servo ground.
- Connect the servo supply pin to the 5V line and its ground pin to the common ground.Tip: servo power should come from the line, not an Arduino pin.
- Connect the servo signal pin to an Arduino digital pin.Tip: keep the signal wire separate from the supply wire.
- Connect the potentiometer to 5V and ground and feed the wiper to the analogue input.Tip: the wiper is the middle leg, not the ends.
- Add the 220 Ω resistor and yellow LED in series on the signal branch.Tip: connect the LED cathode to ground.
- Upload the code and watch back-and-forth motion in sweep mode and wiper response in set mode.Tip: mode switching is done with a condition in the code.
How it works
The servo angle is determined by the width of the PWM pulse on the signal line. In sweep mode the pulse width is increased and decreased gradually so the shaft travels continuously between 0 and 180 degrees. In set mode the wiper voltage read at the analogue input is mapped to an angle; turning the potentiometer turns the servo the same way. Servo power comes from a separate 5V line because motor current exceeds Arduino pin capacity. For the signal to be interpreted correctly, the servo ground, potentiometer ground and Arduino GND must be common. The LED and series resistor show that the signal line is active.
Layout tip: the Arduino is on the left, the servo at the top right and the potentiometer at the bottom left. Servo supply and one potentiometer end go to 5V; all grounds share one row. The yellow LED and 220 ohm resistor sit in series on the signal branch.
What you learn
- Applies PWM pulse width to angle conversion.
- Maps an analogue input to servo control.
- Compares sweep and set modes.
- Repeats the common ground and series resistor rules.
Tips
- If the servo jitters, strengthen the supply line.
- If the wiper reading is unstable, tighten the connection.
- Do not force the shaft against a mechanical stop.
- If the LED stays dark, check the signal pin.
Try it yourself
- Sweep continuously: Turn the servo back and forth between 0 and 180 degrees. The shaft sweeps smoothly and regularly.
- Set with the potentiometer: Turn the wiper to control the angle directly. The wiper position changes the servo angle in step.
Getting the parts
If you want to build this project in real life, you can get the parts from hobidevre.com.
hobidevre.com · more build guides
Frequently asked questions
What is this circuit for?
It runs a servo in continuous sweep mode or lets a potentiometer set its angle directly.
How does the circuit work?
PWM pulse width sets the servo angle. Sweep mode varies the width continuously; set mode maps the analogue wiper voltage to an angle. A separate 5V supply and a shared ground keep the signal and power correct.
What is the expected result?
Regular back-and-forth sweep, potentiometer-controlled angle in set mode, an active LED and sound supply and ground connections.