Introduction: Digital Termometer

Picture of Digital Termometer

Hi everybody this is my first instructables , and it's a digital termometer using a IC2 display ,an Arduino UNO, a rechargable battery(a powerbank),a LM35 as the temperature sensor, and a pushbutton wich if you pushes it it displays temperature rather on celsius or farenheit.
The Arduino and the display i bought them on Ebay.
The display was around 8usd.
The LM35 you can get it at any electronics shop, for no more than 1usd.
I used the liquidCrystal_I2C library and the wire.h.

Here is the programming:
#include <Wire.h>
#include <LiquidCrystal_I2C.h> //libraries
int termo=A0;
int boton=5;
int estadoboton=0;
LiquidCrystal_I2C lcd(0x27,16,2);  
void setup()
{
  pinMode(boton,INPUT);
  lcd.init();                      // initialize the lcd
  Serial.begin(9600);
  lcd.print("TEMPERATURA");
  lcd.backlight();//enciendo la luz del LDC
  delay(250);
  lcd.noBacklight();//apago la luz del LCD
  delay(250);
  lcd.backlight();
 
}


void loop()
{
  estadoboton=digitalRead(boton);
 
  if (Serial.available()) {
    delay(100);
    lcd.clear();
   
    while (Serial.available() > 0) {
     
      lcd.write(Serial.read());
    }
  }
  if(estadoboton ==HIGH){
   float temperatura=analogRead(termo);
  float tempF=((((temperatura*500)/1024)*1.8)+32);
  Serial.print("Temperatura");
  Serial.println(tempF);
  lcd.setCursor(11,0);
  lcd.print(tempF);
  lcd.setCursor(1,1);
  lcd.print("Farenheit");
  delay(500);
  }
   if(estadoboton==LOW){
   float temperatura=analogRead(termo);
  float tempC=((temperatura*500)/1024);
  Serial.print("Temperatura");
  Serial.println(tempC);
  lcd.setCursor(11,0);
  lcd.print(tempC);
  lcd.setCursor(1,1);
  lcd.print("Celsius   ");
  delay(500);
 
}
}


Comments

Great project, thanks for sharing!

About This Instructable

1,662views

22favorites

License:

Bio: mugreeeDOWN(:CmoqieraTEAMO(: mebithaB;;
More by mahf1230:Digital Termometer
Add instructable to: