Servo — Knob to Angle
Twist to point
Servo
Potentiometer
analogRead
Project
What you will learn
- How a knob becomes a position command for a motor
- How the Servo.h library handles PWM timing for you
- How to smooth jittery readings with a simple moving average
What you will need
| Component |
|---|
| 1× 9V battery |
| 1× slide switch |
| 1× potentiometer |
| 1× servo motor (SG90) |
| Breadboard |
| 4× jumper wires |
Step by step
Take it further
- Add a second pot that controls a different servo (2-DOF arm).
- Add a button that, when pressed, "centers" the servo to 90° (return-to-home).
- Use an LDR instead of a pot — light direction controls the servo (solar tracker).
Practise it before you build it
Wire this circuit in the ThinkEdge Learn simulator first. The simulator runs a real Arduino sketch against a modified-nodal-analysis solver, so the LED on screen actually lights when the current is right — no hardware, no burnt components, and a class can try it in a browser.
Related projects
LDR — Light-Following Robot (Solar Tracker)It always faces the brightest spot
Arduino — RGB LED Color MixerThree pots, one RGB LED — mix any color of the rainbow
Police SirenAlternating red + blue LEDs with a wailing 600–1500 Hz buzzer
Sound Sensor — VU Meter (5 LEDs)The louder the sound, the more LEDs light up
LDR — Sunrise Alarm ClockWhen the sun rises, the room wakes up with a soft glow
Arduino Mega — 4-Servo Robot ArmDrive 4 servos at once for a pan-tilt-gripper-tilt arm
Guides that use this project
8 guides on the site build this project as part of a longer explanation. The guide says why the circuit works; this page says how to wire it.
How to Build a DroneHow to build a drone from scratch: the four subsystems every drone needs, the parts that make them work, and the Arduino projects that teach each one before you fly.
How to Build a RobotHow to build a robot from scratch: one motor and a switch, then sensors, then a line-follower that steers itself. Every stage runs in a browser simulator first.
How to Learn RoboticsHow to learn robotics without a degree: the order to learn electronics, code and control in, how long each stage takes, and the projects that prove each one landed.
Robot ArmHow to build a robot arm with hobby servos, a 5 V supply and an Arduino: how to pick joints, wire the power, and test each axis in the simulator.
Humanoid Robots: Balance First, Walking SecondWhat makes a humanoid robot work: inverted-pendulum balance, joint torque budgets and centre of mass, plus the Arduino projects to get you there.
Tesla Robot Optimus: What the Hardware Has to DoTesla Robot Optimus is a prototype, not a product. Here is what its actuators, sensors and balance problem mean, and how to build the same ideas cheaply.
UAV Drones ExplainedWhat a UAV is, how the main airframe types differ, and how a drone actually stays upright. The engineering behind drones, taught the way a student can build it.
FPV Drone SimulatorsFPV drone simulators let you practise the exact physics of flying before spending money on crashes. What they model accurately, what they skip, and how to pick one.
Where this project sits
It is also part of these lists, which is how a class usually finds it.
Try the full simulator with your class
103 guided circuit projects, 21 lessons and an in-browser Arduino simulator. The first 15 projects are free, no account needed. One licence covers a whole school.