Skip to content

Instantly share code, notes, and snippets.

@ByK95
Created October 26, 2020 11:25
Show Gist options
  • Save ByK95/2a584e5ca45f16f1337eaec4aa5b6b99 to your computer and use it in GitHub Desktop.
Save ByK95/2a584e5ca45f16f1337eaec4aa5b6b99 to your computer and use it in GitHub Desktop.
/*
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