Lisleapex Blog
Published

Monitoring Temperature Using Arduino and LM35 Temperature Se

How to use Arduino and LM35 temperature sensor to monitor temperature? Here I will give you a brief introduction

BeginnerWork in progress2 hours34
Monitoring Temperature Using Arduino and LM35 Temperature Se

Things used in this project

Hardware components

lm35
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Breadboard, 170 Pin
Breadboard, 170 Pin

Story

Read more

Schematics

place_the_sensor_on_the_breadboard_kp4xssuvEF.png

Code

Untitled file

Arduino
float temp = 0;


// the setup routine runs once when you press reset:
void setup() {
Serial.begin(115200);
Serial.println(F("reading temperature begin. \n"));

}

// the loop routine runs over and over again forever:
void loop() {
 
  static unsigned long sensortStamp = 0;
  
  if(millis() - sensortStamp > 100){
    sensortStamp = millis();
    // read the LM35 sensor value and convert to the degrees every 100ms.

    int reading = analogRead(0); //注意到我们是把LM35的输出端连接到了A0,所以这里是analogRead(0)
    temp = reading *0.0048828125*100;
    Serial.print(F("Real Time Temp: ")); 
    Serial.println(temp); 
  }
  
}

Credits

Lisleapex Blog
26 projects • 0 followers
Fast Delivery of High-Quality Electronic Components
Contact

Comments

Please log in or sign up to comment.