Last active
November 11, 2017 03:37
-
-
Save LuizFelipeLemon/f1c84617e0589bc88546ada05f3b78a2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define ntc A1 //Nomeia a porta A1 como ntc | |
void setup(){ | |
Serial.begin(9600); //Inicia a Serial | |
pinMode(ntc,INPUT); //Define o pino A5 como entrada | |
} | |
void loop(){ | |
int ntcValor = analogRead(ntc); // Armazenda valor analógico | |
long Resistance; | |
double Temp; | |
Resistance=((10240000/ntcValor) - 10000); | |
Temp = log(Resistance); | |
Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp)); | |
Temp = Temp - 273.15; // Convertendo Kelvin para Celsius | |
Serial.println(Temp); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment