0% found this document useful (0 votes)
12 views34 pages

IOT

Uploaded by

devbhatth69
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)
12 views34 pages

IOT

Uploaded by

devbhatth69
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/ 34

MALINI KISHOR SANGHVI COLLEGE T.Y.

BscIT (SEM - V)

INDEX

SR.NO DATE NAME OF THE PRACTICAL SIGNATURE

0. 15-06-2024 Starting Raspbian OS, Familiarizing with


Raspberry Pi Components and interface,
Connecting to ethernet, Monitor, USB.
1. 29-06-2024 Displaying different LED patterns with
Raspberry Pi.
2 06-07-2024 Displaying Time over 4-Digit 7-Segment
Display using Raspberry Pi.
3. 20-07-2024 Perform a practical for Raspberry Pi 3
based Oscilloscope.
4. 03-08-2024 Controlling Raspberry Pi with Telegram.

5. 17-08-2024 Fingerprint Sensor interfacing with


Raspberry Pi.
6. 29-08-2024 Interfacing Pi Camera with Raspberry
Pi.
7. 12-09-2024 Interfacing Raspberry Pi with RFID.

NISHA PATEL - 122 ADVANCED WEB DEVELOPMENT


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

PRACTICAL NO : 0
Aim : Starting Raspbian OS, Familiarizing with Raspberry Pi
Components and interface, Connecting to ethernet, Monitor, USB.

Explanation :

Micro-USB Power Supply:- A 5V micro USB typically powers the


Raspberry Pi. But how much current (in milliamps or amps) the Pi
requires to function depends on your usage.

Secure Digital Card slot (SD Card):- is a solid-state removable


storage device which is required to run operating systems on Raspberry
Pi as Raspberry Pi doesn’t have any onboard memory and data storage
functionality. Raspberry Pi supports both SDHC (Secure Digital High
Capacity) and SDXC (Secure Digital eXtended Capacity).

HDMI (High Definition Multimedia Interface):- HDMI Port enables


Raspberry Pi to be connected to HDTV via HDMI cable. Raspberry Pi
supports maximum resolution of 1920x1030. With the help of HDMI
Full HD MPEG-4 can be streamed via HDMI.

Camera Module Port:- Pi Camera module is a camera which can be


used to take pictures and high definition video.
Raspberry Pi Board has CSI (Camera Serial Interface) interface to
which we can attach Pi Camera module directly.

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

This Pi Camera module can attach to the Raspberry Pi’s CSI port using
15-pin ribbon cable.

Audio jack:- This is a standard 3.55-millimeter jack for connection of


audio output devices such as headphones or speakers, it can also
connect headphones or speakers here.

Ethernet Port:- The Ethernet port of the raspberry pi is the main


gateway for communicating with additional devices. The raspberry pi
Ethernet port is used to plug your home router to access the internet.

USB Port:- The number and type of USB ports on Raspberry Pi


depends on the model. The Raspberry Pi Model B is equipped with two
USB 2.0 ports; the B+, 2B, 3B and 3B+ have four USB
ports.

GPIO:- These pins can be used in programs to read electrical signals


from circuits as well as provide electrical signals for controlling
circuits.

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

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 :

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

CMD :

CONNECTIONS :

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

OUTPUT :

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

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)

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

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”

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

OUTPUT:

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

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

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

using python3
$ python3 ads1x15_simpletest.py
CODE :

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

CONNECTIONS :

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

CMD:

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

OUTPUT :

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

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:

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

CODE :

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

OUTPUT :
TO TURN THE LED ON - TYPE /ON

TO TURN THE LED OFF - TYPE /OFF

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

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 :

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

CONNECTIONS:

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

OUTPUT:

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

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 :

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

STEPS:
i. Sudo raspi-config

ii. Select System Options

iii. Select interfacing options cameraenable

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

iv. Sudo reboot


v. After Reboot, Create a folder which is used to store pictures
captured by Pi Camera. [i.e. test.jpg]
(E.g. /home/pi/Desktop/Visitors)
vi. Write a Python Script to capture images and save them in
folder. (capture_record_picamera.py)
vii. Sudo apt-get install python-picamera
viii. Sudo apt-get install python3-picamera
ix. Sudo pip install picamera

CONNECTIONS :

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

OUTPUT :

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

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.

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

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 :

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

CODE :
RFID Read:

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

RFID Write:

import RPi.GPIO as GPIO


from mfrc522 import SimpleMFRC522 reader = SimpleMFRC522()
try:
text = input('New data:')
print("Now place your tag to write")
reader.write(text)
print("Written")
finally:
GPIO.cleanup()
CONNECTIONS :

SAMIKSHA C SAWANT 126 INTERNET OF THINGS


MALINI KISHOR SANGHVI COLLEGE TY-BSC.IT (SEM - V)

OUTPUT:

SAMIKSHA C SAWANT 126 INTERNET OF THINGS

You might also like