Arduino — Potentiometer Tone Control
Turn the knob, hear the pitch change in real time
Arduino
Potentiometer
tone()
analogRead
map
Music
What you will learn
- How a potentiometer works (3 terminals: power, ground, wiper)
- How analogRead() returns a value from 0 to 1023 based on the voltage
- How map() scales one range to another (0–1023 → 200–2000)
- How tone(pin, frequency) plays that exact frequency on a buzzer
What you will need
| Component |
|---|
| 1× Arduino Uno R3 |
| 1× potentiometer (10kΩ) |
| 1× buzzer (piezo) |
| 1× 100Ω resistor (for the buzzer) |
| 1× breadboard |
| 5× jumper wires |
Step by step
Take it further
- Change the range to play actual musical notes: map(knob, 0, 1023, 262, 523) covers middle C to high C — like a one-octave keyboard.
- Add a second pot on A1 to control the VOLUME (via PWM on a different pin driving the buzzer, or by varying delay between tone updates).
- Print the note NAME instead of the frequency: use an if/else to print "C4", "D4", "E4" etc. based on the mapped value.
- Add a button that switches between two instruments: button released = sine-wave-ish (smooth tone via fast analogWrite PWM), button pressed = square wave (the default tone()).
- Use the Serial Monitor to draw a live graph of the knob position over time (like an oscilloscope).
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
Arduino Nano — 4-Note Mini PianoFour buttons, four notes, one tiny piano that fits in your pocket
Arduino Nano — Parking Sensor4 distance zones — 1 slow low beep far, 2 fast high-pitch beeps close (like a real car reversing buzzer)
Arduino — RGB LED Color MixerThree pots, one RGB LED — mix any color of the rainbow
Arduino — Music BoxPress the button, hear a complete melody. Arrays + delays = music.
LDR — Automatic Night LightThe room gets dark, the LED turns on
Arduino — Servo SweepMake a servo motor wave back and forth
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.