Arduino-Thermistor mf58-104f3950k

Source: Internet
Author: User

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 (+);  

}  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.