NTC thermistor/How far to trust it/12. When the reading is wrong
How far to trust it · 12 of 12

When the reading is wrong

Print the raw count first. Stuck at 0 is a missing VCC, stuck at the top is a missing GND, and a number that falls when it should rise is a formula written for the other divider. Then the few degrees that come from where the block sits.

Five symptoms

When the reading is wrong
What it does
SIGNAL is at 0 V, so the thermistor sees no supply: VCC is not connected, or the cable is one pin over. The formula then takes the log of zero and prints nonsense such as -273 °C. The sketches in this book catch it and say so instead.

Pick what the reading is doing. The ringed part of the board is where to look first, and the list beside it is the order to check in.

Start with the raw count

The sketch in the first reading prints the count and nothing else, and the count splits the faults in two. A count somewhere in the middle that falls when you touch the thermistor means the block and its wiring are fine, and anything wrong is in the arithmetic. A count stuck at either end is a wire.

Stuck at 0

SIGNAL is at 0 V: the divider has no supply. VCC is not connected, or the cable is one pin over. Count from the square pad: GND, VCC, NC, SIGNAL. A sketch that converts the count anyway takes the logarithm of zero and prints something like -273 °C.

Stuck at the top

SIGNAL is at VCC: the thermistor has nothing to pull against, because GND is not connected. If the block is powered from somewhere other than the board reading it, the two also need a GND wire between them.

Colder when warmed

The count falls when you touch it, as it should, but the temperature falls too. The resistance line is written for a board with the thermistor on top. On this block it is at the bottom, so the line is R = 10000 × n / (1023 − n).

A few degrees off

Look at where the block is before the sketch. Plugged straight into a board, it is measuring the board. Then, on an ESP32, the 3V3 rail: measure it and put it in VCC_MV. Then the constants: B = 3950 and 10 kΩ, from the part number. A B of 3435, copied from a sketch for another board, is right at 25 °C and several degrees out at the ends.

Jumps about

A count or two of flicker is normal, and averaging 32 readings removes it. Much more than that on a classic ESP32 is usually an ADC2 pin with Wi-Fi on: move SIGNAL to GPIO 34. Values anywhere at random mean SIGNAL is not reaching the pin, and the pin is reading nothing.

When it does not work

How can I test the block without any code?

With a multimeter. Power it, and measure between SIGNAL and GND: about half of VCC at room temperature, a little more if the room is cooler than 25 °C. Hold a finger on the thermistor and the voltage should fall over a few seconds.

Which ESP32 pins should SIGNAL avoid?

Any ADC2 pin, because the radio takes ADC2 while Wi-Fi is on, and any pin with no ADC at all. GPIO 34 on an ESP32 and GPIO 4 on an ESP32-S3 are ADC1 pins with no job at boot, which is why the book uses them.

It worked yesterday and reads nonsense today.

Look for a wire that has come out of the breadboard. The right-angle header pins lie flat, and a cable's weight can pull the block out of its row. A missing GND or VCC shows up at once in the raw count.

Two blocks side by side read a degree apart.

That is within what the parts allow: each thermistor and each fixed resistor is ±1 %. Calibrate each against the same thermometer, or against each other in the same still air, and correct one to match.

Where this goes next

The rest of the TinkerBlock family, one handbook each.

Back to the blocks

Edit this page — content/books/ntc-thermistor/when-the-reading-is-wrong.mdx

Community

Questions about this product

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

Ask a question ↗

NTC Thermistor

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