IoT Lab Assign 2
IoT Lab Assign 2
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:
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