Professional Documents
Culture Documents
Lab Exercise 4
Following items are required for the basic setup of Raspberry PI:
Step 6. Select the Device and browse the Image File as in step # 2
Step 1. Open the terminal and enter the command sudo raspi-config
Raspberry PI board has 40 GPIO pins on one edge of the board. All GPIOs can be configured as either
digital output or digital input. When a GPIO pin is configured as digital output, onboard controller can
turn it high or low. An external digital signal can be sensed by the controller when applied to GPIO which
is configured as input. Visit following link for details on the GPIO pins available on Raspberry Pi board:
https://www.raspberrypi.org/documentation/usage/gpio/
Step 2. Run the VNCViewer and type the IP address of your Raspberry Pi board. (Press Enter)
Step 3. It will prompt login dialog box. Enter the following credentials
Username: gts-pc
Password: gts
Step 4. Now you can access RPi’s desktop
V. Lab Exercise (i) : Blinking LED
In this exercise you have to configure one of the GPIO pins as digital output, and blink the LED.
1 LED
1 Breadboard (optional)
Laptop/PC
The LED's terminal should be connected to RPi as shown in the below table
Negative 14 (GND)
Follow these steps to run the Python script on RPi for blinking the LED:
Step 3: Go through blinking_led.py. Make sure that you understand the process of configuring GPIO as
output and toggling it at regular interval. (What is the on and off time of the LED?)
As part of this lab exercise, you would configure GPIO as input (Choose a different pin this time), hook
up a temperature and humidity sensor to it, retrieve the data on your laptop and finally plot it in real-
time.
1 Breadboard
Laptop/PC
The 3 pins of DHT11 sensor should be connected to the Pi as shown in the below table.
VCC 3.3 V 1
GND Ground 9
You also need to carry out following steps to do software setting on RPi, for retrieving data from sensor
(PLEASE SKIP THESE STEPS. ALREADY DONE.):
cd Adafruit_Python_DHT
DHT11_sensor.py - https://drive.google.com/open?id=1N5WSwvAfyZFESnIvx7MnrMbRcEbmrltB
- send temperature and humidity data to client on PC whenever the data is available.
Temp_n_Humdity_Monitor.py - https://drive.google.com/open?id=11EiddOTzJE2uP1GHHxKZCs3-Y-
x1UqpS
Step 2: In RPi, open the terminal (through VNC Viewer) and run the DHT11_sensor.py
1. LED should blink only when the temperature rises above certain threshold. The threshold
temperature will be given to you by instructor or TA. The LED should blink with 25% duty cycle,
i.e. 0.5 sec on time and 1.5 sec off time. (Show the outcome to TA or instructor.)
2. Modify the design such that LED blinking frequency increases with increase in temperature.