Temperature Sensor With LCD Screen

by ntran9312 in Circuits > Arduino

106 Views, 0 Favorites, 0 Comments

Temperature Sensor With LCD Screen

freddie.jpg
bob king.gif

We have designed a fully functional temperature sensor with an LCD screen! In this instructable will guide you through all the steps and process required to recreate this temperature sensor.

Supplies

  1. Arduino
  2. Breadboard
  3. Temperature Sensor
  4. LCD Screen
  5. Male to Male Wires
  6. Male to Female Wires

Design Circuit on Tinkercad

temp sensor tinkercad.png

Copy layout above, be sure not to miss any wires in slot. One missed slot and your circuit will not be functional.

Coding

Coding for temp sensor.png

Before uploading code to your arduino, make sure to have "Adafruit Liquid Crystal" library downloaded

Code is listed below:

#include <Adafruit_LiquidCrystal.h>

 int buzzer = 9;

Adafruit_LiquidCrystal lcd(0);


void setup(){

 pinMode(LED_BUILTIN, OUTPUT);

 pinMode(A0, INPUT);

 lcd.begin(16, 2);

 lcd.setBacklight(HIGH);

 Serial.begin(9600);

}


void loop(){  

 

 float temperature = (analogRead(A1) * 5.0 / 1024 - 0.5) * 100;   

 Serial.println(temperature);

 lcd.setCursor(0,0);

 lcd.print("Temperature:  ");

 lcd.setCursor(0,1);

 lcd.print(String(temperature) + "C        ");

if (temperature <= 0 ) 

Bringing Design to Real Life

circuits.png

After finishing both steps listed above, it is time to bring the design into real life. Follow steps of tinkercad and copy all wiring into real life design. After completing all wiring, put in code into arduino software, connect arduino to computer and upload code into the arduino. After a few seconds, the LCD screen should turn on and it should input the given temperature of your current environtment.