Professional Documents
Culture Documents
Experiment 2.2
1. Aim:
Interfacing of Arduino/Raspberry Pi with temperature and humidity sensor with real time application.
2. Objective:
3. Requirements:
4. Procedure:
Figure:1
The following image shows the circuit diagram for interfacing the DHT11 sensor module with Arduino.
Figure:2
5. Code/Program:
#include <DHT.h>
dht DHT;
#define DHT11_PIN 7
#define tone_PIN 8
void setup()
{
Serial.begin(9600); }
void loop()
{
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
int chk=DHT.read11(DHT11_PIN);
Serial.print("Temperature: ");
Serial.print(DHT.temperature);
Serial.print("Humidity: ");
Serial.print(DHT.humidity); delay(1000);
if(DHT.temperature>=30)
{
tone(8,1000);
delay(1000);
}
}
Figure 3: CIRCUIT
FIGURE 4: CIRCUIT
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty):
Sr. No. Parameters Marks Obtained Maximum Marks
1.
DEPARTMENT OF