Controlling stuff with dht11 arduino



This is a small sensor which measures humidity and temperature, when you setup this with Arduino you can control heaters, fans or what what ever you want, in this sketch I've used leds but if you replace the leds with relays you can easily control electrical stuffs. Let's see the sketch then I'll explain bit more about the sketch.

Note: You might need to install dht11 library so that this sketch can work properly. You can get it from http://playground.arduino.cc/main/DHT11Lib. When you go to the site to get the files you will find 4 things. The sketch, dht11.h file, dht11.cpp and test_dewpoint.ino but all the files are in text form and in one page so you will need to make them in different files and to do that you might need to get help from this post.

The sketch
#include <dht11.h>

dht11 DHT11;

#define DHT11PIN 2
int led = 3;
int led2 = 4;

void setup()
{
  Serial.begin(9600);
  Serial.println("DHT11 TEST PROGRAM ");
  Serial.print("LIBRARY VERSION: ");
  Serial.println(DHT11LIB_VERSION);
  Serial.println();
 
pinMode (led,OUTPUT); 
pinMode (led2,OUTPUT); 
}

void loop()
{
  Serial.println("\n");

  int chk = DHT11.read(DHT11PIN);

  Serial.print("Read sensor: ");
  switch (chk)
  {
    case DHTLIB_OK:
        Serial.println("OK");
        break;
    case DHTLIB_ERROR_CHECKSUM:
        Serial.println("Checksum error");
        break;
    case DHTLIB_ERROR_TIMEOUT:
        Serial.println("Time out error");
        break;
    default:
        Serial.println("Unknown error");
        break;
  }

  Serial.print("Humidity (%):  ");
  Serial.println((float)DHT11.humidity, 2);

  Serial.print("Temperature (*C):  ");
  Serial.println((float)DHT11.temperature, 2);


 if (DHT11.humidity >60){
   digitalWrite (led, HIGH);
 } else {
      digitalWrite (led, LOW);
 }

  if (DHT11.temperature >30){
   digitalWrite (led2, HIGH);
 } else {
      digitalWrite (led2, LOW);
 }

   delay(3000);
}


 * The light blue highlighted arrow > you can see after humidity and temperature that means if the humidity or temperature above then 60 or 30 it will turn the led 1 and 2 on otherwise off, and if you put the left arrow < that means if humidity or temperature lower then the number you put after the arrow then it turn the led 1 and 2 on otherwise off.

* "delay(3000)" As you can see delay 3000 that means it will take a measurement after every 3 seconds.

DHT22 with sound alert


dht11 arduino. arduino dht11. arduino nano dht11. arduino dht. dht11 led. dht11 led arduino. dh11 arduino. arduino dht11 led. arduino dht11 fan control. dht 11 with arduino. dht11. dht 11 arduino. dht arduino. dht11 arduino nano. arduino dht 11. dht11 with arduino. arduino heater control. dht11 sketch. dht11 png. dht11 to arduino. dth11 arduino. dht11arduino. arduino with dht11. dht11 arduino code. arduino temperature controlled relay. dht11 con arduino. arduino fan control with temp sensor. arduino temperature controller relay. arduino control temperature. arduino dht11 sketch. dht11 relay arduino. dht11 and arduino. ct arduino. ct sensor arduino. 

dht11 setup. arduino and dht11. dht-11 arduino. arduino humidity controller. arduino temperature controller. 아두이노 dht11 led. dht11 arduino uno. arduino dht sensor. dht11 arduino program. arduino ct sensor. dht 11. control heater with arduino. arduino humidity control. controlling led with relay and arduino. dht11 arduino sketch. dht11 diagram. arduino relay temperature control. dht 11 sensor arduino. dht11 with arduino uno. 아두이노 dht11. arduino stuff. dht11 fan control. arduino fan controller. dht11 arduino codigo. arduino dth11. arduino fan temperature control. control temperature with arduino. arduino temperature fan controller. humidity control arduino. arduino temperature relay. dht11.h led setup arduino. 

dht11 아두이노. using dht11 arduino. dht11 using arduino. arduino:xp3_lnu5gyc= dht11. controlling heater with arduino. temperature controller arduino. dht11.h no such file or directory. sensor dht 11 arduino. dht11 code arduino. dht11 program for arduino. arduino dh11. dht11 arduino sensor. sensor arduino dht11. arduino temperature dht11. arduino heater controller. dht11 sensor arduino. dht11 arduino connection. dht11 esp8266 arduino. dht11 sketch arduino. dht11 arduino nano code. dht 11 arduino code. dht11 for arduino. arduino pid temperature controller relay. dht sensor with arduino. dehumidifier temperature sensor. dht11 program. hdt11 arduino. program dht11 arduino. temperature controlled fan using arduino and dht11. dht11 sensor with arduino. arduino temperature controlled relay circuit. dht11 arduino beispiel. arduino uno dht11. 

dht arduino code. dht11 code for arduino. dht 11 sensor with arduino. temperature sensor dht11 arduino. coding dht11 arduino. connection of dht11 with arduino. arduino nano dht. arduino fan speed control. dht 11 sensor arduino code. compilation terminated. exit status 1. dht no such file or directory. ардуино dht11. dht11 output format. dht control. led arduino setup. sketch arduino. controlling led with arduino. 

dht11 sensor png. arduino fan. arduino temperature and humidity controller. ct for arduino. control relays with arduino. dht-11. dht11 error. dht11 images. led stuff. dht sensor arduino. measures of humidity. amazing arduino. dht11 case. dht sensor. arduino relay sketch.

4 comments:

  1. Arduino:1.6.12 Hourly Build 2016/09/14 08:20 (Windows 7), Scheda:"Arduino/Genuino Uno"

    C:\Users\Ciccio\AppData\Local\Temp\arduino_modified_sketch_649797\sketch_dec09a.ino:1:19: fatal error: dht11.h: No such file or directory

    #include

    ^

    compilation terminated.

    exit status 1
    Errore durante la compilazione per la scheda Arduino/Genuino Uno.

    Questo report potrebbe essere più ricco di informazioni con l'opzione
    "Mostra un output dettagliato durante la compilazione"
    abilitata in File -> Impostazioni

    ReplyDelete
  2. Do you have dht11 library in zip format? You give me the link. THANK YOU!

    ReplyDelete
  3. Hello!

    I have same problem then ciccio grasso.
    I made the dht11.cp and dht11.h files. What is the next step?

    ReplyDelete



Newly posted:
Reason why rich getting richer and poor getting poorer