johnny78
Full Member level 4
i was looking for a way to use my NTC with arduino & i found alot of easy projects & ways to do that
one of them
https://www.ametherm.com/blog/thermistor/arduino-and-thermistors
the code
when i tried to test this i get 0 on serial monitor or Just -273.15 So the next line is useless
& i tried to read the vo & yes it works & the value varies when changing temp on the Ntc
would you check the code please?
best regards
Johnny
one of them
https://www.ametherm.com/blog/thermistor/arduino-and-thermistors
the code
Code:
#include <LiquidCrystal.h>
int ThermistorPin = A0;
int Vo;
float R1 = 3000;
float logR2, R2, T;
float A = 2.783297339, B = -0.4139621528, C = 17.57815707; // Steinhart-Hart and Hart Coefficients
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
Serial.begin(9600);
}
void loop() {
Vo = analogRead(ThermistorPin);
R2 = R1* (1023.0 / (float)Vo - 1.0);
logR2 = log(R2);
T = (1.0 / (A + B*logR2 + C*logR2*logR2*logR2)); // Steinhart and Hart Equation. T = 1 / {A + B[ln(R)] + C[ln(R)]^3}
T = T - 273.15;
//lcd.print("TEMP = ");
//lcd.print(T);
//lcd.print(" C");
Serial.print(T);
delay(500); // Time delay 10 Milliseconds
lcd.clear();
}
when i tried to test this i get 0 on serial monitor or Just -273.15 So the next line is useless
Code:
T = (1.0 / (A + B*logR2 + C*logR2*logR2*logR2)); // Steinhart and Hart Equation. T = 1 / {A + B[ln(R)] + C[ln(R)]^3}
would you check the code please?
best regards
Johnny
Last edited: