Physics · Courses in this subjectExpandCollapse

How a knob becomes brightness: potentiometers, ADC, and PWM

PhysicsSuggested ages: 12–16

For the same dimming task, why does a knob circuit measure voltage first and then rapidly switch an LED?

Turn a 10 kΩ potentiometer and trace the voltage divider, 10-bit ADC reading, 8-bit PWM command, and LED’s average output.

Learning goals

  • Recognise a three-terminal potentiometer as an adjustable voltage divider, not merely a two-terminal variable resistor.
  • Use Vw = Vs×x to connect knob position x, output voltage, and a 10-bit ADC reading from 0 to 1023.
  • Distinguish a PWM command from actual duty cycle and use averages to explain an LED’s brightness change.

Before you begin

  • Know that voltage is a potential difference and read the units V, Ω, and mA.
  • Interpret a fraction or percentage as a part of a whole.

Turn a knob. Follow the signal.

5 V GND 10 kΩ ControllerA0PWM 330 Ω PotentiometerLEDDivide → quantise → modulate

The wiper feeds a high-impedance input. A separate output drives the LED.

A linear 10 kΩ potentiometer is split into two sections. Moving the wiper toward 5 V raises its voltage; total resistance stays fixed.

PWM output: three periods
5 V0 VTime → (periods illustrated)

The dashed line marks the mean voltage over a period. The high level remains 5 V.

Wiper voltage
2.50 V
10-bit ADC
512 / 1023
8-bit PWM code
128 / 255
Actual duty cycle
50.2%
Upper / lower resistance
5.0 / 5.0 kΩ
Mean LED current
4.56 mA

Dots illustrate voltage-reading and output-control paths. They do not represent current, electron speed, or current drawn by the analog input.

One quick model check

1A 10 kΩ potentiometer is connected between 5 V and 0 V. The wiper is at midpoint and the ADC does not load the divider. What is the wiper voltage?

Observe, then explain

Work through four steps. Each button moves the interactive model to the matching observation state.

  1. The model connects the pot’s ends to 5 V and 0 V; the moving middle terminal is the wiper. Knob position x is measured from the grounded end: x = 0 gives 0 V and x = 1 gives 5 V. The fixed 10 kΩ total is split into Rhigh = (1−x)×10 kΩ and Rlow = x×10 kΩ.

    Look for: Set the knob to 0% and 100%. Check which resistance segment becomes 0 Ω and how the wiper voltage changes.

  2. A controller cannot store a continuous voltage directly. This lesson uses a 10-bit ADC: 0 V maps to 0 and nearly 5 V maps to 1023. At x = 0.25, Vw = 1.25 V and the reading is floor(1.25/5×1024) = 256; at x = 0.5 it is 512.

    Look for: Choose Quarter and verify 256 from the voltage; then try Midpoint and verify 512.

  3. Here the 0–1023 ADC reading is integer-divided by 4 to make a 0–255 PWM command. Midpoint 512 becomes 128. A value of 255 does not mean “255 V”; it means a constant high output (100% duty) in this model.

    Look for: Hold the knob at Midpoint. Compare “PWM command 128” with “actual duty 128/255”: their different units and meanings.

  4. Turning off this experiment’s output switch sets actual PWM duty, mean output voltage, and average LED current to 0. The knob voltage, ADC, and calculated PWM command remain visible. The program knows what it would output, but is explicitly prevented from driving the LED.

    Look for: At Midpoint, turn output off and then on. Identify which values stay fixed and which return from 0.

Build an explanation

A divider does not “use up” voltage

With no load, the ideal wiper voltage is set by the lower resistance fraction: Vw = Vs·Rlow/(Rhigh+Rlow)=Vs·x. Voltage is a difference between points; changing position along the resistive track makes midpoint voltage half the supply.

Ten bits does not mean “1024 volts”

Ten binary bits encode 2¹⁰ = 1024 integers, from 0 to 1023. They split this model’s 0–5 V input range into small intervals, so nearby voltages can receive the same integer. The model shows floor(input fraction×1024) and caps full scale at 1023.

PWM adjusts a time fraction

A PWM pin rapidly switches between off and one fixed voltage. Duty cycle D is the fraction of time it is on; ideal average voltage is approximately Vs×D. LED current during each on portion is mainly set by the resistor and forward drop, then average current is multiplied by D. Human brightness perception also depends on nonlinear response, frequency, and surroundings.

Why the model states its assumptions

This model assumes the ADC input takes no significant wiper current, so it does not load the divider; the pot is exactly 10 kΩ, supply is a stable 5 V, LED forward drop is fixed at 2 V, and the resistor is 330 Ω. Real parts have tolerances, ADC error, pin-current limits, contact noise, and heating. Check the actual component datasheet before wiring.

Printable worksheet

Understand the concept here, then work independently on the A4 sheets. Practice, calculations and investigation records are included together. Reference answers open only in the parent dialog.

Physics

How a knob becomes brightness: potentiometers, ADC, and PWM

Name: __________________Date: __________________
Lesson model reference (schematic, not to scale)

For the same dimming task, why does a knob circuit measure voltage first and then rapidly switch an LED?

  1. A 10 kΩ potentiometer is connected between 5 V and 0 V. The wiper is at midpoint and the ADC does not load the divider. What is the wiper voltage?

    A. 0 V B. 2.5 V C. 5 V

  2. This lesson’s 10-bit ADC uses floor(Vw/5×1024). At quarter position, which pair is correct?

    A. 1.25 V, 256 B. 2.50 V, 256 C. 1.25 V, 1023

  3. An ADC reading of 512 becomes PWM command 128. With output enabled, what is the closest actual duty cycle in this model?

    A. About 0% B. About 50% C. About 100%

  4. After turning the experiment’s output switch off at quarter position, which statement is correct?

    A. ADC and PWM command also become 0 B. ADC/PWM command remain; actual duty and average LED output become 0 C. Wiper voltage rises to 5 V