Aarush Sood
Published © GPL3+

Digital thermometer using LM35 and arduino

Read the temperature fast with accuracy

IntermediateFull instructions provided3 hours11,668

Things used in this project

Hardware components

5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Green
5 mm LED: Green
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
Resistor 220 ohm
Resistor 220 ohm
×2
Arduino UNO
Arduino UNO
×1
Arduino LM35
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Digital_thermometer code

C/C++
#include <LiquidCrystal.h>
LiquidCrystal lcd(8,9,10,11,12,13);
#define LM35_sensor A0
byte degree[8]={
  0b00011,
  0b00011,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000
};


int LEDR = 5;
int LEDG = 7;


void setup() {
  // put your setup code here, to run once:
pinMode(LEDR,OUTPUT);
pinMode(LEDG,OUTPUT);

lcd.begin(16,2);
lcd.createChar(1, degree);
lcd.setCursor(0,0);
lcd.print(" DIGITAL ");
lcd.setCursor(0,1);
lcd.print(" THERMOMETER ");
delay(2800);
lcd.clear();

}

void loop() {
  
  // temperature:
  
  float analog_read = analogRead(LM35_sensor);
  float temp = analog_read/2.046 ;
  delay(10);
  
//lcd display:

  lcd.clear();
  lcd.setCursor(2,0);
  lcd.print("TEMPERATURE");
  lcd.setCursor(4,1);
  lcd.print(temp);
  lcd.write(1);// READ ASCII VALUE
  lcd.print("C");
  delay(1000);
  
  //led :

  if(temp<35)
  {

     digitalWrite(LEDG,LOW);
    digitalWrite(LEDR,HIGH);

 
  
  
  }
  else{
     digitalWrite(LEDR,LOW);
     digitalWrite(LEDG,HIGH);
 
  
  }

  

}

Credits

Aarush Sood
5 projects • 10 followers
Technology enthusiast , ECE graduate from India. An electronics hobbyist who loves working with arduino's and esp's.
Contact

Comments

Please log in or sign up to comment.