Arduino Tutorials

DHT11 interfacing with Arduino uno

In this tutorial, we’ll learn DHT11 interfacing with arduino uno. DHT11 is a low cost sensor (temperature and humidity) which can be used for less precise application. you don’t have to calibrate these sensor. because these sensors are calibrated by manufacturer itself.

Materials required

  • Arduino uno
  • dht11 sensor
  • Resistor

Circuit arrangement

Source code :

#include

dht DHT;

#define DHT11_PIN 4

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

void loop()
{
int chk = DHT.read11(DHT11_PIN);

Serial.print(“Temp = “);
Serial.print(DHT.temperature);
Serial.print(” “);
Serial.print(“Humidity = “);
Serial.print(DHT.humidity);
Serial.println(” “);
if(DHT.temperature > 35)
{
//put your condition here
}
else{
//put your else condition here
}
}

Leave a Reply