Thermistor Connection method:
Resistance:
/
* * thermistor model is NTC glass-sealed thermal resistor mf58-104f 3950K interpolation 100K accuracy 1% b value 3950
* Room temperature 25 degrees Celsius (298.15K) resistance is 100k euro
*/
#include < math.h>
const float voltagepower=5;
Const FLOAT rs=100;//Sample resistor is 100,000 kohm
const int b=3950;
Const double t1=273.15+25;//room temperature
const double r1=100;//room temperature corresponding resistance, note Unit is the thousand Euro
Void Setup () {
serial.begin (9600);
}
void Loop () {
//Get the voltage value at A0
double digitalvalue=analogread (0);
Double voltagevalue= (digitalvalue/1023);
Serial.print ("Current voltage value=");
Serial.println (voltagevalue);
The resistance of the thermistor to
double rt= ((voltagepower-voltagevalue) *rs)/voltagevalue is obtained by the voltage divider ratio;
Serial.print ("Current Registor value=");
Serial.println (Rt);
The temperature value of
serial.print ("Current temperature value=") is calculated.
Serial.println (((t1*b)/(B+t1*log (RT/R1)) -273.15);//
serial.println ();
Delay (+);
}