Introduction: DISPLAY HUMIDITY AND TEMPERATURE ON LCD WITH ARDUINO NANO

About: I'm a student of Uva Wellassa university Of Sri lanka. studying Mechatronics under Faculty of science and technology.

The following Instructable deals with making a simple lcd interface with arduino nano.

Step 1: Requirements:

    Requirements

    1. DTH11 Humidity and Temperature Sensor
    2. Arduino Nano
    3. 16*2 LCD display
    4. I2C module
    5. Connecting wires

    And

    • Arduino IDE
    • Arduino libraries

    I2c library(LiquidCrystal_I2C)

    DHT library(DHT.h)

    Step 2: Connect Components to Nano

    Connect components to nano as the screen shot,
    DTH11 To Arduino Nano

    Vcc --> 3.3V

    GND --> GND

    Out --> D4 I2C

    Lcd to Nano

    GND -->GnD

    SDA --> A4

    SCL --> A5

    Vcc -->5V

    Step 3: Include Libraries

    Download and include Below libraries,

    DHT sensor library(DHT.h)

    I2c library(LiquidCrystal_I2C.h)

    Include as above image.

    Go to ketch--> Include Library --> Add Zip File and then browse the folder,

    Close the IDE and open it again,

    You can download libraries from below links also,

    https://bitbucket.org/fmalpartida/new-liquidcrysta...

    https://codeload.github.com/adafruit/DHT-sensor-li...

    Step 4: Scan the I2C and Find the Address

    Download the I2C scanner and find your i2c address and then enter it to the code;

    You can find the scanner code from here also.

    http://www.mediafire.com/file/f7oaa4et779yaaz/i2c_...

    Step 5: The CODE

    //Compile and upload the code to arduino nano

    #include "DHT.h"
    #define SensorPin 4 // connect the out pin of dht sensor to D4 pin of arduino nano

    #define Dht DHT11

    DHT dht(SensorPin, Dht);

    #include

    #include

    LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); //set I2C Address as 0x3F

    void setup() {

    Serial.begin(9600);

    lcd.begin(16,2);

    Serial.println("Temperature and Humidity Inteface");

    dht.begin();

    }

    void loop() {

    int hum = dht.readHumidity();

    int temp = dht.readTemperature();

    lcd.setCursor(0, 0);

    lcd.print("Temp: ");

    lcd.print(temp);

    lcd.print("C");

    lcd.setCursor(0,1);

    lcd.print("Humidity: ");

    lcd.print(hum);

    lcd.print("%");

    Serial.print("\nCurrent Temperature: ");

    Serial.print(temp);

    Serial.print("C");

    Serial.print("\nCurrent Humidity: ");

    Serial.print(hum);

    Serial.print("%");

    delay(2500);

    }

    Results are shown with above photos.

    Thanks,

    Dush.