rotary potentiometer/The light on the wiper/05. The light on the wiper
The light on the wiper · 05 of 10

The light on the wiper

A red LED and a 1 kΩ resistor run from the wiper to GND, so the LED brightens as you turn up. It stays dark until the wiper passes about 2.0 V: about two-fifths of the way round on 5 V, and about three-fifths on 3.3 V, where it ends a little dimmer.

A branch off the wiper

The net list has a line the plain potentiometer does not need: the wiper also goes to R3, 1 kΩ, and from R3 to the anode of LED1, a small red LED whose cathode is on GND. So the LED sees whatever the wiper sees, and glows accordingly. It is a level meter with one light.

The light on the wiper
VCC
Knob90 %
SIGNAL
3.32 V
LED current
about 1.32 mA
Lights from about
40 %
The LED is lit and takes about 1.32 mA. That current comes from VCC, down through the part of the track above the wiper, and out through the LED. On 5 V the LED is a clear level indicator, up to about 3.0 mA at the end of the turn.

When it lights

An LED passes almost no current until the voltage across it reaches its forward voltage. The LED on the boards is red. The BOM still names a green part, KENTO's KT-0805G, and the red part's own number is not recorded, so this book works with a typical red 0805: about 2.0 V, anywhere from 1.8 to 2.2 V from part to part.

Below that the LED is dark and takes nothing. Above it, whatever voltage is left over sits across the 1 kΩ resistor and sets the current, the same arithmetic as the XL LED's resistor.

On 5 V the wiper passes 2.0 V about two-fifths of the way round, and at the end of the turn the LED gets about (5 − 2.0) ÷ 1 kΩ, roughly 3.0 mA: clearly lit. On 3.3 V it starts about three-fifths of the way round, and at the end gets about (3.3 − 2.0) ÷ 1 kΩ, roughly 1.3 mA: a little dimmer.

These numbers are worked out from a typical red LED rather than measured, and the forward voltage differs a little from LED to LED. Your LED may start a few degrees earlier or later.

Where its current comes from

The analog pin supplies nothing: it only measures. So the LED's current has to come from VCC, and the only way from VCC to the wiper is down the part of the track above it. Pick 5V in the figure and turn past about 40 %, and the dashes show it: through the upper track, out of the wiper, through the LED to GND.

That extra current through the upper track is the whole of the next article. A resistor carrying more current drops more voltage, so the wiper ends up lower than the plain divider says it should.

When it does not work

The LED never lights on my ESP32.

Turn all the way up. From 3.3 V it only starts about three-fifths of the way round and reaches about 1.3 mA at the end, a little dimmer than on an Uno but plainly lit. If it stays dark at the end of the turn, check VCC and GND. If the reading changes as you turn, SIGNAL is fine.

The LED is already glowing at halfway on my Uno. Is that right?

Yes. Halfway is 2.5 V, and a red LED needs only about 2.0 V before it conducts. It comes on about two-fifths of the way round, is faint at halfway, and brightens to about 3.0 mA at the end of the turn.

Can I turn the LED off?

Not from code. It is wired to the wiper, so it lights whenever the wiper is high enough, whatever the sketch does. Removing R3 or the LED with a soldering iron takes it out of the circuit, and the reading then follows the plain divider.

Is the LED's current coming out of my analog pin?

No. An analog input only measures; it supplies nothing. The LED's current comes from the block's VCC pin, down through the track, and out of the wiper into the LED. That is exactly why it changes the reading.

Where this goes next

What the LED's current does to the voltage you are measuring.

Why the top of the turn bends

Edit this page — content/books/rotary-potentiometer/the-light-on-the-wiper.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

Rotary Potentiometer

Loading discussions…

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum