Temperature and Humidity Sensor

Temperature and Humidity Sensor © GPL3+

Easy to build temperature and humidity sensor with a cheap 2x16 LCD.

  • 5,167 views
  • 1 comment
  • 15 respects

Components and supplies

About this project

This is just my first project on Ardiuno Project Hub.

Very simple to build, but may be usefull for those, who are looking for informations, how to connect DHT11 sensor (sketch was written in acordance with newest DHT library - april 2018).

So just build it, hack it and share it ;)

Code

DHT11 temperature and humidity sesnor with LCD on Arduino LeonardoArduino
Easy temperature and humidity sensor on DHT11 with LCD
// DHT11 sensor

#include <DHT.h>
#define DHTPIN 7 // what digital pin we're connected to
#define DHTTYPE DHT11  //DHT 11

// LCD display

#include <LiquidCrystal.h>;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

DHT dht (DHTPIN, DHTTYPE); //Initialize DHT sensor.


void setup() {
  // put your setup code here, to run once:


// Serial.begin(9600);
dht.begin();

}

void loop() {
 delay(10000); // Waiting time between measurements
 
float t = dht.readTemperature(); // Read temperature in *C (default)
float h = dht.readHumidity(); // Read humidity %

float hic = dht.computeHeatIndex(t, h);


/*Serial.print("Temerature: ");
Serial.print(t);
Serial.print("*C\t");
Serial.print("Humidity: ");
Serial.print(h);
Serial.print("%\t");
Serial.print("Heat index: ");
Serial.println(hic);
*/



// LCD display

lcd.begin(16, 2); // display diamensions
lcd.setCursor(0,0);
lcd.print("T=");
lcd.setCursor(2,0);
lcd.print(t);
lcd.setCursor(4,0);
lcd.print("*C ");
lcd.setCursor(0,1);
lcd.print("H=");
lcd.setCursor(2,1);
lcd.print(h);
lcd.setCursor(4,1);
lcd.print("%  ");
lcd.setCursor(8,1);
lcd.print("HI=");
lcd.print(hic);

}

Schematics

DHT11 temperature and humidity sesnor with LCD on Arduino Leonardo
Simple temperature and humidity sensor with LCD
temp_wilgot_on8VZkfgh1.fzz
DHT11 temperature and humidity sesnor with LCD on Arduino Leonardo
Temp wilgot bb brlkhpneoa

Comments

Similar projects you might like

Arduino Temperature - Humidity - Rain Sensor

Project showcase by Rick_Findus

  • 8,743 views
  • 6 comments
  • 15 respects

DHT11 Humidity + Temperature Sensor with 16x2 LCD display

Project showcase by onatto22

  • 9,054 views
  • 1 comment
  • 17 respects

Beautifully Finished Humidity and Temperature Sensor

Project tutorial by Wicked Makers

  • 16,862 views
  • 21 comments
  • 135 respects

Temperature + Humidity on LCD

Project showcase by interpeo

  • 21,011 views
  • 11 comments
  • 49 respects

Temperature sensor

Project tutorial by Grant

  • 12,271 views
  • 6 comments
  • 30 respects
Add projectSign up / Login