raj thavti
Published © GPL3+

DHT11 Sensor Interfacing with NodeMCU

DDHT11 sensor interfacing with NodeMCU using Arduino IDE.

BeginnerProtip30 minutes20,425
DHT11 Sensor Interfacing with NodeMCU

Things used in this project

Hardware components

DHT11 Temperature & Humidity Sensor (3 pins)
DHT11 Temperature & Humidity Sensor (3 pins)
×1
NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Custom parts and enclosures

nodemcu

DHT11 sensor

Schematics

NODEMCU interface with DHT11

File missing, please reupload.

Code

DHT11 sensor code

Arduino
The program shown here is to print the DHT11 collected Humidity and temperature valures on the serial port .

Before we compile the program we should make sure that we have added DHT sensor library
Go to Sketh --> include library--->manage library and then search for DHT11
Install the appropriate dht sensor type you are using.

Another way of including the library is to download DHT sensor library for github or my dropbox link has the fiel you can download it form

https://www.dropbox.com/home/hackster.io/public/DHT11-sensor-library-for-arduino
#include "DHT.h"        // including the library of DHT11 temperature and humidity sensor
#define DHTTYPE DHT11   // DHT 11

#define dht_dpin D6
DHT dht(dht_dpin, DHTTYPE); 
void setup(void)
{ 
  dht.begin();
  Serial.begin(9600);
  Serial.println("Humidity and temperature \n\n");
   Serial.println("==========================================");
  delay(700);

}
void loop() {
    float h = dht.readHumidity();
    float t = dht.readTemperature();         
    Serial.print("Current humidity = ");
    Serial.print(h);
    Serial.print("%  ");
    Serial.print("temperature = ");
    Serial.print(t); 
    Serial.println("C  ");
  delay(800);
}

Credits

raj thavti

raj thavti

1 project • 2 followers
I am a techi who is passionate on building electronics stuff , Robotics , Automation and alot
Thanks to Raj kumar thavti.

Comments