Arduino - Temperature Sensor

    0

    0

    Sohail Gulam

    unoarduino

    The Temperature Sensor LM35 series are precision integrated-circuit temperature devices with an output voltage linearly proportional to the Centigrade temperature.

    float temp;
    int tempPin = 0;
    void setup() {
       Serial.begin(9600);
    }
    void loop() {
       temp = analogRead(tempPin);
       // read analog volt from sensor and save to variable temp
       temp = temp * 0.48828125;
       // convert the analog volt to its temperature equivalent
       Serial.print("TEMPERATURE = ");
       Serial.print(temp); // display temperature value
       Serial.print("*C");
       Serial.println();
       delay(1000); // update sensor reading each one second
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.