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

IoT Lab Assign 2

This document discusses interfacing a DHT11 temperature and humidity sensor with a Raspberry Pi. It describes the hardware components, theory of operation, safety precautions for setup, steps to assemble the circuit, and a Python code algorithm to read sensor values and display temperature and humidity continuously.

Uploaded by

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

IoT Lab Assign 2

This document discusses interfacing a DHT11 temperature and humidity sensor with a Raspberry Pi. It describes the hardware components, theory of operation, safety precautions for setup, steps to assemble the circuit, and a Python code algorithm to read sensor values and display temperature and humidity continuously.

Uploaded by

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

Interfacing Temperature cum Humidity sensor (DHT-11)

with Raspberry Pi board


Aim/Objectives:
 To understand the concept of Temperature-Humidity sensor (DHT11)
 To interface Temperature-Humidity sensor with Raspberry Pi model
 To program the Raspberry Pi model to measure the real time Temperature and Humidity of
the Environment

Software:
 Raspbian OS (IDLE)

Hardware Modules:
 Raspberry Pi Board module
 Temperature-Humidity sensor (DHT11) module
 Monitor

Theory:

 Physical quantities like Humidity, temperature, pressure etc. are monitored to get
information about the environmental conditions.
 Temperature is basically amount of heat present in environment. Humidity is the presence of
water vapors in air. The Temperature & amount of water vapor in air can affect human
comfort as well as many manufacturing processes in industries. The presence of water vapor
also influences various physical, chemical, and biological processes.
 In our module we are using “DHT11 Temperature and Humidity Sensor”.
 The features of this sensor are, calibrated digital signal output, and high reliability and
excellent long-term stability.
 This sensor has a resistive-type humidity measurement component in which resistivity of
semiconductor material changes as per humidity in environment changes.
 This sensor also includes NTC temperature measurement component which detects the
change in temperature.
 DHT11 basically provides two outputs from single data pin semiconductor material

28
Safety precautions:
 Raspberry-Pi provides 3.3V and 5V VCC pins
 Raspberry-Pi operates on 3.3V.
 Various sensors and actuators operate on different voltages.
 Read datasheet of a given sensor or an actuator and then use appropriate VCC pin to
connect a sensor or an actuator.
 Ensure that signal voltage coming to the Raspberry-Pi from any sensor or actuator does not
exceed 3.3V.
 If signal/data coming to Raspberry-Pi is greater than 3.3V then use voltage level shifter
module to decrease the incoming voltage.
 The Raspberry-Pi is a costly device, hence you should show the circuit connections to your
instructor before starting your experiment.

Interface diagram:

Steps for assembling circuit:


 Connect the VCC pin of Temperature & Humidity sensor (DHT11) to VCC pin of Raspberry Pi
module
 Connect the DATA pin of Temperature & Humidity sensor (DHT11) to GPIO pin 15 of
Raspberry Pi module
 Connect the GND pin of Temperature & Humidity sensor (DHT11) to GND pin of Raspberry Pi
module

Procedure to install dht11 library:


 Open LXTerminal of Raspberry Pi and enter the following commands.
 sudo apt-get update
 sudo apt-get install git-core
29
 cd ~
 git clone https://github.com/szazo/DHT11_Python.git
 cd DHT11_Python
 sudo python setup.py install

Procedure
 Write the program as per the algorithm given below.
 Save program in the library folder .
 Run code using Run module.

Algorithm:
 Import GPIO, time and dht11 libraries
 Set all the warnings as False
 Set mode i.e. GPIO.BOARD
 Read data using GPIO pin number 7 (dhtPin)
 Write ‘while loop’ for displaying Temperature and Humidity values continuously
 First Read the GPIO pin and Store the data in dhtValue Variable.
 Print the temperature value.
 Print the Humidity value.
 Give delay of 1 second

Observation:
 Observe the output on python shell as per program
 Observe the ON and OFF status of the buzzer

30

You might also like