What this project teaches

A potentiometer is an adjustable resistor with three terminals. Connected across a low-voltage supply, it can act as a voltage divider: turning its shaft changes the voltage at its middle terminal, called the wiper. A microcontroller’s analog-to-digital converter, or ADC, can turn that voltage into a number. Viewing the number in a serial monitor gives you a direct way to see how a physical control becomes a program input.

This project uses a potentiometer, a breadboard, jumper wires, and a 3.3 V microcontroller board with an analog input. You will also need the board’s normal programming connection and a computer with a serial monitor. Choose a potentiometer around 10 kΩ if you have one; check its pin arrangement in its documentation rather than assuming every part has the same layout. Keep the project limited to the board’s regulated 3.3 V output. Do not connect it to mains wiring, a wall adapter’s internal circuitry, or an unknown power source.

Connect the control while power is off

Disconnect power before placing or moving wires. Connect one outer potentiometer terminal to the board’s 3.3 V output and the other outer terminal to ground. Connect the wiper to a pin identified in your board’s documentation as an analog input. Some boards have pins that look similar but cannot measure analog voltage, so confirm the exact pin before wiring. If you use a breadboard, check that each terminal occupies the intended row and that the power rails are not interrupted where you expect them to continue.

The two outer connections set the ends of the adjustment range. Swapping them will reverse which turning direction produces a higher reading, but it will not change the intended voltage range. With the outer terminals connected to 3.3 V and ground, the wiper should stay between those voltages. Never connect the wiper to a voltage above the analog input’s permitted range; pin limits vary by board. If your board does not provide a suitable 3.3 V output or its analog input has a lower limit, follow its documentation rather than this generic wiring plan.

Display the analog reading

Write a short program that starts the board’s serial connection, repeatedly reads the selected analog pin, and prints each result followed by a line break. Add a brief delay between readings so the display remains easy to follow. Use the analog-read function and pin name appropriate to your board’s programming environment. Upload the program, open the serial monitor, and set its communication speed to match the speed specified in your program.

Turn the shaft slowly from one end to the other. The displayed number should change gradually across much of the ADC’s available range. The exact minimum, maximum, and number of steps depend on the board and its ADC settings, so do not assume a particular numerical range. Near either end of the shaft’s travel, the reading should settle close to one extreme. Small changes between successive readings can occur even when you are not touching the control; focus first on whether the overall response is consistent.

Check a reading that does not behave as expected

If the value stays fixed, disconnect power and confirm that the program reads the same pin to which the wiper is connected. Check that both outer terminals have their intended connections and that the wiper is not accidentally in the same breadboard row as a power rail. A loose jumper can also make a reading jump or remain at an extreme. Reconnect power only after the wiring has been checked.

If the value changes in the opposite direction from the one you expected, swap the two outer connections with power off, or account for the direction in your program. If readings fluctuate widely, check for an unconnected wiper and firmly seated ground wire before trying to smooth the numbers in software. Once the basic circuit works, you can map its readings to a menu setting or another low-voltage project input, provided that project stays within the board’s electrical limits.

Make the result useful

A raw ADC number is most useful when you understand its endpoints. Note the readings at both ends of your potentiometer’s travel, then use those observed values to divide the control into a few broad settings, such as low, medium, and high. Avoid placing a boundary where a tiny movement or normal reading variation would repeatedly switch between settings. Testing the control by turning it slowly through each boundary will show whether your chosen ranges feel practical.

This small input circuit is a foundation for later projects, not a reason to connect a microcontroller pin directly to a motor, mains-powered device, or other substantial load. If you would like a change of subject after the build, browse Civic Ideas Journal. For a more focused detour into civic topics, explore Political Institutions · Civic Ideas Journal.

Back to category ↗