Thermistor

A thermistor is a type of resistor whose resistance varies with temperature. In this project, thermistor values are read in through an 'Analog In' pin. The values are then used to control the blinking rate of an LED.

Use a 10k NTC Thermistor. Connect one pin to power (5V) and the other pin to analog pin 2 and to a 1kΩ pull-down resistor.

By omer
Created on March 23, 2009, 10:10

Category: Analog

Difficulty: kids

License:  Creative Commons Attribution-Share Alike 3.0 Unported License

Tags: analog, input, thermistor

Images

Files

Links

Comments

  1. targajens # June 5, 2011, 5:18 p.m.

    alternativ wenn man einfach nur die Temperatur mit dem NTC anzeigen will dann.... #include <math.h> //Anschluss: // [GND MASSE] ---- [1k-Widerstand]----|------ [NTC] ---- [+5v] // | // Analog Pin 0 double Thermistor(int RawADC) { long Resistance; double Temp; // Dual-Purpose variable to save space. Resistance=((10240000/RawADC) - 1000); // Assuming a 1k Thermistor. Calculation is actually: Resistance = (1024 * BalanceResistor/ADC) - BalanceResistor Temp = log(Resistance); // Saving the Log(resistance) so not to calculate it 4 times later. // "Temp" means "Temporary" on this line. Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp)); // Now it means both "Temporary" and "Temperature" Temp = Temp - 273.15; // Convert Kelvin to Celsius // Now it only means "Temperature" return Temp; // Return the Temperature } void printDouble(double val, byte precision) { Serial.print (int(val)); //prints the int part } void setup() { // Erststart und Initialisierung Serial.begin(9600); // Serielle Ausgabe wird zugewiesen } #define ThermistorPIN 0 // Heißleiter NTC klemmt auf Analog Pin 0 double temp; void loop() { // Programmstart temp=Thermistor(analogRead(ThermistorPIN)); // liest ADC und konvertiert dies zu Grad Celsius Serial.print("Celsius: "); printDouble(temp,0); // Celsiusanzeige Serial.println(""); // Linienende delay(5000); // kleine verzögerung }

Login to post a comment...
  • Print this
© 2007 - 2011 University of Applied Sciences Potsdam