Introduction: Arduino and DHT11 Humidity Sensor Interface
Hi friends. Today in this instructables, I am going to show you how to use a DHT11 humidity sensor with Arduino. You can use this project for making weather station. So lets start this project !!!
Step 1: Components Needed
1.) Laptop with Arduino IDE installed
2.) USB B Type cable
3.) Arduino UNO
4.) DHT11 Humidity sensor
5.) Breadboard
6.) 3 Wires
Step 2: The Schematic
Step 3: The Code
Download the following zip. Then open Arduino IDE. Go to Sketch > Import Library or Include Library > Add library and then select the DHTLib.zip file.
Copy the following code and open the Serial Monitor.
#include <dht.h> dht DHT; #define DHT11_PIN 7 void setup(){ Serial.begin(9600); } void loop() { int chk = DHT.read11(DHT11_PIN); Serial.print("Temperature = "); Serial.println(DHT.temperature); Serial.print("Humidity = "); Serial.println(DHT.humidity); delay(1000); }
Comments