FIKRI IBRAHIM N

Blog tentang Robotik, Fisika, Fisika Instrumentasi, Elektronika, Komputasi dll.

Search

Monday, January 18, 2016

Program Arduino Termometer Digital dengan LM35 Menampilkan Suhu dalam C, K, R, F

#include <LiquidCrystal.h>
const int inPin = 0;//pin di analog
LiquidCrystal lcd(7, 6, 5, 4, 3, 8 );
void setup()
{
  Serial.begin(9600);
  lcd.begin(16,2)
}
void loop()
{
  int value = analogRead(inPin);
 Serial.print(value);
Serial.print(" > ");
float millivolts = (value / 1024.0)*5000;
float celcius = millivolts / 10;

Serial.print(celcius);
lcd.setCursor(0,0);
lcd.print(celcius);
lcd.print (" C ");
Serial.print(" degrees Celcius, ");
lcd.print ((celcius*9)/ 5 + 32);
lcd.print ("F");
lcd.setCursor(0,1);
Serial.print( (celcius*9)/ 5 + 32);
Serial.print(" degrees Fahrenheit ");
lcd.print ( celcius + 273.15);
lcd.print ("  K ");
Serial.print( celcius + 273.15);
Serial.print(" degrees Kelvin ");
lcd.print( (celcius*4)/ 5 );
lcd.print("R
");
Serial.print( (celcius*4)/ 5 );
Serial.print(" degrees Reamur ");
delay(2000);


1 comment: