Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

DHT11 Temperature & Humidity Sensor for Arduino Projects

Components and supplies

DHT11 Temperature & Humidity Sensor for Arduino Projects
Arduino UNO
×1
DHT11 Temperature & Humidity Sensor for Arduino Projects
DHT11 Temperature & Humidity Sensor (3 pins)
×1
DHT11 Temperature & Humidity Sensor for Arduino Projects
Jumper wires (generic)
×3
DHT11 Temperature & Humidity Sensor for Arduino Projects
Breadboard (generic)
×1
Arduino USB 2.0 Cable
×1

Apps and online services

DHT11 Temperature & Humidity Sensor for Arduino Projects
Arduino IDE

About this project

In this project, we will use the KY-015 Arduino DHT11 Temperature/Humidity sensor and display it to the Arduino IDE serial monitor. This project is really simple and shouldn't take us very long.

Materials

The materials are here as follows:

  • Arduino Uno (Any "Uno" will work, I have a Geekcreit Uno)
DHT11 Temperature & Humidity Sensor for Arduino Projects
  • KY-015 Arduino DHT11 Temperature/Humidity
DHT11 Temperature & Humidity Sensor for Arduino Projects
  • Jumper Wires
DHT11 Temperature & Humidity Sensor for Arduino Projects
  • Breadboard
DHT11 Temperature & Humidity Sensor for Arduino Projects
  • Cable (USB 2.0)
DHT11 Temperature & Humidity Sensor for Arduino Projects

Step 1: Place the sensor

DHT11 Temperature & Humidity Sensor for Arduino Projects

The first thing you are going to do is place the sensor on the breadboard. If you place the breadboard in the orientation the way it was made, the blue part of the sensor should be facing you.

Step 2: Connect everything

DHT11 Temperature & Humidity Sensor for Arduino Projects
DHT11 Temperature & Humidity Sensor for Arduino Projects

Wow, we're already almost done! The pins on the sensor are S, for signal, the one in the middle is voltage, and the minus sign is ground. The signal pin goes to header A0 on the Arduino. The middle pin goes to 5V, and the minus sign goes to GND. Our yellow cable is our Analog cable, our red cable is power, and our black one is ground.

Note: If you're only looking at the pictures, stop right there, read the instructions I just gave and rewire it correctly. The Geekcreit Uno has a different pin layout than the Arduino Uno, but if you follow where I told you to put the pins it will work on both boards.

Multiple people in the comment section have blamed me for frying their circuits, just read the instructons next time. :)

Step 3: Adding the DHT library

Okay this part is actually kind of important. Go to the credits on this post and click on the link for Brainy Bits. The credits are at the very bottom of this page, click on the link where it says 'thanks to Brainy Bits', or you can click here.

Scroll to the very bottom of the page. There should be a card that provides the download link towards the bottom.

Now download our code attached to the post. In the Arduino IDE, go to Sketch >> Include Library >> Add ZIP file.

DHT11 Temperature & Humidity Sensor for Arduino Projects

When you click the 'Add .ZIP library', you should get a file window that pops up. Add the DHT_Library.zip.

DHT11 Temperature & Humidity Sensor for Arduino Projects

If you'll notice in the code, another line of code pops up that says:

#include <dht.h>
DHT11 Temperature & Humidity Sensor for Arduino Projects

There now should be two duplicate lines. One of the duplicate lines that was there before, that should be underneath the new duplicate line - delete it. Now the code should work.

Okay, NOW upload the code. When it is finished, go to the top right of the Arduino IDE window and click the little magnifying glass button. That will open the serial monitor, and the data of the sensor should be displaying itself and updating every 5 seconds.

DHT11 Temperature & Humidity Sensor for Arduino Projects
DHT11 Temperature & Humidity Sensor for Arduino Projects

Well, that's it! Enjoy your temperature/humidity sensor!

Code

  • DHT11 Temperature/Humidity Sensor
DHT11 Temperature/Humidity SensorArduino
#include <dht.h>


#define dht_apin A0 // Analog Pin sensor is connected to
 
dht DHT;
 
void setup(){
 
  Serial.begin(9600);
  delay(500);//Delay to let system boot
  Serial.println("DHT11 Humidity & temperature Sensor\n\n");
  delay(1000);//Wait before accessing Sensor
 
}//end "setup()"
 
void loop(){
  //Start of Program 
 
    DHT.read11(dht_apin);
    
    Serial.print("Current humidity = ");
    Serial.print(DHT.humidity);
    Serial.print("%  ");
    Serial.print("temperature = ");
    Serial.print(DHT.temperature); 
    Serial.println("C  ");
    
    delay(5000);//Wait 5 seconds before accessing sensor again.
 
  //Fastest should be once every two seconds.
 
}// end loop(

Manufacturing process

  1. DHT11 Sensor: How It Works and Key Applications
  2. Arduino Temperature & Humidity Logger Using DHT11 and Ethernet Shield
  3. Read Temperature & Humidity with DHT11 on Blynk – Step‑by‑Step Arduino Tutorial
  4. Smartphone-Based Temperature Monitoring System with Arduino and Bluetooth
  5. MKR1000 with DHT22: Real‑Time Temperature & Humidity Monitoring to Azure
  6. Bolt IoT: Advanced Humidity & Temperature Monitoring with DHT11 and Arduino
  7. Arduino UNO Mini Weather Station – DIY Sensor Hub with ESP8266 IoT
  8. DHT11 & DHT22 Temperature & Humidity Sensor Kit for Raspberry Pi & Arduino
  9. Arduino Tutorial: Master Temperature & Humidity with DHT11 & DHT22 Sensors
  10. DHT11 Datasheet – Digital Temperature & Humidity Sensor Specifications