Project showcase

LCD Thermometer With LEDs And Alarm Signal © GPL3+

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

  • 3,153 views
  • 4 comments
  • 21 respects

Components and supplies

About this project

This is a fair simple project that you can build using parts from the Starter Kit. The display will show the current temperature in Celsius degrees, and the LEDs will lit each one according to three different temperature ranges. The piezo will play an alarm signal when the temperature goes above 26 degrees.

You'll need:

  • 1x Arduino Uno board
  • 1x Breadboard
  • 1x 16x2 LCD display
  • 1x temperature sensor
  • 1x 10k encoder
  • 1x piezo
  • 3x LEDs
  • 4x 330 Ohm resistore
  • 24x Jumpers

Connect all the items following the schematics above.

Upload the code below to your Arduino Uno using the Arduino IDE, and you are done. Remember that you can supply power through the USB connection or directly with a 9V battery connected to the GND and Vin connection of the Uno.

#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); 
} 

Code

Untitled fileArduino
#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);
}

Schematics

Schematics
Termometroled meado78m7h

Comments

Author

Default
GioMac
  • 1 project
  • 0 followers

Additional contributors

Published on

February 3, 2018

Members who respect this project

Default379220 398938753478950 584477026 n10354686 10150004552801856 220367501106153455 n12540590 741555235974555 3535889509737692135 n u3tbvajh6h10735750JmcgrawDefaultDefault

and 13 others

See similar projects
you might like

Similar projects you might like

Night Light Assistant

Project tutorial by Gabriele Fugazzi

  • 1,330 views
  • 4 comments
  • 8 respects

Smart Energy Saver for Your Home

Project tutorial by Dhairya Parikh

  • 3,816 views
  • 8 comments
  • 12 respects

Unravel Preset Piano Easy Arduino (Even a Ghoul Can Make It)

Project in progress by ExeCuteLi

  • 331 views
  • 0 comments
  • 5 respects

A Geiger Counter Simulator

Project tutorial by organtin

  • 1,518 views
  • 1 comment
  • 7 respects

Twilight Switch With Levels

Project in progress by Rafa Salvador

  • 1,368 views
  • 1 comment
  • 5 respects

Door Knock Notifier

by Random Science Stuff

  • 229 views
  • 1 comment
  • 4 respects
Add projectSign up / Login