rotary potentiometer/Using the number/10. When the reading is wrong
Using the number · 10 of 10

When the reading is wrong

A wrong reading is almost always one of six things, and three of them are a wire. Stuck at 0 is VCC, stuck at full scale is GND, random is SIGNAL. The other three are the board and the ADC working as built: the LED's bend, the ESP32's ceiling, and a knob that counts the other way.

Six symptoms

What the reading is telling you
What you see
Check
nothing: the LED
Cause
the LED loading the wiper
This is the board working as built: once the red LED lights it pulls the wiper down, by up to about 1.3 V on 5 V in the model and about 0.46 V on 3.3 V, so the upper part of the turn crawls and the last few degrees jump. Calibrate with the five-mark table; on an Uno, running VCC from 3V3 also shrinks it, if the smaller range will do.

Look at the red LED first. Turn the knob fully up: it should be plainly lit, a little dimmer on a 3.3 V board than on a 5 V one. If it lights, VCC and GND are connected and the track is working, and the fault is between SIGNAL and your sketch. If it stays dark, the block is not powered, and no code will help.

Three wires

Stuck at 0. VCC is missing, so the whole track sits at 0 V. The LED never lights.

Stuck at full scale. GND is missing. Nothing pulls the bottom of the track down, so the wiper sits at VCC wherever it is. The LED does not light either, because it returns to GND too.

Random numbers. SIGNAL is not reaching the pin. An analog input with nothing on it keeps whatever charge it last had and picks up more from nearby wires and your hand. Check the wire, then check the pin: the book's sketches read A0 on an Uno, GPIO 34 on an ESP32, GPIO 4 on an ESP32-S3 and GP26 on a Pico.

On a classic ESP32, a knob that works until Wi-Fi starts and then reads nonsense is on an ADC2 pin. Move it to an ADC1 pin, as GPIO 34 is.

Three that are not faults

The upper half barely moves, then jumps. This is the LED loading the wiper, most of all on 5 V, described in why the top of the turn bends. Calibrate; on an Uno, running VCC from 3V3 also shrinks it.

The top few degrees all read 4095. On an ESP32 or ESP32-S3 the ADC stops at roughly 3.1 V. The block is fine.

Turning clockwise makes the number fall. Which way is up depends on which end of the track is VCC. Turn the number round in the sketch, full scale minus the reading, rather than swapping wires: the LED returns to the pin printed GND, and with the supply on that pin it is reversed and never lights.

When it does not work

The reading is stuck at 0 and the LED never lights.

The track has no supply. Check the VCC wire and that it goes to your board's 3V3 or 5V pin, not a GPIO. If VCC is right, check that SIGNAL goes to the pin the sketch reads.

The reading is stuck at full scale.

The bottom of the track is not grounded, so the wiper sits at VCC wherever it is. Check the GND wire, and that the cable is not one pin over: count from the square pad.

The numbers drift and change when I move my hand.

The analog pin is floating: the SIGNAL wire is not reaching the pin the sketch reads. Check the wire, then the pin: on the classic ESP32 it is GPIO 34 in these sketches, and on the Uno it is A0.

The block gets warm.

It should not: the track draws about half a milliamp and the LED about 3 mA at most. Warmth means a supply is on SIGNAL. Turned towards the GND end, the wiper then joins that supply to GND through almost no track. Unplug it at once and check the wiring against the square pad.

Where this goes next

Every block in the kit, each with its own handbook.

All the TinkerBlock blocks

Edit this page — content/books/rotary-potentiometer/when-the-reading-is-wrong.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