Pengatur Suhu Ruangan Otomatis Berbasis Arduino

Project Untuk Kelompok 3



Komponen yang dibutuhkan :
  • Arduino (Versi apapun) >> 1 Buah.
  • Fan (Kipas) seperti pada gambar diatas >> 1 Buah.
  • DHT-11 Sensor Temperature & Humadity >> 1 Buah.
  • Kabel >> Seperlunya.

Wiring :

Source Code :
     /*  
      * Generated Code by Kang Kamal  
      * kangkamal.blogspot.com  
      */  
     #include "DHT.h"  
     #define DHTPIN 2    // what pin we're connected to  
     #define DHTTYPE DHT11  // DHT 11  
     int fanPin = 13;  
     float suhu = 0;  
     DHT dht(DHTPIN, DHTTYPE);  
     void setup() {  
      // put your setup code here, to run once:  
      Serial.begin(9600);  
      Serial.println("DHT11 test!");  
      pinMode(fanPin, OUTPUT);  
      digitalWrite(fanPin, LOW); //Set default kipas mati saat program startup  
     }  
     void loop() {  
      // put your main code here, to run repeatedly:  
      suhu = dht.readTemperature();  
      Serial.print("Suhu Ruangan : ");  
      Serial.println(suhu);  
      if (suhu > 30){  
       digitalWrite(fanPin, HIGH); //Kipas nyala saat suhu diatas 30  
      }  
      else{  
       digitalWrite(fanPin, LOW); //Kipas mati saat suhu dibawah 30  
      }  
     }  
    

    comment 0 comments:

    Post a Comment

    CNC Tutorial Cetak si SAM Assistant

     
    © All 4 You... | Design by Blog template in collaboration with Concert Tickets, and Menopause symptoms
    Powered by Blogger