0% found this document useful (0 votes)
56 views4 pages

IoT 2.2

This document describes an experiment to investigate the real-time relationship between humidity and temperature using IoT. It involves using a DHT11 temperature and humidity sensor connected to an Arduino board to collect data. The experiment's procedure connects the sensor, uploads code to read the sensor values, and monitors the output in the serial monitor. The output displays temperature and humidity data every 2 seconds along with turning on LEDs if the values exceed certain thresholds. Analysis of humidity and temperature data in IoT applications can provide insights to optimize processes in various sectors like agriculture, healthcare, and more.

Uploaded by

Ashish Goswami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views4 pages

IoT 2.2

This document describes an experiment to investigate the real-time relationship between humidity and temperature using IoT. It involves using a DHT11 temperature and humidity sensor connected to an Arduino board to collect data. The experiment's procedure connects the sensor, uploads code to read the sensor values, and monitors the output in the serial monitor. The output displays temperature and humidity data every 2 seconds along with turning on LEDs if the values exceed certain thresholds. Analysis of humidity and temperature data in IoT applications can provide insights to optimize processes in various sectors like agriculture, healthcare, and more.

Uploaded by

Ashish Goswami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Experiment – 2.

Student Name: Aditya Kumar UID: 21BCS11563


Branch: BE- CSE Section/Group: 21BCS_IOT 616/A
Semester: 5th Subject Name: Internet of Things Lab
Subject Code: 21CSP-344

1. Aim:
To investigate real-time relationship between humidity and temperature in IoT.

2. Objectives:

1. Learn about IoT based simulations.


2. Testing and mode l in IoT based simulation platform.
3. Components Required:
• Arduino Board
• Breadboard
• Jumper Wires
• DH11 Temperature and Humidity Sensor

4. Theory:
DH11 Sensor: DHT11 Module features a temperature & humidity sensor complex with a calibrated digital
signal output. The exclusive digital-signal-acquisition technique and temperature & humidity sensing
technology ensure high reliability and excellent long-term stability. This sensor includes an NTC for
temperature measurement and a resistive-type humidity measurement component for humidity
measurement. These are connected to a high-performance 8-bit microcontroller, offering excellent quality,
fast response, anti-interference ability, and cost-effectiveness.

5. Procedure:
A. Hardware Connections:
Connect the DHT22 sensor to the Arduino:
• VCC pin to 5V
• GND pin to GND
• DATA pin to digital pin 2
• Connect one leg of the first LED to digital pin 13 through a resistor.
• Connect one leg of the second LED to digital pin 12 through another resistor.
B. Upload Code:
• Open Arduino IDE.
• Copy and paste the provided code into a new sketch.

• Ensure that the "DHT" library is installed in the Arduino IDE.


• Select your Arduino board and COM port in the Tools menu.
• Upload the code to the Arduino.
C. Monitor Serial Output:
• Open the Serial Monitor in the Arduino IDE.
• Set the baud rate to 115200.
• Observe temperature and humidity data being printed in the Serial Monitor.

6. Script and Output:


#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
int ledPin1 = 13;
int ledPin2 = 12;
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(115200);
Serial.println(F("DHT22example!"));
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
dht.begin();
}
void loop()
{
float temperature = dht.readTemperature();
float humidity = dht.readHumidity();
// Check if any reads failed and exit early (to try
again). if (isnan(temperature) || isnan(humidity))
{
Serial.println(F("Failed to read from DHT sensor!"));
return;
} if(temperature<30)
{ digitalWrite(ledPin1,
HIGH);
} if(humidity>30)
{
digitalWrite(ledPin2, HIGH);
}
Serial.print(F("Humidity: "));
Serial.print(humidity);
Serial.print(F("% Temperature: "));
Serial.print(temperature);
Serial.println(F("°C "));
delay(2000);
}

7. Output:
8. Scope:
The scope of humidity and temperature monitoring in IoT encompasses real-time data collection,
analysis, and applications in diverse fields such as agriculture, healthcare, energy efficiency, and
environmental monitoring. It aims to optimize processes, enhance decision-making, and improve
overall quality of life by leveraging IoT devices to measure and respond to environmental condition
efficiently and intelligently.

9. Analysis:
Humidity and temperature analysis in IoT involves examining real-time data collected from sensors to
derive insights. This analysis helps optimize processes like HVAC, predict equipment maintenance
needs, and enhance environmental monitoring. It is essential in various sectors, from agriculture to
healthcare, for efficient resource management and decision-making, ultimately improving
productivity and quality of life.

10. Learning Outcomes :

• Learned about DH11 Temperature and Humidity Sensor.

• Learned how to use Wokwi.

• Learned about LCD & Working of Arduino .

You might also like