THERMOMETER_DIGITAL

contoh sederhana thermometer digital dengan Arduino Uno

 The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
 * output LM35 to A5
#include <LiquidCrystal.h>
int lm35 = A5;    
int nilai_t = 0;  
int led = 13;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
  lcd.begin(16, 2);
  pinMode(led, OUTPUT);
}
void loop() {
  nilai_t = analogRead(lm35)/2;
  lcd.setCursor(0, 1);
  lcd.print("T -=>:");
  lcd.print(nilai_t);
  lcd.print(" C");
  if (nilai_t < 37) digitalWrite(led, HIGH);
  if (nilai_t > 39) digitalWrite(led, LOW);
  delay(100);
}