The following system measures the Temperature and Humidity and gives the data in the two forms, In section 7.2 it will display on the LCD display and In section 7.3 measured data will be sent to the given mobile number.
7.1. Interfacing Temperature and humidity sensor with Arduino
Vcc pin of DHT11 sensor is connected to 5V pin of Arduino,DATA
pin of sensor is connected to A0 of Arduino and Gnd pin of DHT11 is connected to Gnd pin of Arduino.
DHT11 Sensor
|
Arduino
|
Vcc
|
5V
|
DATA
|
A0
|
Gnd
|
Gnd
|
7.2. DHT11
sensor with LCD
7.2.1. Circuit diagram:
7.2.2. Arduino program:
#include <dht.h>
#include <LiquidCrystal.h>
#define dht_dpin A0
LiquidCrystal lcd(12, 11, 2, 3, 4, 5);
dht DHT;
void setup(){
Serial.begin(9600);
lcd.begin(16,2);
}
void loop(){
DHT.read11(dht_dpin);
Serial.print("Current
humidity = ");
Serial.print(DHT.humidity);
Serial.print("%
");
Serial.print("temperature
= ");
Serial.print(DHT.temperature);
Serial.println("C
");
lcd.clear()
lcd.print("Humidity:
");
lcd.setCursor(0,1);
lcd.print(DHT.humidity);
lcd.print("
%");
delay(1000);
lcd.clear();
lcd.print("Temperature:");
lcd.setCursor(0,1);
lcd.print(DHT.temperature);
lcd.print("
C");
delay(1000);
}
7.2.3. Outputs of the system
7.3. DHT11 sensor with GSM-SIM 900
7.3.2. Arduino Program:
#include <dht.h>
#define dht_dpin A1
dht DHT;
void setup()
{
Serial.begin(9600);
Serial.print(“\r”);
}
void loop()
{
DHT.read11(dht_dpin);
Serial.print("AT+CMGF=1\r");
delay(1000);
Serial.print("AT+CMGS=\"+919542081456\"\r"); //Number
to which you want to send the SMS want to send the SMS
delay(1000);
Serial.print("Temperature:
");
Serial.print(DHT.temperature); //The
text of the message to be sent
Serial.print(" C
");
Serial.print("Humidity:
");
Serial.print(DHT.humidity);
Serial.print("
%");
delay(1000);
Serial.write(0x1A);
delay(1000);
}
Let me know if you have any queries ?
helpful post
ReplyDeletethnks to admin..