hIOTron
Created January 28, 2020 © GPL3+

Humidity and Temperature Measurement using Arduino

In this project, we are going to calculate the surrounding temperature and humidity and the same will display it on a 16x2 LCD screen.

Humidity and Temperature Measurement using Arduino

Things used in this project

Story

Read more

Code

Run a program

Arduino
#include<dht.h>      // Including library for dht
#include<LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

#define dht_dpin 12 

dht DHT;

byte degree[8] = 
              {
                0b00011,
                0b00011,
                0b00000,
                0b00000,
                0b00000,
                0b00000,
                0b00000,
                0b00000
              };

void setup()
{
 lcd.begin(16, 2);
 lcd.createChar(1, degree);
 lcd.clear();
 lcd.print("   Humidity   ");
 lcd.setCursor(0,1);
 lcd.print("  Measurement ");
 delay(2000);
 lcd.clear();
 lcd.print("Circuit Digest ");
 delay(2000);
}

void loop()
{
  DHT.read11(dht_dpin);
  lcd.setCursor(0,0);
  lcd.print("Humidity: ");
  lcd.print(DHT.humidity);   // printing Humidity on LCD
  lcd.print(" %");
  lcd.setCursor(0,1);
  lcd.print("Temperature:");
  lcd.print(DHT.temperature);   // Printing temperature on LCD
  lcd.write(1);
  lcd.print("C");
  delay(500);
}

Credits

hIOTron

hIOTron

78 projects • 2 followers
hIOTron is an internet of things based company that offers an IoT Platform, products, IoT Solutions, and IoT Training.

Comments