Lampiran
Lampiran 1
PROGRAM LENGKAP
#include "DHT.h"
#include <LiquidCrystal.h> #define DHTPIN A5
#define DHTTYPE DHT22 DHT dht(DHTPIN, DHTTYPE); #define buzzer 9
LiquidCrystallcd(8, 6, 5, 4, 3, 2); void setup() {
Serial.begin(9600); dht.begin();
lcd.begin(16,2);
pinMode(buzzer,OUTPUT); }
void loop() {
float h = dht.readHumidity()-30; float t = dht.readTemperature(); float f = dht.readTemperature(true);
if (isnan(h) || isnan(t) || isnan(f)) {return;}
floathif = dht.computeHeatIndex(f, h);
float hic = dht.computeHeatIndex(t, h, false); if (h<40){digitalWrite(buzzer,HIGH); delay(100); digitalWrite(buzzer,LOW); delay(500);}
lcd.setCursor(0,0); lcd.print("RH: "); lcd.print(h);
lcd.print(" %"); lcd.setCursor(0,1); lcd.print("T : "); lcd.print(t);
lcd.print(" ");
lcd.write(B11011111); lcd.print("C");
}
Lampiran 2
RANGKAIAN LENGKAP