How a potentiometer works: a dimmer without code

Look inside a potentiometer, the knob with three legs, and use it as a resistor you can turn to build an LED dimmer, with no program needed.
  • Level:Beginner
  • Duration: 30 min
  • Ages 8+
  • Platform: Arduino
How a potentiometer works: a dimmer without code – EEMENTOR STEM™ lesson

Volume knobs, light dimmers and joysticks all use the same part: a potentiometer, or "pot" for short. It's a resistor with a sliding contact that you move by turning the knob. In this lesson you find out how its three legs work and build a dimmer that changes an LED from bright to almost off.

What you'll learn

  • What is inside a potentiometer
  • What the three legs do
  • How a potentiometer works as a variable resistor
  • Why you still need a fixed resistor in series with it

What you need

  • UNO R3 board and USB cable (UNO R3 Starter Kit)
  • 1 potentiometer, 10 kΩ
  • 1 red LED
  • 1 resistor, 220 Ω
  • Breadboard and jumper wires (UNO R3 Starter Kit)

Inside a potentiometer

Inside a potentiometer: resistive track, wiper and three legs

Inside the pot is a curved strip of resistive material, 10 kΩ from end to end. The two outer legs are connected to the two ends of the strip. The middle leg, called the wiper, is connected to a small contact that slides along the strip when you turn the knob.

  • Between the two outer legs: always 10 kΩ.
  • Between one outer leg and the wiper: anything from 0 Ω to 10 kΩ, depending on the knob.
  • The two parts always add up to 10 kΩ.

Using one outer leg and the wiper turns the pot into a variable resistor: a resistor you can adjust by hand.

Wiring

Breadboard wiring diagram: How a potentiometer works: a dimmer without code
Breadboard view. Check each connection against the wiring table below.
From To
UNO 5V Bottom + rail (red wire)
UNO GND Bottom − rail (black wire)
Potentiometer Legs in columns 20, 21 and 22, row f, knob facing you
+ rail Column 20, row j (left leg)
Resistor 220 Ω Column 21 (row h, the wiper) to column 25 (row h)
LED long leg (+) Column 25, row f
LED short leg (−) Column 26, row f
Column 26, row j − rail

The right leg of the pot (column 22) stays unconnected in this circuit.

Try it

  1. Plug in the USB cable and turn the knob slowly from one end to the other. The LED goes from bright to very dim.
  2. At one end, the pot adds 0 Ω, so only the 220 Ω resistor limits the current: about 13.6 mA. At the other end, it adds 10 kΩ: 3 V ÷ 10,220 Ω = about 0.3 mA.
  3. Move the red wire from column 20 to column 22 (the other outer leg). Now the knob works the other way round.

Why the extra resistor?

When the knob is at the 0 Ω end, the pot adds no resistance at all. Without the 220 Ω resistor, the LED would then be connected straight to 5 V and burn out. The fixed resistor makes sure there is always enough resistance, wherever the knob is.

The pot as a voltage divider

Connect both outer legs, one to 5V and one to GND, and the wiper gives any voltage between 0 and 5 V, depending on the knob. This is how the UNO reads a knob: in Arduino basics you connect the wiper to an analog pin and the program sees a number from 0 to 1023.

Try this next

  • Use the pot to dim two LEDs in parallel, each with its own 220 Ω resistor after the wiper.
  • Add a push button from the previous lesson in front of the pot: the button switches the light on, and the knob sets its brightness.
  • Look at the potentiometer lesson in Arduino basics to see the same knob read by a program.

Troubleshooting

  • Nothing lights up: check that the USB cable is plugged in (the UNO's ON LED is lit), that the long leg of the LED goes to the + side, and that every wire sits in the column the table says. Wiggle each wire gently; a wire that isn't pushed all the way in is the most common fault.
  • The knob does nothing: the wire or resistor may be on the right leg instead of the wiper. The resistor must start in column 21, the middle leg.
  • The LED only changes near one end of the knob: that's normal. Our eyes notice changes in dim light much more than in bright light.

Build it yourself

Everything used in this lesson comes in one kit, with parts tested by our engineers.

UNO R3 Starter Kit | Arduino IDE Compatible | Free Tutorials $56.00

Shop the kit