0% found this document useful (0 votes)
5 views

E2 Practical 1 Temperature andHumidity Sensing withArduino

The document outlines a practical exercise for interfacing a DHT11 temperature and humidity sensor with an Arduino. It includes objectives, apparatus, circuit diagram, theory, procedure, and a sample program for data reading. The aim is to study the sensor's functionality and observe the output on the serial monitor.

Uploaded by

salvivinit73
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

E2 Practical 1 Temperature andHumidity Sensing withArduino

The document outlines a practical exercise for interfacing a DHT11 temperature and humidity sensor with an Arduino. It includes objectives, apparatus, circuit diagram, theory, procedure, and a sample program for data reading. The aim is to study the sensor's functionality and observe the output on the serial monitor.

Uploaded by

salvivinit73
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Group B: Practical No.

1
Temperature and Humidity Sensing Using Arduino

AIM: To study the interfacing of Temperature and Humidity sensor to Arduino

OBJECTIVES:
1. To study the basics of Temperature and Humidity Sensor (DHT11)
2. To study circuit diagram to interface DHT11 sensor to Arduino
3. To develop a program for DHT11 sensor interface.
4. To test the circuit and interfacing and see the sensor output on serial monitor

APPERATUS: Arduino UNO board, DHT11 Sensor, Power USB Cable, Arduino UNO IDE,
connecting wires

CIRCUIT DIAGRAM:

THEORY:
The DHT11 is a basic, ultra-low-cost digital temperature and humidity sensor. It uses a capacitive
humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on
the data pin (no analog input pins needed). It is fairly
simple to use, but requires careful timing to grab data.
The DHT sensors are made of two parts, a capacitive
humidity sensor and a thermistor. There is also a very
basic chip inside that does some analog to digital
conversion and spits out a digital signal with the
temperature and humidity. The digital signal is fairly
easy to read using any micro-controller.
Specifications:
1. 3 to 5V power and I/O
2. 5mA max current use during conversion (while requesting data)
3. Good for 20-80% humidity readings with 5% accuracy
4. Good for 0-50 °C temperature readings +-2 °C accuracy
5. No more than 1 Hz sampling rate (once every second)
6. Body size 15.5mm x 12mm x 5.5mm
7. 4 pins with 0.1" spacing

PROCEDURE:
1. Open the Arduino IDE software and close the previous project work.
2. Select ‘File menu option and select ‘New Project’ & create project name (without any
extension).
3. After generation of project, generate a code as per pin requirements.
4. After developing the code, save the file with.
5. You may now compile the file, for that click on ‘Compile’ option.
6. After compile, connect Arduino Board to Computer by Connecting USB Port Cable.
7. After this ‘Upload’ the program into Arduino Board Microcontroller. For this click on,
‘Upload’
8. Now observe the execution on serial monitor (on your screen)
---------------------------------------------------------------------------------------------------------------------
PROGRAM TO INTERFACING DHT11 SENSOR TO ARDUINO BOARD
---------------------------------------------------------------------------------------------------------------------

#include <SimpleDHT.h>

#include <SimpleDHT.h>

// for DHT11,
// VCC: 5V or 3V
// GND: GND
// DATA: 2
int pinDHT11 = 2;
SimpleDHT11 dht11(pinDHT11);

void setup(){
Serial.println("Sample DHT11...");
Serial.begin(9600);
}

void loop()
{
byte temperature = 0;
byte humidity = 0;
int err = SimpleDHTErrSuccess;
if ((err = dht11.read(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess)
{
Serial.print("Read DHT11 failed, err=");
Serial.print(SimpleDHTErrCode(err));
Serial.print(",");
Serial.println(SimpleDHTErrDuration(err));
delay(1000);
return;
}
Serial.print((int)temperature);
Serial.print(" *C, ");
Serial.print((int)humidity);
Serial.println(" H");
delay(1500);
}

--------------------------------------------------------------------------------------------------------------
RESULT:

--------------------------------------------------------------------------------------------------------------

CONCLUSION:

Teacher’s sign_____________
Remark by Teacher:

You might also like