GioMac
Published © GPL3+

LCD Thermometer With LEDs And Alarm Signal

An easy project using stuff from the starter kit: Arduino Uno, temperature sensor, 16x2 LCD display, some LEDs and a Piezo.

EasyShowcase (no instructions)4,149
LCD Thermometer With LEDs And Alarm Signal

Things used in this project

Hardware components

Breadboard (generic)
Breadboard (generic)
×1
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×1
Resistor 330 ohm
Resistor 330 ohm
×4
Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
×1
Arduino Piezo
×1
LED (generic)
LED (generic)
×3
Temperature Sensor
Temperature Sensor
×1

Story

Read more

Schematics

Schematics

Termometroled meado78m7h

Code

Untitled file

Arduino
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int sensorPin = 0;
float tempC;
void setup() {
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(13, OUTPUT);
  pinMode(9, INPUT);
lcd.begin(16, 2);
}
void loop() {
tempC = get_temperature(sensorPin);
lcd.setCursor(0,0);
lcd.print("Temperature: "); 
lcd.setCursor(0,1);
lcd.print (tempC, 1); lcd.print(" "); lcd.print("C");
delay(200);

 if (tempC <= 23){
    digitalWrite(8, HIGH);
    digitalWrite(7, LOW);
    digitalWrite(13, LOW);
    noTone(9);
   
  }
 else if (tempC > 26){
    digitalWrite(7, LOW);
    digitalWrite(8, LOW);
    digitalWrite(13, HIGH);
    tone(9, 440, 250);
    delay(500);
    
  }
  else {
    digitalWrite(7, HIGH);
    digitalWrite(8, LOW);
    digitalWrite(13, LOW);
    noTone(9);
  } 
 
}
float get_temperature(int pin) {
float temperature = analogRead(pin);
float voltage = temperature * 5.0;
voltage = voltage / 1024.0;
return ((voltage - 0.5) * 100);
}

Credits

GioMac

GioMac

0 projects • 1 follower

Comments