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

Practical 11 1

This document outlines an assignment for students in the Internet of Things Laboratory, focusing on using Raspberry Pi to interface with LEDs and DHT11 sensors for monitoring temperature and humidity. It includes objectives, required materials, and step-by-step instructions for programming and connecting the hardware. The conclusion emphasizes the practical applications of these technologies in environmental monitoring.

Uploaded by

notolerance0728
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)
6 views

Practical 11 1

This document outlines an assignment for students in the Internet of Things Laboratory, focusing on using Raspberry Pi to interface with LEDs and DHT11 sensors for monitoring temperature and humidity. It includes objectives, required materials, and step-by-step instructions for programming and connecting the hardware. The conclusion emphasizes the practical applications of these technologies in environmental monitoring.

Uploaded by

notolerance0728
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/ 5

Department of Information Technology BE – Internet of Things Laboratory

Correctness Documentation Timely Dated Sign of


Write-up Viva Total
of Program of Program Completion Subject Teacher
2 2 2 2 2 10

-----------------------------------------------------------------------------------------------------------------------------------------
Assignment No. 03 Date of Performance: ………………….………………
-----------------------------------------------------------------------------------------------------------------------------------------
Title: Open source prototype platform- Raspberry-Pi/Beagle board/Arduino - Simple program digital
read/write using LED and Switch - Analog read/write using sensor and actuators.
-----------------------------------------------------------------------------------------------------------------------------------------
Objective: To get knowledge for communicating with objects using sensors and actuators.
-----------------------------------------------------------------------------------------------------------------------------------------
Theory:

An application of blinking LEDs using Raspberry Pi


In this assignment, we will learn how to interface an LED with Raspberry Pi. To implement this, we will
gather the requirements and follow the instructions given below.

Requirements:
1. Raspberry Pi3 Kit
2. Breadboards
3. LEDs
4. Jumper wires

SNJB’s Late Sau. K. B. Jain College of Engineering, Chandwad Dist. Nashik (MS, India)
Department of Information Technology BE – Internet of Things Laboratory

Instructions to Glow LED:


Use GPIO diagram of Raspberry Pi, which will give you understanding of GPIO structure.

Algorithm:

SNJB’s Late Sau. K. B. Jain College of Engineering, Chandwad Dist. Nashik (MS, India)
Department of Information Technology BE – Internet of Things Laboratory

1. Connect GPIO 18 (Pin No. 12) of Raspberry Pi to the Anode of the LED through connecting
jumper wires and Breadboard.
2. Connect Ground of Raspberry Pi to Cathode of the LED through connecting wires and
breadboard.
3. Now power up your Raspberry Pi and boot.
4. Open terminal and type nano blinkled.py
5. It will open the nano editor. Use following pseudo code in the python to blink LED and save

import RPi.GPIO as GPIO


import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
while True:
GPIO.output(18, GPIO.HIGH)
time.sleep(1)
GPIO.output(18, GPIO.LOW)
time.sleep(1)

6. Now run the code. Type python blinkled.py


7. Now LED will be blinking at an interval of 1s. You can also change the interval by modifying
time.sleep in the file.
8. Press Ctrl+C to stop LED from blinking.

An application to read the environment temperature and humidity & display it.
In this assignment, we will learn how to find environment temperature and humidity using DHT11
sensor and Raspberry Pi.

Temperature and Humidity Sensor- DHT11


 It’s a very basic and slow sensor, easy to use for small scale.
 The DHT sensors are made of two parts, a capacitive humidity sensor and 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 microcontroller.
 These sensors are frequently used in remote weather stations, soil monitors, and home
environment control systems.

Features of DHT11 Sensor: -


 Ultra-low cost
 3 to 5V power and I/O
 2.5mA max current use during conversion (while requesting data)
 Good for 20–80% humidity readings with 5% accuracy
 Good for 0–50°C temperature readings ±2°C accuracy
 No more than 1 Hz sampling rate (once every second)
 Body size 15.5mm x 12mm x 5.5mm
 4 pins with 0.1" spacing

SNJB’s Late Sau. K. B. Jain College of Engineering, Chandwad Dist. Nashik (MS, India)
Department of Information Technology BE – Internet of Things Laboratory

Requirements:
1. Raspberry Pi3 Kit
2. Breadboards
3. DHT11 Sensor
4. Jumper wires

Algorithm:
1. Connect GPIO 18 (Pin No. 12) of Raspberry Pi to the Data pin of DHT11 sensor through
connecting jumper wires and Breadboard.
2. Connect Power (5V) and Ground of Raspberry Pi to DHT11 sensor through connecting wires
and breadboard.
3. Now power up your Raspberry Pi and boot.
4. Download Adafruit_Python_DHT.tar.gz package
5. Open terminal and type tar -xvzf Adafruit_Python_DHT.tar.gz command to extract Adafruit
package.
6. In the same terminal, type nano temp.py
7. It will open the nano editor. Use following pseudo code in the python to blink LED and save

import Adafruit_DHT as dht


import time

while True:
hum, temp = dht.read_retry(11,18)
print "Temp: ", temp
print "Hum: ", hum
time.sleep(1)

8. Now run the code. Type python temp.py


9. Now temperature and humidity will be displayed at an interval of 1s. You can also change the
interval by modifying time.sleep in the file.
10. Press Ctrl+C to stop displaying temperature and humidity.

SNJB’s Late Sau. K. B. Jain College of Engineering, Chandwad Dist. Nashik (MS, India)
Department of Information Technology BE – Internet of Things Laboratory

-----------------------------------------------------------------------------------------------------------------------------------------
Conclusion: - Thus, we have studied how to monitor LEDs and measure temperature and humidity in
the environment using DHT11 sensor and Raspberry Pi 3.
-----------------------------------------------------------------------------------------------------------------------------------------

SNJB’s Late Sau. K. B. Jain College of Engineering, Chandwad Dist. Nashik (MS, India)

You might also like