Yazn Balfas
Published © GPL3+

Monitoring Temperature using DHT 11

How to see temperature using DHT 11

BeginnerShowcase (no instructions)1 hour364
Monitoring Temperature using DHT 11

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
×1
Female/Female Jumper Wires
Female/Female Jumper Wires
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

DHT11_CODE

C/C++
DHT11
#include "DHT.h"
#define DHTpin 5
#define DHTTYPE 11

DHT dht(5, DHT11);

void setup(){
  Serial.begin(9600);
  dht.begin();
}

void loop()
{ 
  float h = dht.readHumidity();
  float t = dht.readTemperature();  Serial.print(F("Humidity: "));
  Serial.print(h);
  Serial.print("\n");
  Serial.print(F("  Temperature: "));
  Serial.print(t);
  Serial.print(F("°C "));
  delay(2000);
}

Credits

Yazn Balfas
7 projects • 2 followers
Contact

Comments

Please log in or sign up to comment.