Skip to content
Advertisements

Measure temperature/humidity using DHT11 + LCD i2c + Arduino

 

Hi everyone, yassine here,


In this tutorial we gonna see how to simply use the DHT11 module, It’s a module that can measure temperature (0-50C) and humidity (up to 95%), it’s very good for domotic projects or DIY projects for daily use.


For this we gonna need:

-DHT 11 (obvious 😃 ) note here that I’m using 3 pins version there are 4 pins one

-Arduino board here I’ll use Uno

-LCD i2c screen 

– Breadboard and jump wires


-And here to download the dht library it’s very simple (Download dht library)

-How to use LCD i2c (LCD i2c tutorial)

 

Wiring:

 

Codes and libraries:

DHT library: Download library here

Codes: Download codes here

Advertisements

Yassine View All

Electronics, Automation engineering student... I try to share my little experience with other electronics amateur.

13 thoughts on “Measure temperature/humidity using DHT11 + LCD i2c + Arduino Leave a comment

    • Hi, if you’re talking about the libraries they’re in .ZIP format just go to Arduino IDE -> Sketch -> Include library -> Add .ZIP library and look for the library file and it will install.
      For the codes just extract the .RAR file and you’ll find codes .INO there.

      Like

  1. Arduino: 1.8.3 (Windows 10), Board: “Arduino/Genuino Uno”

    DHT11_LCD:24: error: expected ‘)’ before numeric constant

    LiquidCrystal_I2C lcd ( I2C_ADDR 0x27 ,En_pin 2 ,Rw_pin 1 ,Rs_pin 0 ,D4_pin 4 ,D5_pin 5 ,D6_pin 6 ,D7_pin7 ) ;

    ^

    DHT11_LCD:24: error: expected ‘)’ before numeric constant

    LiquidCrystal_I2C lcd ( I2C_ADDR 0x27 ,En_pin 2 ,Rw_pin 1 ,Rs_pin 0 ,D4_pin 4 ,D5_pin 5 ,D6_pin 6 ,D7_pin7 ) ;

    ^

    DHT11_LCD:24: error: expected ‘)’ before numeric constant

    LiquidCrystal_I2C lcd ( I2C_ADDR 0x27 ,En_pin 2 ,Rw_pin 1 ,Rs_pin 0 ,D4_pin 4 ,D5_pin 5 ,D6_pin 6 ,D7_pin7 ) ;

    ^

    DHT11_LCD:24: error: expected ‘)’ before numeric constant

    LiquidCrystal_I2C lcd ( I2C_ADDR 0x27 ,En_pin 2 ,Rw_pin 1 ,Rs_pin 0 ,D4_pin 4 ,D5_pin 5 ,D6_pin 6 ,D7_pin7 ) ;

    ^

    DHT11_LCD:24: error: expected ‘)’ before numeric constant

    LiquidCrystal_I2C lcd ( I2C_ADDR 0x27 ,En_pin 2 ,Rw_pin 1 ,Rs_pin 0 ,D4_pin 4 ,D5_pin 5 ,D6_pin 6 ,D7_pin7 ) ;

    ^

    DHT11_LCD:24: error: expected ‘)’ before numeric constant

    LiquidCrystal_I2C lcd ( I2C_ADDR 0x27 ,En_pin 2 ,Rw_pin 1 ,Rs_pin 0 ,D4_pin 4 ,D5_pin 5 ,D6_pin 6 ,D7_pin7 ) ;

    ^

    DHT11_LCD:24: error: expected ‘)’ before numeric constant

    LiquidCrystal_I2C lcd ( I2C_ADDR 0x27 ,En_pin 2 ,Rw_pin 1 ,Rs_pin 0 ,D4_pin 4 ,D5_pin 5 ,D6_pin 6 ,D7_pin7 ) ;

    ^

    DHT11_LCD:24: error: ‘D7_pin7’ was not declared in this scope

    LiquidCrystal_I2C lcd ( I2C_ADDR 0x27 ,En_pin 2 ,Rw_pin 1 ,Rs_pin 0 ,D4_pin 4 ,D5_pin 5 ,D6_pin 6 ,D7_pin7 ) ;

    ^

    D:\DHT11_LCD\DHT11_LCD.ino: In function ‘void setup()’:

    DHT11_LCD:33: error: ‘class LiquidCrystal_I2C’ has no member named ‘setBacklightPin’

    lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);

    ^

    DHT11_LCD:33: error: ‘POSITIVE’ was not declared in this scope

    lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);

    ^

    Multiple libraries were found for “dht.h”
    Used: C:\Users\User\Documents\Arduino\libraries\DHT
    Not used: C:\Users\User\Documents\Arduino\libraries\DHTLib
    exit status 1
    expected ‘)’ before numeric constant

    This report would have more information with
    “Show verbose output during compilation”
    option enabled in File -> Preferences.
    So this happened. PLEASE HELP

    Like

    • Hello, first please read that you have multiple DHT libraries !!! So use only one and delete the other

      Multiple libraries were found for “dht.h”
      Used: C:\Users\User\Documents\Arduino\libraries\DHT
      Not used: C:\Users\User\Documents\Arduino\libraries\DHTLib

      Like

  2. what the fuck is this why i have to use this web side just post the code no need to download the code
    i don’t trust you . sorry bud but it can be a virus

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: