Servo + Potentiometer
Use a knob to request a servo angle and connect an analog input to a moving output.

Wire it up
Disconnect power before changing connections. Follow terminal names rather than wire colors.
| From | To | Why it matters |
|---|---|---|
| Potentiometer (pot1) · VCC | Uno · 5V | Power connection |
| Potentiometer (pot1) · GND | Uno · GND.2 | Ground reference |
| Potentiometer (pot1) · SIG | Uno · A0 | Match this terminal to the sketch |
| Servo (servo1) · PWM | Uno · 9 | Match this terminal to the sketch |
| Servo (servo1) · V+ | Uno · 5V | Power connection |
| Servo (servo1) · GND | Uno · GND.1 | Ground reference |
The complete sketch
#include <Servo.h>
Servo arm;
void setup() { arm.attach(9); }
void loop() {
arm.write(map(analogRead(A0), 0, 1023, 0, 180));
delay(20);
}
The launch buttons use this same code and a matching saved circuit.
Build it step by step
Open a complete project
Launch in Simulator creates a separate Uno sketch and its matching wired circuit. Existing sketches are preserved. Press Run to compile and execute.
Explore the live circuit
Rotate the knob and observe the horn. Real servos need a suitable regulated supply and common ground; the virtual 5 V rail does not model motor load.
Try it on hardware
Disconnect power while wiring. Match terminal names in the table, select the exact board, Verify, then connect and upload. Check component ratings and power requirements first.
Understand the sketch
Mapping a position
map converts the ADC range into a requested angle. Servo generates timed pulses on D9. The model shows an ideal position, not torque or mechanical limits.
If something is different
Servo jitters or board resets
Do not power a motor from a GPIO. Check the supply current rating, shared ground, and positional-servo type.
Expected output and tested scope
The potentiometer requests a servo angle; moving it changes the modeled arm position.
Version 1 · Last source- and build-matched test: 2026-10-25. Actual shipped AVR-GCC WASM compilation and Uno AVR engine execution; no physical hardware test.
Supported tutorial target: Arduino Uno R3 / ATmega328P. Compile: PASS · Modeled execution: PASS. Other boards require a separate review of pins, voltage, libraries and the exact build profile.