Created
October 26, 2020 11:25
-
-
Save ByK95/2a584e5ca45f16f1337eaec4aa5b6b99 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
Arduino 10k resistive termometer reading example | |
Circuit: 10k pullup | |
*/ | |
void setup() { | |
Serial.begin(9600); | |
} | |
double Thermister(int RawADC) { | |
double Temp; | |
Temp = log(((10240000/RawADC) - 10000)); | |
Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp ); | |
Temp = Temp - 273.15; | |
return Temp; | |
} | |
void loop() { | |
int val; | |
double temp; | |
val=analogRead(0); | |
temp=Thermister(val); | |
Serial.println(temp); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment