BertWickham
Published

LCD displaying temperature with a TMP36 sensor

This project will allow you to hook up a TMP36 sensor to a lcd screen.

BeginnerShowcase (no instructions)8,471
LCD displaying temperature with a TMP36 sensor

Things used in this project

Code

lcd_temp

C/C++
// Make a lcd screen display temperature in fahrenheit with a temperature sensor!

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int sensorPin = 0; 
 

void setup()
{
  lcd.begin(16, 2);                         
}
 
void loop()                     
{
 
lcd.clear();
int reading = analogRead(sensorPin);  
float voltage = reading * 5.0;
voltage /= 1024.0; 
float temperatureC = (voltage - 0.5) * 100 ; 
float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0;
lcd.print(temperatureF); lcd.println(" degrees F ");
delay(1000);

}

Credits

BertWickham
1 project • 0 followers

Comments