IOT
IOT
BscIT (SEM - V)
INDEX
PRACTICAL NO : 0
Aim : Starting Raspbian OS, Familiarizing with Raspberry Pi
Components and interface, Connecting to ethernet, Monitor, USB.
Explanation :
This Pi Camera module can attach to the Raspberry Pi’s CSI port using
15-pin ribbon cable.
PRACTICAL NO :1
AIM : Displaying different LED patterns with Raspberry Pi.
Hardware Requirements:
i. Raspberry pi
ii. LED Display
iii. Power supply
iv. Ethernet Cable / Wi Fi
v. Monitor , Keyboard, Mouse (Optional ,For without headless
connection)
Software Requirements:
1. Raspbian Stretch OS
2. Python Script
CODE :
CMD :
CONNECTIONS :
OUTPUT :
PRACTICAL NO : 2
Aim : Displaying Time over 4-Digit 7-Segment Display using
Raspberry Pi.
Hardware Requirements:
i. Raspberry pi
ii. 4 digit 7 Segment Display
iii. Jumper wires (Female to Female)
iv. Power supply
v. Ethernet Cable / Wi Fi
vi. Monitor, Keyboard, Mouse
Software Requirements:
1. Raspbian Stretch OS
2. Python Script
PIN CONFIGURATION:
Board Pin Function RPI Raspberry
Physical Pin Function
GND Ground 14 GND
VCC + 5V Power 4 5V
D11 Data In 18 GPIO 24
CLK Clock 16 GPIO 23
CODE :
import sys
import time
import tm1637
import datetime
import RPi.GPIO as GPIO
Display=tm1637.TM1637(23,24,tm1637.BRIGHT_TYPICAL)
Display.Clear()
Display.SetBrightnes(1)
while(True):
now = datetime.datetime.now()
hour = now.hour
minute = now.minute
second = now.second
currenttime = [ int(hour / 10), hour % 10, int(minute / 10), minute
% 10 ] Display.Show(currenttime)
Display.ShowDoublepoint(second % 2)
time.sleep(1)
TO INSTALL TM1637
Create a new folder “ 4digitTime” under /home/pi
Now Go To TERMINAL/COMMAND PROMPT and type
1 . Pwd (make sure you are in the 4digitTime Folder, if not then
type cd4digitTime)
2 . wget https://raspberrytips.nl/files/tm1637.py
3 . Now in thonny
Save the code in the 4digitTime file with the name “python
clock.py”
OUTPUT:
PRACTICAL NO : 3
AIM : Perform a practical for Raspberry Pi 3 based Oscilloscope.
Hardware Requirements:
1. Raspberry pi 2 (or any other model)
2. 8 or 16GB SD Card LAN/Ethernet Cable
3. Power Supply or USB cable ADS1115 ADC
Software Requirements:
1. Raspbian Stretch OS
2. Adafruit module for interfacing with the ADS1115 ADC
chip
3. Python Module matplotlib used for data visualization
Pin Configuration:
Boar Function RPI Raspberry
Physical Function
d Pin Pin
GND Ground 6 GND
VDD + 5V Power 2 5V
SDA Inter- 3 GPIO 2
Integrated
Circuit
SCL Inter- 5 GPIO 3
Integrated
Circuit
STEPS:
//First visit to the link of Adafruit ADC Oscilloscope given below
https://learn.adafruit.com/adafruit-4-channel-adc-breakouts/python-
circuitpython
//Need to install the ADC packages from Adafruit by using pip3
$ sudo pip3 install adafruit-circuitpython-ads1x15
$ sudo pip3 install adafruit-blinka
$ git clone
https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15
$ cd Adafruit_CircuitPython_ADS1x15 $
cd examples
//There will be a program name ads1x15_simpletest.py and run it by
using python3
$ python3 ads1x15_simpletest.py
CODE :
CONNECTIONS :
CMD:
OUTPUT :
PRACTICAL NO :4
AIM : Controlling Raspberry Pi with Telegram.
Hardware Requirements:
1. Raspberry Pi (with internet connection)
2. Mobile phone with telegram app.
Steps :
1. Open telegram app
2. Search BotFather and click on start
3. Create new bot using : /newbot
4. Provide name for your bot eg : LEDBOT
5. Provide username eg : LEDMKSITBOT
6. After this BotFather will give a token to access the HTTP API
7. In cmd type: Sudo apt-get install python-pip, Sudo pip install
8. Write code in thonny
9. In cmd type cd and foldername where telegram code is stored.
10. Pwd
11. Ls
12. Python codename.py
CONNECTIONS:
CODE :
OUTPUT :
TO TURN THE LED ON - TYPE /ON
PRACTICAL NO :5
AIM : Interfacing Fingerprint sensor with Raspberry Pi.
Hardware Requirements
i. Raspberry pi
ii. Fingerprint sensor
iii. Power supply
iv. Ethernet Cable / Wi Fi
v. Monitor , Keyboard, Mouse (Optional ,For without headless
connection)
Software Requirements
1. Raspbian Stretch OS
2. Python Script
CODE :
CONNECTIONS:
OUTPUT:
PRACTICAL NO :6
AIM : Interfacing Pi Camera with Raspberry Pi.
Hardware Requirements
i. Raspberry pi
ii. Camera module
iii. Power supply
iv. Ethernet Cable / Wi Fi
v. Monitor , Keyboard, Mouse (Optional ,For without headless
connection)
Software Requirements
1. Raspbian Stretch OS
2. Python Script
CODE :
STEPS:
i. Sudo raspi-config
CONNECTIONS :
OUTPUT :
PRACTICAL NO : 7
AIM : Interfacing Raspberry Pi with RFID.
Hardware Requirements:
1. Raspberry Pi 3 Model B
2. 8 or 16GB SD Card
3. Power Supply or USB Cable
4. RC522 RFID Reader and Tags
5. Jumper Wires
Software Requirements
1. Raspbian Stretch OS
2. Python Script
Pin Configuration:
Board Function RPI Physical Raspberry
Pin Function
Pin
GND Ground 6 GND
SDA Inter-Integrated 24 GPIO 8
Circuit
SCK Serial clock 23 GPIO 11
MOSI Master out slave in 19 GPIO 10
MISO Master in slave out 21 GPIO 9
RST Reset 22 GPIO 25
3.3 V Power Output Pin 1 3.3 V PWR
STEPS:
1. Sudo apt-get update
2. Sudo apt-get upgrade
3. Sudo raspi-config
4. lsmod | grep spi
5. sudo apt-get install python3-dev python3-pip
6. sudo pip3 install spidev
7. sudo pip3 install mfrc522
8. There are two files included in this repository:
MFRC522.py which is an implementation of the
RFID RC522 circuit. SimpleMFRC522.py that
takes the MFRC522.py file and greatly simplifies
it.
9. Pwd
10. mkdir rfiddemo
11. cd rfiddemo/
12. pwd
13. sudo nano write.py
14. sudo python3 write.py
15. name : DEV
16. Write a Python script to read this data back off
RFID tag.
17. Pwd
18. sudo nano read.py
19. sudo python3 read.py
CMD :
CODE :
RFID Read:
RFID Write:
OUTPUT: