Arjun Gopkumar
Published © GPL3+

Humidity Sensor Basics

Get started with the DHT11 module, this tutorial deals with the ones which may not be compatible with the adafruit libaries

BeginnerProtip15 minutes479
Humidity Sensor Basics

Story

Read more

Schematics

uploads2ftmp2f03476344-42af-4dd5-8efc-28115577a8f42fimg_20190909_185720_Rjr8NBk3DO.jpg

Code

Code snippet #1

Plain text
#include<dht.h><br>
dht DHT;

//Set the pin for the DHT sensor
#define DHT11_PIN 6

void setup()
{
  Serial.begin(115200);
  Serial.println("DHT TEST PROGRAM ");
  Serial.print("LIBRARY VERSION: ");
  Serial.println(DHT_LIB_VERSION);
  Serial.println();
  Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)");
}

void loop()
{
  // DISPLAY DATA
  Serial.print(DHT.humidity, 1);
  Serial.print(",\t");
  Serial.println(DHT.temperature, 1);

  delay(2000);
}
//
// END OF FILE
//

Credits

Arjun Gopkumar
5 projects • 1 follower
Engineering student , I create just because I can and to possibly make the world a better place . I hack for the love of it.

Comments