Iotes Exp2
Iotes Exp2
EXPERIMENT NO. 02
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.
MMANTC Page 1 IOT and Embedded System
Exp. No. 2 Raspberry-Pi / Beagle board with temperature sensor
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.
INTERFACING DIAGRAM:
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
There are two variants of the DHT11 you‟re likely to come across. One is a four pin stand alone
module, and the other is a three pin, PCB mounted module. The pin out is different for each one,
so connect the DHT11 according to which one you have:
PROGRAM:
#Setup
# Program
import Adafruit_DHT
import time
import Adafruit_DHT
import time
while True:
else:
time.sleep(3);
CONCLUSION:_______________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
__________________________________________________________________________
ASSESMENT:
ASSIGNMENT
Create a circuit using Raspberry Pi, DHT11 and Buzzer. Write a program when the
temperature goes beyond 35 degrees, the buzzer will start ringing.