Skip to content

Instantly share code, notes, and snippets.

@ByK95
Created October 26, 2020 11:25
Show Gist options
  • Select an option

  • Save ByK95/2a584e5ca45f16f1337eaec4aa5b6b99 to your computer and use it in GitHub Desktop.

Select an option

Save ByK95/2a584e5ca45f16f1337eaec4aa5b6b99 to your computer and use it in GitHub Desktop.

Revisions

  1. ByK95 created this gist Oct 26, 2020.
    25 changes: 25 additions & 0 deletions temperature.ino
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    /*
    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);
    }