How to Connect Thermistor NTC 3950 to Arduino ?
by InventionsLab in Circuits > Arduino
3188 Views, 2 Favorites, 0 Comments
How to Connect Thermistor NTC 3950 to Arduino ?
How To Connect Thermistor NTC 3950 To Arduino ?
Today we are going to look at how to connect an NTC 3950 thermistor for Edner (which is used for 3D printers) to the Arduino and check the current temperature. Simple and quick instructions on how to do it.
#include <LiquidCrystal_I2C.h>
float current;
int termPin = 0; // The analog pin to which the thermistor is connected is A0
int termNom = 100000; // Thermistor reference resistance
int refTemp = 25; // Temperature for reference resistance
int beta = 3950; // Beta factor
int resistance = 100000; // value of resistance in series in the circuit
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
Serial.begin(9600);
analogReference(EXTERNAL);
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.display();
}
void loop() {
//measuring the voltage on the thermistor
current = analogRead(termPin);
// Convert the measured value to the thermistor resistance
current = 1023 / current - 1;
current = resistance / current;
//Calculation of temperature according to the relation for the beta factor
float temperature;
temperature = current / termNom; // (R/Ro)
temperature = log(temperature); // ln(R/Ro)
temperature /= beta; // 1/B * ln(R/Ro)
temperature += 1.0 / (refTemp + 273.15); // + (1/To)
temperature = 1.0 / temperature; // The inverted value
temperature -= 273.15; // Convert from Kelvin to degrees Celsius
lcd.setCursor(0,0);
lcd.print("TEMP control");
lcd.setCursor(0,1);
lcd.setCursor(0,1);
lcd.print("Temp:");
lcd.setCursor(6,1);
lcd.print(temperature,1);
lcd.print("C");
lcd.print(" ");
delay(250); //delay of LCD print
}