Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Arduino
40 min
Share

Digital Thermometer Using Arduino & LM35 Temperature Sensor

To keep maintaining rooms, crops, and weather conditions under control, many projects require to monitor environment temperature. Arduino Uno can interface LM35, which is a good temperature sensor, it does not require any external trimming.

Project Video

Overview

In this tutorial, we will learn how to use the LM35 temperature sensor with Arduino. Applications that require high precision temperature estimation often use LM35 sensor.

Getting the Items

Arduino Uno R3 (Voltaat Version)
Get Item
LM35DZ Temperature Sensor IC
Get Item
Jumper Wires - Male to Male (40 Pack)
Get Item

Steps

Wiring it Up

Connect the wires between the LM35 temperature sensor and the Arduino as shown in the image below.

To keep maintaining rooms, crops, and weather conditions under control, many projects require to monitor environment temperature. Arduino Uno can interface LM35, which is a good temperature sensor as it can measure from -55 to 150 ˚C with a 0.1°C resolution, It does not require any external trimming, although the main drawback of this sensor is that it outputs data in analog format, making it very prone to external noise and interference.

Connections from the LM35 temperature sensor to arduino :

• LM35 VCC  → Arduino 5V pin

• LM35 GND →  Arduino GND pin

• LM35 OUT →  Arduino pin A0

Coding


/*
Voltaat learn (http://learn.voltaat.com)
Link for full tutorial:
Tutorial:Digital_Thermometer_Using_Arduino___LM35_Temperature_Sensor_vol
LM35 library:

The function of this sketch is to obtain the value of temperature from the LM35 temperature sensor and display it on your computer.

Connections from the LM35 temperature sensor to arduino :

• LM35 VCC  → Arduino 5V pin

• LM35 GND →  Arduino GND pin

• LM35 OUT →  Arduino pin A0


* Set the pin with
* LM35 name_of_variable(analog_pin);
* exemple LM35 temp(A0);
*
* shows the temperature wirh:
* name_of_variable.cel() - to show the temperature in celsius
* name_of_variable.fah() - to show the temperature in fahrenheit
* name_of_variable.kel() - to show the temperature in kelvin

*/

//Libraries
#include "LM35.h"

// setting the sensor in the pin A0
// Command - LM35 name_of_variable(analog_pin);
LM35 temp(A0);

// Function that will be executed once when connecting or resetting the Arduino
void setup()
{
 // start the Serial communication
 Serial.begin(9600);
}

// Function that will be executed continuously
void loop()
{
 Serial.print("Temp - ");  //Send a text to serial
 Serial.print(temp.cel()); //It gets the temperature in celcius and send to serial
 Serial.print(" C  - ");  
 Serial.print(temp.fah()); //It gets the temperature in fahrenheit and send to serial
 Serial.print(" F  - ");
 Serial.print(temp.kel()); //It gets the temperature in kelvin and send to serial
 Serial.println(" K");     // Send a text to serial and give a new line
 Serial.println(" ");      // Blank line

 // to store the value in a variable you will use.  
 //float temperature = temp.cel();

 //delay
 delay(1000);
}

//end

   

Testing it Out

If you want to heat the temperature sensor by fire with a lighter, you have to be careful, as it may cause a fire to break out in your house.
Digital_Thermometer_Using_Arduino___LM35_Temperature_Sensor_vol

Once you’ve connected the LM35 temperature sensor to the Arduino and uploaded the code, open the serial monitor by clicking on its icon.

know when your plant needs watering

The serial monitor will display the temperature value.

know when your plant needs watering

Resources

No items found.