LESSON 8 - The Measurment of Temperature and Humidty with DHT11 and I2C module on 16x2 LCD Display





The 16x2 LCD display conrol have been made with serial i2C module (Figure - 1)  in this lesson. I' ve measured humudity and teparature with DHT 11 module and I've displayed the values on the LCD display.


Figure 1 - Serial I2C LCD Module

Serial I2C LCD Module

The using LCD displays (Figure 2) with your Arduino is popular, however the amount of wiring requires time and patience to wire it up correctly and also uses a lot of digital output pins. That’s why we love these serial backpack modules they’re fitted to the back of your LCD module and allows connection to your Arduino  with only four wires power, GND, data and clock. So with this I2C interface LCD module, you will be able to realize data display via only 2 wires. If you already has I2C devices in your project, this LCD module actually cost no more resources at all. It is fantastic for Arduino based project.


Figure 2 - 16x2 LCD Display Module

DHT 11 Module

DHT11 (Figure 3) digital temperature and humidity sensor is a composite Sensor contains a calibrated digital signal output of the temperature and humidity. Application of a dedicated digital modules collection technology and the temperature and humidity sensing technology, to ensure that the product has high reliability and excellent long-term stability. The sensor includes a resistive sense of wet components and an NTC temperature measurement devices, and connected with a high-performance 8-bit microcontroller.


Figure 3 - DHT 11 Temperature and Humidty Module

Pin Description
1 - the VDD power supply 3.5~5.5V DC
2 - DATA serial data, a single bus
3 - NC, empty pin
4 - GND ground, the negative power

The Connection of LCD Display and I2C Module
The Connection of LCD Display and I2C Module is made (Figure 4).

Figure 4 - The Connection of LCD Display and I2C Module

The Measurment of The Temperature and Humidty Circuit
Firstly I've conected the i2c module to  LCD Display (Figure 5). Then I've set the mesurment circuit (Figure 6).

Figure 5 - The LCD display and I2C Module

Figure 6 - The Measurment of The Temperature and Humidty Circuit

Arduino UNO Program
#include <Wire.h>
#include <LiquidCrystal_I2C.h> 
#include <DHT11.h> 
#include <Math.h> 
int pin=8; 
DHT11 dht11(pin); 

//  The initialization LCD Display
LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3, POSITIVE);

void setup()
{
     lcd.begin (16,2);

void loop()
{
    float nem,sicaklik;
    int oku = dht11.read(nem,sicaklik); //(Reading the temperature and humidty)
    lcd.setBacklight(HIGH);

    // Displaying the Temperature
    lcd.setCursor(0,0);  //  First character - First Line
    lcd.print("Temp :"); 
    lcd.setCursor(6,0); 
    lcd.print(sicaklik, 2); 
    lcd.setCursor(11,0); 
    lcd.print((char) 223); //Degree Character
    lcd.setCursor(12,0); 
    lcd.print("C"); 

    // Displaying the Humudity
    lcd.setCursor(0,1); //   First character -Second Line
    lcd.print("Humid:"); 
    lcd.setCursor(6,1); 
    lcd.print(nem, 2); 
    lcd.setCursor(12,1); 
    lcd.print("%"); 
    delay(500); 
}

Project Files
You can download project files by clickin the links.


Video Of Lesson