Read a Potentiometer Knob
Wire a pot and watch its value change as you turn it.
Read a Potentiometer Knob is a free Arduino & IoT Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Arduino & IoT Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Meet the Potentiometer
A potentiometer, or pot, is a knob you turn to change resistance. It is the easiest analog input to start experimenting with.
It Has Three Pins
A pot has three legs: two outer pins for power and ground, and a middle wiper pin that gives the changing voltage.
Wire the Outer Pins
Connect one outer pin to 5V and the other to GND. This sets up the full voltage range across the pot.
Wire the Wiper to A0
Run the middle wiper pin to an analog input like A0. As you turn the knob, the voltage on that pin moves.
It Is a Voltage Divider
Inside, the pot acts as a voltage divider. Turning the shaft moves a contact that splits 5V into the reading you sense.
Read the Knob in Code
Reading it is one line. Call analogRead(A0) and you get a value from 0 to 1023 that tracks the knob position.
int pot = analogRead(A0);Fully Left Reads 0
Turn the knob all the way toward the GND side and the reading drops to about 0. The wiper now sees zero volts.
Fully Right Reads 1023
Turn it fully toward the 5V side and the value climbs to about 1023. The wiper now sees the full supply voltage.
Print It to Watch
Send the value to the Serial Monitor so you can watch it change live. Use Serial.println inside your loop.
Serial.println(analogRead(A0));Add a Small Delay
A brief delay keeps the Serial Monitor readable instead of a blur. Ten milliseconds is plenty between samples.
delay(10);A Hands-On Analog Lab
The pot is your personal analog lab. Twisting it is the quickest way to feel how voltage becomes a number.
Quick Check
Which pot pin feeds the Arduino its reading?
Recap: Reading a Knob
You wired a potentiometer with outer pins on 5V and GND and the wiper on A0. Now analogRead tracks the knob from 0 to 1023.
Frequently asked questions
Is the “Read a Potentiometer Knob” lesson free?
Yes — the full text of “Read a Potentiometer Knob” is free to read here on the web, and the Arduino & IoT Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Arduino & IoT Academy course, upgrade to CoddyKit PRO.
What will I learn in “Read a Potentiometer Knob”?
Wire a pot and watch its value change as you turn it. You practise Arduino & IoT Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Arduino & IoT Academy?
No prior experience is required. Arduino & IoT Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Read a Potentiometer Knob” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Arduino & IoT Academy lesson?
Yes. Every Arduino & IoT Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Digital vs Analog Signals
- analogRead Returns 0–1023
- Read a Potentiometer Knob
- map() Values to a New Range