Fast-Forward
Connecting the scales.
What we know — potentiometer
A potentiometer lets us change its output voltage manually, by rotating it.
From “zero” to “full,” we can describe its position as a percentage.
We can also describe that rotation as an angle.
- 0° → 0% → no output voltage.
- 90° → 50% → half the supply voltage.
- 180° → 100% → full supply voltage.
Our example: a linear potentiometer with 180° travel, connected between GND and 5V, with an unloaded output.
What we know — PWM
PWM controls the percentage of time the output is ON.
Arduino expresses that setting as a number from 0 to 255.
- 0 → always OFF → LED off.
- 128 → ON about half the time → LED dimmer.
- 255 → always ON → LED fully bright.
Half the ON time does not necessarily look half as bright.
Put the scales together
For our 5V example:
| Percentage | Pot angle | Pot output | PWM setting |
|---|---|---|---|
| 0% | 0° | 0V | 0 |
| 50% | 90° | 2.5V | ≈128 |
| 100% | 180° | 5V | 255 |
This table connects familiar scales. The servo’s actual command uses pulse duration — we’ll connect that next.
Different scales. The same fraction.
We can translate between them.