Friday, November 7, 2014

DHT11 Interfacing with MATLAB and Arduino

Abstract: In this project we are going to interface digital Humidity and temperature sensor (DHT11) with Arduino Uno board and with MATLAB. we are going to display the temperature and Humidity data, received from DHT11, in LCD screen and also plotting them in MATLAB simultaneously.

From the datasheet it mentioned that DHT11 outputs 40bits of data. It contains 8-bits integral RH data+ 8-bits Decimal RH data+8-bits Integral Temperature data+8-bits decimal Temperature data+8-bits check sum. Read datasheet[3] for more details. The library for DHT11 sensor is available in the resources. Add the library[4] in this path "C:\Program Files (x86)\Arduino\libraries\DHT11" (In my case). 

Connect DHT11 sensor to the Arduino Uno board as shown in the below figure and also plug your Arduino board to PC/Laptop.
Now open Arduino IDE tool and run DHT11_Arduino_code[1] and upload it on to the board.
Open MATLAB and run the DHT11_MATLAB_code[2].  
                                      
                                                         Working Video
Resources:




Temperature Monitoring using Arduino Uno

In this project we are going to monitor room Temperature with Arduino Uno board. Connect the temperature sensor LM35 as shown in the figure. Output of the LM35 is connected to the Analog port A0, itreads the temperature variation and it displays the digital data on to the LCD screen. Run the code given below.

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("Temp monitoring");
}

void loop() {
  float temp;
  temp=analogRead(0);
  lcd.setCursor(0, 1);
  lcd.print("Temperature=");
  lcd.print(temp);
  delay(100);
}