- Difficulty
- Beginner
- Build time
- 45-70 min
- Estimated cost
- $0-$18
- Age range
- 11-16
- Workspace
- A clear table about 90 cm wide
The finish line
What you will build
The pointer tracks five labeled knob positions from 20 to 160 degrees with average error below 8 degrees.
Learning goals
- Identify how potentiometer shaft angle produces servo pointer angle.
- Construct and explain a analog rotation-to-commanded angular position system.
- Measure how number of analog samples averaged changes performance.
- Diagnose losses caused by servo backlash and potentiometer noise.
Before you build
Materials, tools, and safety
Reuse-material cost: Usually under $5 with an existing kit. Supervision: Adult guidance recommended for wiring and cutting.
Tools
- Small screwdriver
- Wire stripper
- Multimeter
- Low-temperature glue gun or tape
Low-cost swaps
- Use alligator-clip leads for a no-solder version.
- Build and test the mechanism manually before adding electronics.
- Use two pushbuttons to step the pointer if a potentiometer is unavailable.
Wiring table
| From | To | Purpose |
|---|---|---|
| Potentiometer ends | 5 V and GND | Create reference voltage range |
| Potentiometer wiper | Analog A0 | Measure knob position |
| Servo signal | PWM pin 9 | Send position pulse |
| Servo power | Regulated 5 V and GND | Supply servo current |
| Controller GND | Servo supply GND | Create common signal reference |
Project-specific safety
- Use only the listed low-voltage battery supply; never use mains electricity.
- Disconnect power before changing wires and stop if a motor, wire, or battery becomes warm.
- Use only 5 V, connect common ground, keep fingers clear of the servo horn, and set software angle limits before attaching the pointer.
Orient the build
Place the build so potentiometer shaft angle is on your left and servo pointer angle is on your right. Call the side facing you the front, the far side the back, the tabletop the bottom, and the opposite face the top.
Build it
Step-by-step instructions
Step 1
Build the dial
Mount the potentiometer through a card panel and add five knob marks.
Prevent the body from rotating.
Step 2
Mount the servo
Fix the servo behind a protractor with its shaft centered at the origin.
Leave horn access.
Step 3
Wire the input
Connect potentiometer ends to 5 V and ground and the wiper to A0.
Check resistance with power off.
Builder checkpoint: After wire the input, the first subassembly should stay aligned when handled gently.
Step 4
Wire servo power
Use regulated 5 V for the servo and join grounds with the controller.
Connect signal to pin 9.
Watch for: If this stage binds or drifts, inspect mount movement before adding more parts.
Step 5
Upload safe mapping
Map analog values to 20-160 degrees and add a short delay.
Test without the pointer.
Step 6
Attach at center
Set the knob and servo to midpoint, then attach the pointer at 90 degrees.
Tighten without bending the horn.
Builder checkpoint: After attach at center, operate the build slowly and confirm that servo pointer angle begins without binding.
Step 7
Calibrate five marks
Record measured angle at five knob positions.
Note backlash when approaching from each direction.
Step 8
Reduce error
Average several readings or adjust endpoint values.
Repeat the five-point test.
Builder checkpoint: At the final checkpoint, The pointer tracks five labeled knob positions from 20 to 160 degrees with average error below 8 degrees.
See the engineering
Why it works
- Input
- potentiometer shaft angle
- Output
- servo pointer angle
- Motion
- analog rotation-to-commanded angular position
- Energy losses
- servo backlash, potentiometer noise, pointer flex, mount movement
Why this works
Input mapping
The analog-to-digital converter measures knob voltage from 0 to its maximum count. Code maps that range to safe servo angles, and the servo's internal controller holds the requested position.
Look for: Move the knob slowly through five marks and compare commanded angle with a paper protractor.
Where the energy goes
Efficiency and losses
The ideal model leaves out servo backlash, potentiometer noise, pointer flex, mount movement. These effects turn some input energy into heat, sound, vibration, or unwanted motion, so measured performance will be lower than an ideal calculation.
Look for: Run the build slowly and locate the first place where servo backlash becomes visible or audible.
Math bite
Map an analog value
Formula: angle = 20° + reading / 1023 × 140°
- Reading = 512
- Output span = 140°
Substitute: angle = 20 + 512 / 1023 × 140 ≈ 90°
Result: A midpoint reading commands about 90 degrees.
Endpoint limits protect the mechanism.
ADC noise and servo calibration change real angle.servo_pointer.ino
A complete filtered analog-to-servo mapping with conservative endpoints.
#include <Servo.h>
Servo pointerServo;
void setup(){ pointerServo.attach(9); pointerServo.write(90); delay(500); }
void loop(){
long total=0;
for(int i=0;i<8;i++){ total += analogRead(A0); delay(2); }
int reading=total/8;
int angle=map(reading,0,1023,20,160);
pointerServo.write(constrain(angle,20,160));
delay(15);
}
Make it behave
Test, troubleshoot, and tune
Controlled test
Start here: Move the servo with no pointer through 20, 90, and 160 degrees.
Success looks like: Five output positions have average absolute error below 8 degrees.
Measure: Commanded angle, measured angle, error, jitter, and direction of approach.
Change: number of analog samples averaged
Keep constant: servo, supply, pointer, protractor, endpoints, and knob marks
- one sample
- five-sample average
- ten-sample average
| Symptom | Likely cause | Confirm it | Fix |
|---|---|---|---|
| The servo jitters | Input voltage is noisy or ground missing | Hold knob still and log values | Join grounds and average samples |
| Angles are reversed | Potentiometer ends are swapped | Turn clockwise and watch reading | Swap the two end connections |
| Pointer hits the frame | Limits are too wide or horn misaligned | Test with pointer removed | Reduce endpoints and recenter horn |
| Controller resets | Servo supply sags | Watch power indicator during movement | Use rated separate 5 V servo supply with common ground |
Choose your tradeoff
Use measured safe endpoints and attach the pointer only after centering. More averaging reduces jitter but adds response delay.
Keep experimenting
Try another version
Three presets
Use buttons for 30, 90, and 150 degrees.
Calibration curve
Correct systematic error at five points.
Rate limit
Move toward target gradually to control pointer speed.
Build together
Classroom and access options
Classroom version
Teams can compare number of analog samples averaged while keeping servo, supply, pointer, protractor, endpoints, and knob marks. Assign builder, tester, recorder, and explainer roles; have each team predict the result before collecting three trials.
Access adaptations
- Color-code and label every wire at both ends.
- Use clip leads, larger controls, and pre-crimped connectors when fine motor work is difficult.
- Use a large knob, tactile position marks, and an optional five-button preset control.
Reflect on the design
- How did number of analog samples averaged change the measured result?
- Where did servo backlash affect the build most strongly?
- What evidence shows that input mapping explains the motion?
- Which change would improve servo pointer angle without creating a new problem?
Glossary
- Input mapping
- The analog-to-digital converter measures knob voltage from 0 to its maximum count.
- Input
- The action or energy supplied to a system; here it is potentiometer shaft angle.
- Output
- The useful response produced by a system; here it is servo pointer angle.
- Efficiency
- The fraction of input energy that becomes useful output instead of friction, sound, heat, or unwanted motion.
Build your dreams
One build can start the next.
Share what you learned, change one variable, and help another builder understand what worked.
Explore more guidesSources and build notes
A platform-agnostic low-voltage robotics or electronics project with original assembly guidance.
- Low-voltage design review: Battery voltage, polarity, component roles, current paths, and motor or LED protection were editorially checked.
Written and edited by BrickLabClips. Published 2026-07-22; updated 2026-07-22.
