NTC thermometer on an Arduino Uno
The NTC temperature sensor module on A0, worked out in degrees with the beta equation every tutorial for it uses. The whole build, an Arduino Uno and 1 more part, runs here in your browser on the firmware below; open it in the editor to change the wiring or the code and run it again.
Teaching? Assign it to your class in one click.
Beginner Runs in your browser. Free, and no account needed.
The parts retail for about $31. On Mokxi they're free.
The code
The firmware exactly as the editor opens it. Change a line there and press Run: it compiles in the browser.
// NTC thermometer: the NTC temperature sensor module on A0, worked out in
// degrees with the beta equation every tutorial for this module uses.
//
// module VCC -> 5 V GND -> GND OUT -> A0
//
// The module is a 10 k thermistor under a 10 k resistor: at 25 C the two are
// equal and OUT is half the supply, and as the thermistor warms its
// resistance falls, so OUT falls too. The formula turns the reading back into
// the thermistor's resistance over 10 k, and the beta equation turns that
// into a temperature.
//
// Drag the temperature slider on the module.
const float BETA = 3950;
void setup() {
Serial.begin(9600);
Serial.println("NTC thermometer");
}
void loop() {
int analogValue = analogRead(A0);
float celsius = 1 / (log(1 / (1023. / analogValue - 1)) / BETA + 1.0 / 298.15) - 273.15;
Serial.print("reading ");
Serial.print(analogValue);
Serial.print(", temperature ");
Serial.print(celsius, 1);
Serial.println(" C");
delay(500);
}
Parts list
3 parts, plus the jumper wires. They retail for about $31; on Mokxi they're free.
- 1 × Arduino Uno R3
- 1 × Half breadboard
- 1 × NTC temperature sensor module
How it is wired
3 connections, pin by pin, read from the circuit itself. Each line is one set of pins joined together, by a jumper wire or a breadboard strip.
- Arduino Uno R3 pin 5V; NTC temperature sensor module pin VCC
- Ground: Arduino Uno R3 pin GND; NTC temperature sensor module pin GND
- Arduino Uno R3 pin A0; NTC temperature sensor module pin OUT
Change it and keep it
Open it in the editor, change the circuit or the code, and keep your version in a free account.