Arduino Thermometer (LM 35 Temperature Sensor)

2,390

17

Introduction: Arduino Thermometer (LM 35 Temperature Sensor)

About: Technology enthusiastic, crazy about embedded system, love Arduino and raspberry pi.

This is a simple circuit to check room temperature using Arduino and LM35(Temperatuure Sensor).If temperature is greater than 29 degree C then RED LED will glow else GREEN LED will glow.

GREEN LED indicates temperature is normal.

RED LED indicates temperature is high.

Step 1: Parts List

1x Arduino nano

1x LM 35 Temperature Sensor

2x 220 Ohms resistor

1x Red LED (Your wish)

1x Green LED (Your wish)

1x Breadboard or stripboard, as you prefer

1x USB Cable

and connecting wires.

Step 2: Circuit Diagram.

This is very simple circuit.

Download Circuit Diagram

Step 3: Code

/*

* Arduino Button Game *

* Developed by Mohammed Adil

* B.Tech 3rd sem

* Student at Lovely Professional University

*

*/

int val;

void setup()

{

pinMode(2,OUTPUT);//For LED 1

pinMode(3,OUTPUT);//For LED 2

}

void loop()

{

val=analogRead(A0);

float mv=(val/1024.0)*5;// 10 bit ADC from 0-1024 (2^10=1024)

float cel=mv*100;

//float f=(cel*9)/5 + 32;//For far

if(cel>29)//If temperature is greater than 29 degree C then RED LED will glow

{

digitalWrite(2,HIGH);

digitalWrite(3,LOW);

}

else //Else GREEN LED will glow.

{

digitalWrite(2,LOW);

digitalWrite(3,HIGH);

}

}

Download the code.

Be the First to Share

    Recommendations

    • Pocket-Sized Speed Challenge

      Pocket-Sized Speed Challenge
    • Audio Challenge 2020

      Audio Challenge 2020
    • Maps Challenge

      Maps Challenge

    Discussions