Parkmoonsu윤원호gledel정다연
Published © GPL3+

Air Meter Making #2: Use the Arduino DHT 11 Module

Air meter making, a second time! Let's look at temperature and humidity using the DHT 11 module.

BeginnerProtip30 minutes6,689
Air Meter Making #2: Use the Arduino DHT 11 Module

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
DHT11 Temperature & Humidity Sensor (3 pins)
DHT11 Temperature & Humidity Sensor (3 pins)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

DHT 11 Schematics

For a DHT 11 module with four pins, use a 5K ohm resistor.

Code

DHT 11 CODE

Arduino
Check out the serial monitor!
#include <DHT11.h>    //Load library
int pin=2;            //Pin number of the signal
DHT11 dht11(pin);        
void setup()
{
   Serial.begin(9600); //Communication speed setting
}
 
void loop()
{
  int err;
  float temp, humi;
  if((err=dht11.read(humi, temp))==0) //Read temperature, humidity read
  {
    Serial.print("temperature:");
    Serial.print(temp);
    Serial.print(" humidity:");
    Serial.print(humi);
    Serial.println();
  }
  else                                //Processing in case of error
  {
    Serial.println();
    Serial.print("Error No :");
    Serial.print(err);
    Serial.println();    
  }
  delay(1000);                        //Repeat every second
}
 


//source: http:deneb21.tistory.com/207 [Do It Yourself!]

Credits

Parkmoonsu
1 project • 6 followers
A Korean high school student who wants to learn about Arduino!
Contact
윤원호
1 project • 7 followers
Ordinary high school student who wants to enter science and engineering college
Contact
gledel
100 projects • 116 followers
Looking back on my childhood, I was happy when I was making something and I was proud of myself. "Making is instinct!"
Contact
정다연
1 project • 4 followers
Contact

Comments

Please log in or sign up to comment.