Baca Sensor Suhu TMP36 Dengan Arduino

Cara baca sensor suhu TMP36 dengan arduino, disini menggunakan LCD 20×16 untuk menampilkan suhunya :

#include <LiquidCrystal.h>
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
float temp;
int tempPin = 0;
void setup(){
lcd.begin(16, 2);
Serial.begin(9600);}
void loop(){
temp = analogRead(tempPin);
temp = temp * 0.48828125;
Serial.print("TEMPRATURE = ");
Serial.print(temp);
Serial.print("*C");
Serial.println();
lcd.setCursor(0, 0);
lcd.print("TMP=");
lcd.print(temp);
lcd.print("C");
delay(1000);}

 

We will be happy to hear your thoughts

Leave a reply