disc potentiometer/Reading it/03. VCC sets the top
Reading it · 03 of 9

VCC sets the top

At one stop the wiper sits on the VCC end of the track, so SIGNAL is whatever VCC is. That makes VCC the top of the range and the most your analog pin will ever see: 3V3 beside an ESP32, an ESP32-S3 or a Pico, 5V beside an Uno.

The stop is VCC

The track runs from GND to VCC with nothing else in the way. Turn the wheel to the VCC stop and the wiper is sitting on VCC, so SIGNAL carries it straight to your pin. Whatever you connect VCC to is the highest voltage SIGNAL will ever reach.

That makes the choice of supply pin a choice about your analog pin, not about the block. The block has no chip on it, only the pot, and 3.3 V and 5 V are both fine for it.

VCC sets the top
Your board
The block's VCC pin goes to
SIGNAL at the stop
3.30 V
Reads at the stop
4095
VCC should go to
3V3
SIGNAL runs from 0 to 3.3 V, inside the pin's rating. The ESP32-S3's ADC reads full scale at about 3.1 V with the default settings, so roughly the last 6 % of the travel all reads 4095. That is the wiring; the flat stretch is the ADC, not the block.

3V3 beside a 3.3 V board

An ESP32, an ESP32-S3 and a Raspberry Pi Pico run their pins at 3.3 V. With VCC on their 3V3 pin, SIGNAL runs from 0 V to 3.3 V, which is inside every pin's rating and close to the range their ADCs measure.

Pick 5V in the figure with one of them. From about two-thirds of the way round, SIGNAL is past 3.3 V. The reading sits at full scale, so it looks like a pot that stopped working early, and every turn into that stretch pushes the pin past its rating.

5V beside an Uno

The Uno runs at 5 V, and its ADC measures against its own 5 V supply by default. With VCC on 5V, the two stops read 0 and 1023 and every part of the travel counts.

3V3 works on an Uno but wastes a third of the range: the stop reads about 675. It also ties the reading to two supplies instead of one, which what the number means explains.

Nothing on VCC

Leave VCC unconnected and the track has only a bottom. The wiper reaches GND through it wherever the wheel is, so SIGNAL is 0 V and every reading is 0. Nothing is broken; one wire is missing.

The same rule, VCC is what your pin gets, applies to the TK04 push button. VCC sets the voltage is that book's version.

When it does not work

Can I power it from 5V next to an ESP32?

No. From about two-thirds of the way round, SIGNAL is above 3.3 V and your pin is past its rating. It will seem to work, reading full scale, which is the problem. Connect VCC to 3V3. The block works just as well from it.

Will it work on an Uno from 3V3?

Yes, but the stop only reaches about 675 of 1023, so a third of the range is never used. The reading also stops being a pure ratio, because the block's supply and the ADC's reference are now two different voltages. Use the Uno's 5V pin.

I left VCC unconnected and it always reads 0.

That is what should happen. With nothing on VCC the track has no top: the wiper reaches GND through the track whichever way the wheel is turned, so SIGNAL sits at 0 V. Connect VCC and it works.

Why does the ESP32 read 4095 before the wheel reaches the stop?

With the Arduino core's default settings the ESP32's ADC reads full scale at roughly 3.1 V, a little under the 3.3 V at the stop, so the last few percent of travel all read 4095. That is the ADC, not the block. The article on the ends has the whole picture.

Where this goes next

Three wires and a sketch that prints the number.

The first read

Edit this page — content/books/disc-potentiometer/vcc-sets-the-top.mdx

Community

Questions about this product

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

Ask a question ↗

Disc 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