LCD Temperature Sensor
This simple circuit uses the arduino uno to get a temperature reading and then print that reading to the LCD screen. It also has a "desired temp" that you can change and then depending on if the acual temperature is warmer or colder it will activate one of two lights accordingly.
Supplies
- Arduino uno circuit board
- bread board
- 25 jumper wires (sizes vary)
- 1 LCD screen
- 2 potentiometers
- 1 temperature sensor
- 3 10K resisters
- 2 LED lights (2 different colors)
Build Your Circuit
Downloads
Code Your Arduino Circuit
#include LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int pinTemp=A0;
void setup() {
pinMode(10,OUTPUT);
pinMode(9,OUTPUT); //sets the pins to be in/out put
pinMode(A1,INPUT);
pinMode(A0,INPUT);
lcd.begin(16, 2);
Serial.begin(9600);
}
void loop() {
float temp = analogRead(pinTemp);
float dTemp = analogRead(A1);
int pinTemp=A0;
dTemp=dTemp*0.1;
temp=temp*0.48828125;
temp=temp*(9/5)+32; //sets up the temp sensor
Serial.print("Current - ");
Serial.print(temp);
Serial.println("C"); //prints the temp stuff to the computer
lcd.setCursor(0, 0);
lcd.print("Current - ");
lcd.print(temp);
delay(1000);
lcd.setCursor(0,1);
lcd.print("Desired - "); //prints the temp stuff to the LCD screen
lcd.print(dTemp);
Serial.print(dTemp);
if (dTemp>temp){
digitalWrite(10,HIGH);
digitalWrite(9,LOW); //if dTemp is > temp turn on a light
} else {
digitalWrite(9,HIGH);
digitalWrite(10,LOW); //if dTemp is < temp turn on a light
}
}