Arduino UNO Q - NTC Thermistor Temperature Sensor
Fish cannot send you a message when the aquarium heater dies in the middle of the night. A small steel probe can. Inside its tip sits an NTC thermistor, a tiny part whose resistance swings a lot as it gets warmer or colder. Drop it into a tank, a fridge or a fermenting bucket, and the Arduino UNO Q turns that resistance into degrees. The STM32 MCU does the measuring. The Linux side then hands the number to Python, or to your phone.
Here is the plan for this page:
- What is inside the waterproof probe, and why it comes with a 10K resistor
- How to wire the two probe wires and the resistor to 3.3V, A0 and GND
- How the MCU turns a 12-bit ADC reading into ohms, and the ohms into °C and °F
- How the sketch notices an unplugged or shorted probe instead of printing nonsense
- How Python on the Linux side asks the MCU for the temperature through Bridge
- How to build a Telegram aquarium guard that warns you below 22 °C and above 30 °C
- How to use OpenClaw on Arduino UNO Q with the NTC thermistor

Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
The DIYables kit holds five probes and five matching 10K resistors, so there is no extra resistor to buy.
Overview of the NTC Thermistor Temperature Sensor

The DIYables probe is a stainless-steel tube, 5 mm wide and 25 mm long, with a round tip. The thermistor is sealed inside it, so the tip can sit in water all day. A 0.5 m black cable with two wires runs from the tube to a white JST XH2.54 2-pin plug. There is no adapter board: male jumper wires push straight into the two openings of the plug.
| Item | Value |
|---|---|
| Thermistor | NTC, 10 kΩ at 25 °C, ±1% |
| B value (beta) | 3950 |
| Measuring range | -20 °C to 105 °C |
| Probe | stainless steel, waterproof, 5 mm x 25 mm, round tip |
| Cable | 0.5 m, two wires |
| Connector | JST XH2.54, 2 pins |
| Output | a resistance, read through a 10K divider on an analog pin |
| Dissipation constant | 5 mW/°C (typical) |
The plug has two openings and no labels. That is fine: a thermistor is a resistor, and a resistor has no plus or minus side.
- Wire 1 (either one): goes to the 3.3V pin of the Arduino UNO Q
- Wire 2 (the other one): goes to A0. One leg of the 10K resistor joins it there, and the other leg goes to GND
How it works. NTC is short for Negative Temperature Coefficient. In plain words: when the tip warms up, the thermistor's resistance drops, and when it cools down, the resistance rises. The MCU cannot measure ohms, only volts. So the 10K resistor and the thermistor form a voltage divider, and the voltage in the middle tells the MCU how many ohms the thermistor has right now. The sketch then turns those ohms into degrees. A few points on the curve of this probe:
| Temperature | Thermistor | Voltage on A0 | ADC value (12-bit) |
|---|---|---|---|
| 0 °C | 33,621 Ω | 0.76V | 939 |
| 15 °C | 15,837 Ω | 1.28V | 1585 |
| 25 °C | 10,000 Ω | 1.65V | 2048 |
| 40 °C | 5,301 Ω | 2.16V | 2676 |
| 70 °C | 1,760 Ω | 2.81V | 3482 |
From ohms to degrees. The sketches use the B-parameter equation: 1/T = 1/T0 + (1/B) × ln(R/R0). Here T0 = 298.15 K (that is 25 °C), R0 = 10000 Ω and B = 3950. The result T is in kelvin, so °C = T − 273.15. Fussy projects can switch to the Steinhart-Hart equation, which describes the curve with three coefficients (see the Advanced challenge below). For an aquarium or a fridge, one B value is all you need: around room temperature the UNO Q lands within roughly 1 °C, with the 10K resistor and the STM32 ADC as the main error sources.
The UNO Q side of the math. The STM32 MCU reads A0 with a 12-bit ADC against 3.3V, so analogRead() gives 0 to 4095. The divider is fed from that same 3.3V. The exact supply voltage therefore drops out of the math, and the thermistor resistance is simply R = 10000 × (4095 / raw − 1).
Other temperature options. Want a digital waterproof probe with no resistor math? See Arduino UNO Q - Temperature Sensor with the DS18B20. For an oven or anything hotter than 105 °C, use Arduino UNO Q - MAX6675 Thermocouple Module.
Wiring Diagram
Three things meet at A0: one probe wire, one leg of the 10K resistor and the jumper wire from the board. The second probe wire goes to 3.3V, and the second resistor leg goes to GND. A small breadboard makes that A0 junction easy. No breadboard? Twist the resistor leg around the jumper wire, or solder it and cover it with heat-shrink tubing.

This image is created using Fritzing. Click to enlarge image
| Thermistor Circuit | Arduino UNO Q Pin |
|---|---|
| One probe wire (either) | 3.3V |
| Other probe wire | A0 |
| 10K resistor, first leg | A0 |
| 10K resistor, second leg | GND |
Pushing jumper wires into the headers is quick, but the wires can slip out. The Arduino UNO Q works with both the Proto Screw Terminal Block Shield and the Screw Shield V2. Both turn the header pins into screw terminals. Below is the wiring diagram with the Screw Shield V2.

This image is created using Fritzing. Click to enlarge image
With the shield, the resistor can skip the jumper wires too: put one leg in a GND screw terminal and the other in the A0 terminal next to the probe wire. One screw terminal holds two wires.
※ NOTE THAT:
⚠️ Feed the probe from 3.3V, never from 5V. When the tip gets hot, the thermistor's resistance falls and A0 climbs toward the supply. With 3.3V on top, A0 can never pass 3.3V. With 5V on top, it could. On the Arduino UNO Q this matters twice: the ADC tops out at 3.3V, and A0 and A1 are the two pins that are not 5V tolerant, so 5V there can damage the MCU.
Only the steel tip is waterproof. Keep the white plug, the resistor and the A0 junction dry and out of the water.
A0 is only an example. Any analog pin from A0 to A5 works the same way. If you move the wire, change NTC_PIN in the sketches.
How To Program For NTC Thermistor
No library is needed. The work is one analogRead() and a little math:
- Switch the ADC to 12 bits, once, in setup():
- Read A0 ten times and average, since a single sample can jump a few steps:
- Check the probe before you do any math. A value near 0 means no thermistor, because the 10K resistor pulls A0 down to GND. A value near 4095 means a short or a wrong wire:
- Turn the reading into the thermistor resistance:
- Apply the B formula to get kelvin, then °C and °F. In Arduino code, log() is the natural logarithm:
Arduino UNO Q Code
A quick map of the two processors before you upload anything:
- A0 belongs to the STM32 MCU, so the thermistor is read and converted there
- The Qualcomm MPU with Debian Linux sits idle for now. It joins in the Bridge section
- The sketch prints the ADC value, the thermistor resistance, °C and °F about once per second
Detailed Instructions
First time with the Arduino UNO Q? Set up Arduino App Lab with Getting Started with Arduino UNO Q first.
- Wire it: One probe wire to 3.3V, the other to A0, and the 10K resistor from A0 to GND, as in the diagram.
- Plug in: Connect the Arduino UNO Q to your computer with the USB-C cable.
- Open App Lab: Start Arduino App Lab and wait until it finds the board.
- Create an App: Click Create New App.

- Name it NtcThermistor and click Create.

- Paste: Open sketch/sketch.ino, delete what is in it and paste the code above. Nothing else needs to change.
- Run: Click the Run button.

- Ice test: Let a few lines go by at room temperature. Then put the steel tip into a glass of water with lots of ice, stir a little, and wait about half a minute.
App Lab Console Output
The first three lines come from the desk. Once the tip is in the ice water, the resistance climbs and the temperature falls: fast at first, then slower as the steel catches up. Ice water is 0 °C, and the probe settles just under 1 °C above it. That is the "about 1 °C" from above. If you see No thermistor found instead, a jumper wire has come out of the plug.
Bridge: Linux + MCU
The thermistor only reports. It never takes orders, so the data goes one way: up from the MCU to Linux.
- The MCU measures once per second. It averages ten samples of A0, does the math and keeps the latest result
- Four read-only values are offered with Bridge.provide():
- get_temp_c — the temperature in °C, like 25.30
- get_temp_f — the same in °F, like 77.53
- get_ntc_ohms — the thermistor resistance, like 9869
- get_probe_status — OK, OPEN (no thermistor) or SHORT
- Python checks the status first. Then it reads the temperature every 2 seconds and keeps the lowest and highest value since the App started
- No waiting: the MCU hands back numbers it already has, so a Bridge call never waits for the ADC
- ⚠️ /dev/ttyHS1 (Linux) and Serial1 (MCU) are RESERVED by the router. Never open them in your code
In short: the water warms the tip → the MCU reads A0 and does the math → Python calls get_temp_c → Linux knows the temperature.
MCU Code (Bridge)
Python Code (Bridge)
Detailed Instructions
- New App: In Arduino App Lab, click Create New App and name it NtcThermistorBridge.
- MCU part: Paste the MCU code into sketch/sketch.ino and add the Bridge library:
- Install the library: Click the Add sketch library button (the open book icon with a + sign) in the left sidebar.

- Search for Arduino_RouterBridge created by Arduino and click the Install button.
- Linux part: Paste the Python code into the Python file of the same App.
- Run: Click the Run button.
- Into the tank: Start with the probe in the room air, then lower the tip into your aquarium (a bowl of lukewarm water works too) and watch the Python console.
App Lab Console Output
The low value keeps the room reading, while the high value follows the water up. Look at the last three lines: the steps get small because the steel tip needs a little time to reach the water temperature. Give it 20 to 30 seconds before you trust a new reading.
Telegram
Most tropical fish are happy between about 24 °C and 28 °C. Below 22 °C or above 30 °C they get stressed. A heater that fails at night, or a hot summer afternoon, can push the tank out of that range long before anyone looks. So hang the probe inside the tank, keep the plug and the resistor outside and dry, and let the UNO Q watch the water. The bot answers /temp at any time and messages you by itself when the water leaves the safe range.
| Command | What it does |
|---|---|
| /temp | water temperature now, in °C and °F |
| /range | the safe range the bot uses |
| /start | turn on water alerts for this chat |
| /stop | turn off water alerts for this chat |
How the alerts work:
- Only chats that sent /start get them, so the script needs no chat ID
- The bot writes only when the water changes state: OK to TOO COLD, OK to TOO HOT, back to OK, or a probe problem. While the water stays cold, it does not repeat itself every second
- "Back to normal" waits until the water is 0.5 °C inside the range again (22.5 °C or 29.5 °C). Without that gap, water sitting right at 22.0 °C would send a new message on every small wobble
- Keep other fish? Change TOO_COLD_C, TOO_HOT_C or HYSTERESIS_C at the top of the script. Goldfish, for example, like cooler water
MCU sketch: Keep the MCU sketch from the Bridge section. It needs no change.
Python Code (Telegram)
Detailed Instructions
- Token: Make a bot with @BotFather and paste its token into TELEGRAM_BOT_TOKEN. Never done this? Follow How to Create a Telegram Bot.
- Swap the script: Open the NtcThermistorBridge App and replace its Python code with the bot script. The sketch stays as it is.
- Run: Click the Run button.
- Subscribe: In Telegram, open your bot and send /start, then /temp.
- Test the alert: Without fish, a cup of cold tap water is enough. Move the probe from warm water into the cold cup and wait for the message.
- Keep in mind: The /start list lives in memory only. Send /start again after you restart the App.
App Lab Console Output
ArduinoBot
The heater stopped a little after midnight, and the water fell below 22 °C at 03:12. One alert went out. Over the next five hours the bot stayed quiet, even though the water kept cooling. The heater was fixed in the morning, and the all-clear came only when the water reached 22.5 °C.
OpenClaw
You can adapt the OpenClaw to this tutorial by refering the instruction on Arduino Uno Q - OpenClaw Tutorial
Project Ideas
A waterproof probe that costs very little fits many places:
- Fridge Door Watch: Put the probe inside the fridge. If the inside climbs above 8 °C for ten minutes, the door is probably open, and Telegram tells you.
- Home Brew Log: Python on Linux saves the fermenter temperature to a CSV file every minute, from the first day to bottling, and plots the curve.
- Hot Water Ready: Tape the probe to the outlet pipe of a water heater. Linux sends a message when the water is hot enough for a shower. Keep it under 105 °C.
- Seed Tray Heater: Push the probe into the soil. The MCU switches a heat mat through a relay to keep the seeds near 24 °C.
- Inside vs Outside: Add a second probe with its own 10K resistor on A2. A small web page from the Linux side shows both temperatures side by side.
Challenge Yourself
Ready for more?
- Easy: Print only one decimal, and add up or down at the end of each line to show which way the temperature moved since the last reading.
- Medium: Add a Bridge value get_trend that returns how many °C the temperature changed in the last minute. Give the Telegram bot a /trend command that reads it.
- Advanced: Calibrate your own probe with the Steinhart-Hart equation. Measure it in ice water (0 °C), at room temperature next to a good thermometer, and in hot water. Work out the three coefficients and compare the result with the B formula.