0% found this document useful (0 votes)
1K views71 pages

Iot Practical Tyit

This document is a certificate submitted by Saifee Zoya Shamshad, a student at Chandrabhan Sharma College, for their practical work in the subject of Internet of Things. The certificate details the 12 practical experiments completed by the student under the guidance of their professor, Mr. Rawool Vijay Anil, as part of fulfilling the curriculum requirements for their Bachelor of Science in Information Technology degree from the University of Mumbai.

Uploaded by

Zoya
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)
1K views71 pages

Iot Practical Tyit

This document is a certificate submitted by Saifee Zoya Shamshad, a student at Chandrabhan Sharma College, for their practical work in the subject of Internet of Things. The certificate details the 12 practical experiments completed by the student under the guidance of their professor, Mr. Rawool Vijay Anil, as part of fulfilling the curriculum requirements for their Bachelor of Science in Information Technology degree from the University of Mumbai.

Uploaded by

Zoya
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/ 71

CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Submitted by:

Name : Saifee Zoya Shamshad


Class : TYIT
Roll No.: __14__
Subject: Enterprise Java

Submitted To :

Prof:- Mr. Rawool Vijal Anil

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

CERTIFICATE

This is to certify that Mr./Miss Saifee Zoya Shamshad having Exam Seat No.
of B.Sc.IT (Semester V) has complete the Practical work in the subject of
“Internet of Things” during the Academic year 2022-23 under the guidance of
Mr.Rawool Vijay Anil being the Partial requirement for The fulfilment of the curriculum
of Degree of Bachelor of Science in Information Technology, University of Mumbai.

Internal Examiner Co-ordinator

Date: External Examiner

College Seal

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Practical Details Date Sign


no.
0. Starting Raspbian OS, Familiarising with
Raspberry Pi Components and
interface, Connecting to ethernet, Monitor,
USB.

1. Displaying different LED patterns with


Raspberry Pi.

2. Displaying Time over 4-Digit 7-Segment


Display using Raspberry Pi

3. Raspberry Pi Based Oscilloscope

4. Controlling Raspberry Pi with WhatsApp.

5. Setting up Wireless Access Point using


Raspberry Pi

6. Fingerprint Sensor interfacing with Raspberry


Pi

7. Raspberry Pi GPS Module Interfacing

8. IoT based Web Controlled Home Automation


using Raspberry Pi

9. Visitor Monitoring with Raspberry Pi and Pi


Camera

10. Interfacing Raspberry Pi with RFID.

11. Building Google Assistant with Raspberry Pi.

12. Installing Windows 10 IoT Core on Raspberry


Pi

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

PRACTICAL NO.-0
AIM:
Starting Raspbian OS, Familiarising with Raspberry Pi Components and
interface, connecting to ethernet, Monitor, USB.
Solution:-
The Raspberry Pi Components:-
 Raspberry Pi
 ARM CPU/GPU
 GPIO
 RCA
 Audio out
 LEDs
 USB
 HDMI
 Power
 SD cardslot
 Ethernet
 Wi-Fi

Raspberry Pi:-
 The Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer
monitor or TV, and uses a standard keyboard and mouse. It is a capable little device that
enables people of all ages to explore computing, and to learn how to program in languages
like Scratch and Python.
 The Raspberry Pi device looks like a motherboard, with the mounted chips and ports
exposed but it has all the components you need to connect input, output, and storage
devices and start computing.
 The most recent model is the Raspberry Pi 3 Model B+, but other models include the
Raspberry Pi Model A, the Raspberry Pi Zero and the Raspberry Pi Zero WiFi.
 Most models are capable of doing everything you would expect a desktop computer to do,
from browsing the internet and playing high-definition video, to making spreadsheets,
word-processing, and playing games.
 The Raspberry Pi has sold tens of millions of units across the world and is used by everyone
from hackers, to engineers, students, hobbyists and scientists.

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

ARM CPU/GPU: This is a Broadcom BCM2835 System on a Chip (SoC) that's made up of
an ARM central processing unit (CPU) and a Videocore 4 graphics processing unit (GPU).
The CPU handles all the computations that make a computer work (taking input, doing
calculations and producing output), and the GPU handles graphics output.
 GPIO: These are exposed general-purpose input/output connection points that will allow
the real hardware hobbyists the opportunity to tinker.
 RCA: An RCA jack allows connection of analog TVs and other similar output devices.
 Audio out: This is a standard 3.55-millimeter jack for connection of audio output devices
such as headphones or speakers. There is no audio in.
 LEDs: Light-emitting diodes, for all of your indicator light needs.
 USB: This is a common connection port for peripheral devices of all types (including your
mouse and keyboard). Model A has one, and Model B has two. You can use a USB hub to
expand the number of ports or plug your mouse into your keyboard if it has its own USB
port.
 HDMI: This connector allows you to hook up a high-definition television or other
compatible device using an HDMI cable.
 Power: This is a 5v Micro USB power connector into which you can plug your compatible
power supply.
 SD cardslot: This is a full-sized SD card slot. An SD card with an operating system (OS)
installed is required for booting the device. They are available for purchase from the
manufacturers, but you can also download an OS and save it to the card yourself if you
have a Linux machine and the wherewithal.
 Ethernet: This connector allows for wired network access and is only available on the
Model B.
 Wi-Fi: WiFi, or 802.11, is a wireless protocol that was built with the intent of replacing
Ethernet using wireless communication over unlicensed bands. Its goal was to provide off-
the-shelf, easy to implement, easy to use short-range wireless connectivity with cross-
vendor interoperability.
 LCD Monitor: A 16×2 display unlike a touchscreen or a regular LCD screen is best used
to display short messages or information. You will find it extremely handy when you only
need to display some essential data but don’t really need anything too large and expensive.

Starting Raspbian OS
Raspbian OS:-
 Raspbian is the Raspberry Pi’s most popular operating system, a spin off of the Linux
distribution Debian that works well on the Raspberry Pi’s hardware.
 Raspbian is a competent and versatile operating system that gives your Raspberry Pi all the
comforts of a PC: a command line, a browser, and tons of other programs.
 You can use a Raspberry Pi running Raspbian as a cheap and effective home computer, or
you can use it as a springboard and turn your Raspberry Pi into any of countless other
functional devices, from wireless access points to retro gaming machines.

Installation Step for Raspbian OS:


Software Requirement
1. RASPBIAN STRETCH WITH DESKTOP ISO
2. Win32 Disk Imager

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

3. SD Card Formatter.

Hardware Requirement:-
1. A Well Configured Desktop PC or Laptop
2. Memory Card Reader
3. SD Card minimum 8GB with Class C or 10.
STEP-1
Download all the required software from the following link
1. SD Card Formatter
https://www.sdcard.org/downloads/formatter_4/

2. Win32 Disk Imager


https://sourceforge.net/projects/win32diskimager/

3. RASPBIAN STRETCH WITH DESKTOP ISO


https://www.raspberrypi.org/downloads/raspbian/

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

STEP-2
After downloading all components install SD card Formatter and Win32 Disk Imager
Double click on SD Card Formatter Setup

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

After Above Screen one pop will come click on yes

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Now install Win32 Disk Imager


Double click on Win32 Disk Imager Setup file

Click on Yes

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

STEP 3:
Unzip the file
The Raspbian disc image is compressed, so you’ll need to unzip it.
You can use any of the unzip tools to unzip the compressed file like WinRAR, Winzip7 and any
inbuilt windows zip file.

STEP 4
Format the SD Card with SD card Formatter tool
Attach SD Card with SD Card Reader and plug into the System
Open SD Card Formatter Tool

Select Card from drop down list and Click on Format.

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

STEP 5:
Write the disc image to your microSD card
Connect SD Card with SD Card Reader to the Desktop system
Open Win32 Disk Imager

Select ISO image file of Raspbian OS Which is extract in previous step and also select
appropriate device.

Click on Write

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

After successful write remove SD Card Reader from system and then remove SD Card from SD
Card Reader.

STEP 6:
Put the microSD card in your Pi and boot up
You’re ready to go! Put that sucker into your Rasberry Pi, plug in the peripherals and power source,
and enjoy.
The current edition to Raspbian will boot directly to the desktop. Your default credentials are
username pi and password raspberry.

STEP 7:
Startup the Raspbian OS
Insert into your Raspberry Pi and any other extra cords such as power, mouse, keyboard, Monitor,
Ethernet or Wi-Fi and the HDMI cord.
Power on the Raspberry Pi
Setting up the Pi
Please remember that after booting the Pi, there might be situations when the user credentials
like the "username" and password will be asked. Raspberry Pi comes with a default user name and
password and so always use it whenever it is being asked. The credentials are:
Login: pi
Password: raspberry

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

WITHOUT MONITOR HEADLESS SETUP


Here we have to follow till the installation Step, later as we don’t have a monitor we have few
other steps which will help enable the VNC on RPi to take a remote access of the RPi desktop.
This use of VNC enables us to work on RPi with a headless setup.
There are certain software required to perform this procedure.
1. Putty
2. Advanced IP Scanner
3. Notepad ++ / Sublime Text
4. Tight VNC server & Tight VNC viewer
After the OS installation on the SD Card. We have to copy certain files into the SD card, in the
boot drive. The new latest Raspbian image have the SSH disabled by default. Due to which we
cannot take a remote directly of the system. For which we’ll follow certain steps.
1. Create a file in notepad++ / sublime text called wpa_supplicant.conf, enter the content in it
as given below:
country=IN
update_config = 1
ctrl_interface=/var/run/wpa_supplicant
network={
scan_ssid=1
ssid=“my_network_id”
psk=“my_network_passowrd”
}
Here ssid and psk are your network credentials, which will change accordingly. Cross check the
ssid and password and it should be inside the double quotes. The country code will change
according to the country you are currently in.
2. Create a second blank file called ssh.
3. Copy these two files in to the boot partition of the SD card. Eject the SD card and insert it
into the raspberry pi and turn on the Pi after proper connections as described in the section
above.
4. After turning on the RPi, wait for some time for the RPi to connect the router. Start the
Advanced IP Scanner application on your PC. Provide the IP address to be scanned e.g.
192.168.0.1-254. This will scan all the devices connected to the network router. It will show
the device IP and manufacturers etc.
5. In the manufacturer column search for the name “Raspberry Pi Foundation”. This is the IP
address of your raspberry Pi.
6. After you find the IP address of the RPi, start the putty application on your PC. Put the IP
address in the space and keep the port number 22 as given by default. Connect to the RPi. It
will prompt you for a confirmation, click on ‘yes’ button & continue.
7. This will open up a prompt asking for user ID. Which by default is ‘pi’ and its default
password is ‘raspberry’.
8. Entering the credentials mentioned above it will get you the $ prompt to process further and
you have now successfully achieved the remote of your RPi.
9. Now type these commands to install the TightVNCserver on to the RPi.
sudo apt-get install tightvncserver
10. This will ask you for confirmation click Y and press enter. After the installation type the
command.

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

sudo tightvnserver
this command will ask you for a password to be set, enter tightvnc and confirm the same.
Now it will ask you for view only access say ’n’ for NO.
Now type the previous command again:
sudo tightvncserver
this will start the VNC server on your RPi machine, now note the number provided, this
number will be used to put the IP address and Port number while starting the Viewer
application.
11. Now to view the desktop of the RPi on your machine. Install the TightVNCviewer onto your
PC from this link: https://www.tightvnc.com/download.php
12. Choose the download according to your system, 32bit or 64bit processing. Also download
the DFM Mirage driver from the same page for best performance of the application.
For MAC users you can download the JAVA viewer Jar file and run the application.
13. While installing the TightVNCViewer application select typical install and click next. Enter
the first password as tightvnc and confirm the same, click on do not for the next set of
password and click install.
14. After installation run the tightvncviewer application. It will ask you for IP address and port
number. Put the IP address of your RPi and the port number as 590x. X is the number which
you noted down when you started the tightvncsever.
15. After you click on enter you’ll be prompted to enter the password, enter tightvnc as specified
while server installation. After a successful login you will be redirected to the Desktop of
RPi.

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

PRACTICAL No.-1
AIM:-
Displaying different LED patterns with Raspberry Pi.
Components Required:-
 Raspberry Pi Model with its Power Supply
 Jumper Wire
 LED
 Monitor
 USB Keyboard
 USB Mouse
 Breadboard
 Resistor

Wiring up the Circuit:


Connect 5 LED with Raspberry Pi's GPIO Pins.
LED Physical PIN Number GPIO Number
1 29 GPIO 05
2 31 GPIO 06
3 33 GPIO 13
4 35 GPIO 19
5 37 GPIO 26
For All LED One 39 GND
Ground Required

Circuit Diagram:-

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Source Code (BLINKLED.py):-


import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
led1=29
led2=31
led3=33
led4=35
led5=37
GPIO.setup(led1,GPIO.OUT)
GPIO.setup(led2,GPIO.OUT)
GPIO.setup(led3,GPIO.OUT)
GPIO.setup(led4,GPIO.OUT)
GPIO.setup(led5,GPIO.OUT)
while(1):
#LED ON CONDITION
GPIO.output(led1,False)
print("Led 1 ON")
time.sleep(1)
GPIO.output(led2,False)
print("Led 2 ON")
time.sleep(1.5)
GPIO.output(led3,False)
print("Led 3 ON")
time.sleep(2)
GPIO.output(led4,False)
print("Led 4 ON")
time.sleep(2.5)
GPIO.output(led5,False)
print("Led 5 ON")
time.sleep(3)
#LED OFF CONDITION
GPIO.output(led1,True)
print("Led 1 OFF")
time.sleep(3.5)
GPIO.output(led2,True)
print("Led 2 OFF")
time.sleep(4.0)
GPIO.output(led3,True)
print("Led 3 OFF")

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

time.sleep(4.5)
GPIO.output(led4,True)
print("Led 4 OFF")
time.sleep(5)
GPIO.output(led5,True)
print("Led 5 OFF")
time.sleep(5.5)
GPIO.cleanup()

RUN THE CODE:-


Two way we can run the code
1. Open Python IDE (3.5.3 Shell) and run from there.
Output

2. Run from terminal for that we need to type the following command
sudo python BLINKLED.py
Note:-
Make sure that before running above code we should need to check current
working directory of terminal after that we navigate to the particular directory
where the BLINKLED.py file is present.

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

PRACTICAL No.-2
AIM:-
Displaying Time over 4-Digit 7-Segment Display using Raspberry Pi
Introduction:-
For displaying small amount of data we prefer to use 4-digit 7-Segment display.
7-Segment and 4-Digit 7-Segment Display Module:
7 Segment Display has seven segments in it and each segment has one LED inside it to display the
numbers by lighting up the corresponding segments. Like if you want the 7-segment to display the
number "5" then you need to glow segment a, f, g, c, and d by making their corresponding pins
high. There are two types of 7-segment displays: Common Cathode and Common Anode, here we
are using Common Cathode seven segment display.

TM1637 4-DIGIT Seven Segment Display

Components Required:-
 Raspberry Pi with Power Supply
 TM1637 4-DIGIT Seven Segment Display
 Jumper wire

Wiring Up the TM1637 4-DIGIT Seven Segment Display:-


TM1637 BOARD PIN PHYSICAL PIN Number GPIO PIN Number
CLK 38 GPIO 20
DI0 (Data IN) 40 GPIO 21
VCC 2 DC POWER 5V
GND 6 Ground

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Circuit Design:-

Python Source Code:-


Note:
For Displaying the clock and IP Address on the 4-Digit 7 Segment display we will
download the special python scripts with predefine functions.
Various types of operation or function available to control the LED in that scripts.
Steps to Perform 4-Digit 7 Segment Display:-
Step1:
Create Folder under /home/pi/Documents/ 7segment by using following command
mkdir 7segment
Step2:
Download the Following file by using wget command
For Clock
wget https://github.com/timwaizenegger/raspberrypi-examples/blob/master/actor-
led-7segment-4numbers/clock.py
For IP Address
wget https://github.com/timwaizenegger/raspberrypi-examples/blob/master/actor-
led-7segment-4numbers/displayIP.py

OR

To download this library on to your Raspberry Pi do the following steps:


1. Open the browser on your PC and download a zip from from the given link:
https://github.com/timwaizenegger/raspberrypi-examples/tree/master/actor-led-
7segment-4numbers

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

2. Unzip the file, copy the file on to an usb drive and copy paste the same into the
/home/pi/Documents/7segment folder of your RPi.

Step3:
Open the Source Code of clock.py and displayIP.py simultaneous by using Python
IDLE (3.5.6) and run the code and see the output.
Source Code:
#For Display the time
from time import sleep
import tm1637
try:
import thread
except ImportError:
import _thread as thread

# Initialize the clock (GND, VCC=3.3V, Example Pins are DIO-20 and CLK21)
Display = tm1637.TM1637(CLK=21, DIO=20, brightness=1.0)
try:
print ("Starting clock in the background (press CTRL + C to stop):")
Display.StartClock(military_time=False)
print ('Continue Python script and tweak Display!')
sleep(5)
Display.ShowDoublepoint(False)
sleep(5)
loops = 3
while loops > 0:
for i in range(0, 10):
Display.SetBrightness(i / 10.0)
sleep(0.5)
loops -= 1
Display.StopClock()
thread.interrupt_main()
except KeyboardInterrupt:
print ("Properly closing the clock and open GPIO pins")
Display.cleanup()

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Run the Code:-


sudo python clock.py

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

For Displaying IP Address


displayIP.py
import time
import tm1637
import socket

# Initialize the display (GND, VCC=3.3V, Example Pins are DIO-20 and
CLK21)
Display = tm1637.TM1637(CLK=21, DIO=20, brightness=0.3)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("gmail.com", 80))
IP = s.getsockname()[0]
s.close()
print ("IP of RasPi is")
print IP
# Separate on comma.
numbers = IP.split(".")
# Loop and print each city name.
loops = 3
while loops > 0:
for number in numbers:
Display.ShowInt(number)

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

time.sleep(2)
loops -= 1
Display.Clear()
time.sleep(2)
print('done.')
Display.cleanup()

Run the Scripts:


sudo python displayIP.py

On Display it will showing first 192. Then 168. Then 0. Then 122 Continuously

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

PRACTICAL NO.-4
AIM:
Controlling Raspberry Pi with Telegram
SOLUTION:
HARDWARE REQUIREMENT:
 Raspberry Pi 3 Model B
 Jumper Wire
 Breadboard
 USB Keyboard
 USB Mouse
 LED
 Ethernet Cable or Wi-Fi Connectivity

SOFTWARE REQUIREMENT:
 Telegram App running on Mobile Phone

USING TELEGRAM BOT WITH RASPBERRY PI


 To share data (files/photos/videos/audios/text) between Raspberry Pi and our Mobile
phone through a popular chat application called Telegram.
 Telegram, it is a chat based application available in play store for Android (also available
for Iphone and windows) that is very similar to WhatsApp.
 One special features of this application is that they support bots. Meaning this smart phone
application can not only be used by Humans but also by machine. In our case the machine
will be Raspberry Pi.
 Once you train Raspberry Pi on how to act as a bot, anyone can chat with your Raspberry
Pi like chatting to any normal person and even share Photos Pictures Documents and Audio
files.

STEPS
Step 1: Open Telegram app in your system or mobile
1.1 Download and Open Telegram app in your system or mobile or we can use telegram web
also.

1.2 Start "BotFather"


1.3 Open "BotFather"
1.4 Start "BotFather"

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

1.5 Create a new Bot

1.6 Obtain access token

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Step 2: Setup Raspberry Pi


2.1 Connect Raspberry Pi 3 Model with USB Keyboard, USB Mouse, Ethernet Cable or Wi-Fi
and Monitor and power on the device.
2.2 Configure the Breadboard, LED and jumper Wire with Raspberry Pi.
Connect LED with Raspberry Pi's GPIO Pins (See the Additional Information).
RASPBERRY Pi’s BOARD PIN NO. GPIO PIN NO.
Pin 12 GPIO 18
Pin 6 GND

Step 3: Install TelegramBot on Raspberry Pi


3.1 To Using TelegramBot we have to install some required package by using following
command:
A. sudo apt-get install python-pip
B. sudo pip install telepot
Or
A. sudo apt-get install python-pip3
B. sudo pip3 install teleport
And
C. sudo apt-get update
D. sudo apt-get upgrade

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Step 4: Write the Python code and save it.


Code:
import sys
import time
import random
import datetime
import telepot
import RPi.GPIO as GPIO
try:
now = datetime.datetime.now()
GPIO.setwarnings (False)
# to use Raspberry Pi board pin numbers
GPIO.setmode(GPIO.BOARD)
# set up GPIO output channel
GPIO.setup(12, GPIO.OUT)
def handle(msg):
chat_id = msg['chat']['id']
command = msg['text']
print ('Got command: %s' % command)
if command == 'hi':
bot.sendMessage (chat_id, str("Hi! CSC"))
elif command == 'file':
bot.sendDocument(chat_id, document=open('/home/pi/mytelepotbot.py'))
elif command == 'time':
bot.sendMessage(chat_id, str(now.hour)+str(":")+str(now.minute))
elif command == 'logo':
bot.sendPhoto (chat_id, photo="http://www.iotleague.com/wp-
content/uploads/2015/11/Iot1.png")
elif command == 'audio':
bot.sendAudio(chat_id, audio=open('/home/pi/Downloads/Love Me Like You
Do.mp3'))
elif command == 'ON':
GPIO.output(12,GPIO.LOW)
elif command =='OFF':
GPIO.output(12,GPIO.HIGH)
bot = telepot.Bot('ACCESS TOKEN KEY')
bot.message_loop(handle)
print ('I am listening...')
while 1:
time.sleep(5)
finally:
GPIO.cleanup()

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Important Note:
 In above code you have to enter your access token key which is generated from step 1

Step 5: Run the Python Code


Open terminal type the following command to run the python code
sudo python mytelepotbot.py

Here is successful executed code now we have to connect LED with Raspberry Pi.
Step 6: Connect LED to Pi

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Step 7: Send Command


6.1 Start our Bot
6.2 Send "ON" & "OFF"
6.3 Send “hi”
6.4 Send “time”
6.5 Send “file”
6.6 Send “audio”

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

PRACTICAL No.-5
AIM:-
Setting up Wireless Access Point using Raspberry Pi
To setup the wireless access point created to provide (share) internet access to (with) connected
devices. So let’s begin creating Wi-Fi Hotspot with Raspberry Pi.
Required Components:
Hardware Requirement:
 Raspberry Pi 2
 8GB SD card
 WiFi USB dongle
 Ethernet cable
 Power supply for the Pi.
 Monitor (optional)
 Keyboard (optional)
 Mouse (optional)
Raspberry Pi the ability to serve as a wireless access point and to achieve this, we will need to
install and setup a software that equips the raspberry pi with this functionality along with a DHCP
server software to provide a network address for the devices which will be connected to the access
point.
Software Requirements:
 Putty
 The dnsmasq and the hostapd softwares

Steps for Setting up Raspberry Pi as Wireless Access Point


Step 1:
Update the Pi
sudo apt-get update
sudo apt-get upgrade

With the update done, reboot your pi to effect changes


Step 2:
Install “dnsmasq” and “hostapd”
We install the software that makes it possible to setup the pi as a wireless access point and also
the software that helps assign network address to devices that connect to the AP.
sudo apt-get install dnsmasq
sudo apt-get install hostapd
OR

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

sudo apt-get install dnsmasq hostapd

Step 3:
Stop the software from Running
We don’t have the software configured yet there is no point running it, so we disable them from
running in the underground. To do this we run the following commands to stop the systemd
operation.
sudo systemctl stop dnsmasq
sudo systemctl stop hostapd

Step 4:
Configure a Static IP address for the wireless Port
Confirm the wlan port on which the wireless device being used is connected. For my Pi, the
wireless is on wlan0. Setting up the Raspberry Pi to act as a server requires us to assign a static
IP address to the wireless port. This can be done by editing the dhcpcd config file.
To edit the configuration file, run;
sudo nano /etc/dhcpcd.conf

Scroll to the bottom of the config file and add the following lines.
Interface wlan0
static ip_address=192.168.52.1/24

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Save and exit for save press ctrl+O and ctrl+X


Restart the dhcpcd service to effect the changes made to the configuration using;
sudo service dhcpcd restart

Step 5:
Configure the dhcpcd server
To configure the dhcpcd server and provide it with the range of IP addresses to be assigned to
devices that connect to the wireless access point.
To do this, we need to edit the configuration file of the dnsmasq software but the config file of the
software contains way too much info and a lot could go wrong If not properly edited, so instead of
editing, we will be creating a new config file with just the amount of information that is needed to
make the wireless access point fully functional.
Before creating the new config file, we keep the old on safe by moving and renaming it.
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.old
Then launch the editor to create a new configuration file;
sudo nano /etc/dnsmasq.conf

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

with the editor launched, copy the lines below and paste in or type directly into it.
Interface = wlan0
dhcp-range = 192.168.52.2, 192.168.52.40, 255.255.255.0,24h

Save and exit.


Step 6:
Configure hostapd for SSID and Password
We need to edit the hostapd config file (run sudo nano /etc/hostapd/hostapd.conf) to add the
various parameters for the wireless network being setup including the ssid and password.
interface=wlan0
bridge=br0
ssid=nitnetwork
hw_mode=g
channel=7
country_code=IN
ieee80211n=1
ieee80211d=1
wmm_enabled=1

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

auth_algs=1
wpa=2
wpa_passphrase=nitcsc143
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
After the config file has been saved, we need to point the hostapd software to where the config file
has been saved. To do this, run;
sudo nano /etc/default/hostapd
Find the line with daemon_conf commented out.
Uncomment the DAEMON_CONF line and add the line below in between the quotes in front of
the “equal to” sign.

Step 7:
Fire it up
Since we disabled the two software initially, to allow us configure them properly, we need to restart
the system after configuration to effect the changes.
Use;
sudo systemctl start hostapd
sudo systemctl start dnsmasq

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Step 8:
Routing and masquerade for outbound traffic
We need to add routing and masquerade for outbound traffic.
To do this, we need to edit the config file of the systemctl by running:
sudo nano /etc/sysctl.conf
Uncomment this line net.ipv4.ip_forward=1

Next we move to masquerading the outbound traffic. This can be done by making some changes
to the iptable rule. To do this, run the following commands:
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
then save the Iptables rule using:
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Step 9:
Create Wireless Access Point on startup
To edit the rc.local file, run:
sudo nano /etc/rc.local
and add the following lines at the bottom of the system, just before the exit 0 statement
iptables-restore < /etc/iptables.ipv4.nat

Step 10:
Reboot! and Use
sudo reboot
Accessing the Internet from the Raspberry Pi’s Wi-Fi Hotspot
To implement this, we need to put a “bridge” in between the wireless device and the Ethernet
device on the Raspberry Pi (the wireless access point) to pass all traffic between the two interfaces.
To set this up, we will use the bridge-utils software. Install hostapd and bridge-utils. While we
have installed hostapd before, run the installation again to clear all doubts.
sudo apt-get install hostapd bridge-utils

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Next, we stop hostapd so as to configure the software.


sudo systemctl stop hostapd

When a bridge is created, a higher level construct is created over the two ports being bridged and
the bridge thus becomes the network device. To prevent conflicts, we need to stop the allocation
of IP addresses by the DHCP client running on the Raspberry Pi to the eth0 and wlan0 ports. This
will be done by editing the config file of the dhcpcd client to include denyinterfaces
wlan0 and denyinterfaces eth0 as shown in the image below.
The file can be edited by running the command;
sudo nano /etc/dhcpcd.conf

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Next, we create a new bridge called br0


sudo brctl addbr br0
Next, we connect the ethernet port (eth0) to the bridge (br0) using;
sudo brctl addif br0 eth0

Next, we edit the interfaces file using sudo nano /etc/network/interfaces so various devices can
work with the bridge. Edit the interfaces file to include the information below;
#Bridge setup
auto br0
iface br0 inet manual
bridge_ports eth0 wlan0

After that reboot the pi and scan for the wireless device

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

PRACTICAL NO.-7
AIM: -
Raspberry Pi GPS Module Interfacing
GPS plays a prominent role in the present-day navigation systems, starting out with smartphones
and automobiles to much complex missile guidance systems. the importance of GPS and to
understand how painstaking the navigation, without GPS, will be; plotting a course, getting lost,
and finally finding the way. communication between the Pi and a GPS module and there by reading
the latitude and longitude.
Raspberry Pi, interfaced with a GPS module, can be used for developing an advanced real-time
navigation system.

Required Components: -
Hardware Requirement: -
 Raspberry Pi
 GPS Module (Neo 6m v2 GPS Module)
 Jumper Wires
 Power supply (5v 100mA)

GPS RECEIVER MODULE WITH ANTENA

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Circuit Diagram: -

Connection of GPS Receiver Module with Raspberry Pi: -


GPS Receiver Module PHYSICAL PIN GPIO PIN NUMBER
PIN NUMBER
VCC PIN 01 3.3v
GND PIN 06 GND
TX PIN 10 GPIO 15
RX PIN 08 GPIO 14

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Steps for performing GPS Module Interfacing With Raspberry Pi:-


STEP1:
Updating the Raspberry Pi:
sudo apt-get update
sudo apt-get upgrade

STEP 2:
Setting up the UART in Raspberry Pi
The first thing we will do under this is to edit the /boot/config.txt file. To do this, run the
commands below:

sudo nano /boot/config.txt


at the bottom of the config.txt file, add the following lines
dtparam=spi=on
dtoverlay=pi3-disable-bt
core_freq=250
enable_uart=1
force_turbo=1

Press CTRL+O save and CTRL+X exit

force_turbo enables UART to use the maximum core frequency which we are setting in this case
to be 250. The reason for this is to ensure consistency and integrity of the serial data been received.

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

The dtoverlay=pi3-disable-bt disconnects the bluetooth from the ttyAMA0, this is to allow us
access to use the full UART power available via ttyAMAO instead of the mini UART ttyS0.

STEP2:
UART setup section is to edit the boot/cmdline.txt
I will suggest you make a copy of the cmdline.txt and save first before editing so you can revert to
it later if needed. This can be done using;
sudo cp boot/cmdline.txt boot/cmdline_backup.txt
sudo nano /boot.cmdline.txt
Replace the content with;
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4
elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles

Save and exit.


With this done then we will need to reboot the system again to effect changes (sudo reboot).

STEP3:
Disabling the Raspberry Pi Serial Getty Service
sudo systemctl stop [email protected]
sudo systemctl disable [email protected]

The following commands can be used to enable it again if needed


sudo systemctl enable [email protected]
sudo systemctl start [email protected]

Reboot the system.

STEP 4:
Activating ttyAMAO
We have disabled the ttyS0, next thing is for us to enable the ttyAMAO.
sudo systemctl enable [email protected]

STEP5:
Install Minicom and pynmea2
We will be minicom to connect to the GPS module and make sense of the data. It is also one of
the tools that we will use to test is our GPS module is working fine. An alternative to minicom is
the daemon software GPSD.
sudo apt-get install minicom
To easily parse the received data, we will make use of the pynmea2 library. It can be installed
using;
sudo pip install pynmea2

STEP 6:
Installing the LCD Library
git clone https://github.com/adafruit/Adafruit_Python_CharLCD.git

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

change into the cloned directory and install it


cd./Adafruit_Python_CharLCD
sudo python setup.py install

STEP7:-
Testing before Python Script
Run the command:
sudo minicom -D/dev/ttyAMA0 -b9600

where 9600 represents the baud rate at which the GPS module communicates. This may be used
for once we are sure of data communication between the GPS and the RPI, it’s time to write our
python script.
The test can also be done using cat
sudo cat /dev/ttyAMA0

STEP8:-
Writing the python source code:
MYGPS.py

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

import time
import serial
import string
import pynmea2
import RPi GPIO as gpio
#to add the LCD library
import Adafruit_CharLCD as LCD
gpio.setmode(gpio.BCM)
#declaring LCD pins
lcd_rs = 17
lcd_en = 18
lcd_d4 = 27
lcd_d5 = 22
lcd_d6 = 23
lcd_d7 = 10
lcd_backlight = 2
lcd_columns = 16 #Lcd column
lcd_rows = 2 #number of LCD rows
lcd = LCD.Adafruit_CharLCD(lcd = LCD.Adafruit_CharLCD(lcd_rs, lcd_en, lcd_d4,
lcd_d5, lcd_d6, lcd_d7, lcd_columns, lcd_rows, lcd_backlight)
port = "/dev/ttyAMA0" # the serial port to which the pi is connected.
#create a serial object
ser = serial.Serial(port, baudrate = 9600, timeout = 0.5)
while 1:
try:
data = ser.readline()
except:
print("loading")
#wait for the serial port to churn out data
if data[0:6] == '$GPGGA': # the long and lat data are always contained in the GPGGA
string of the NMEA data
msg = pynmea2.parse(data)
#parse the latitude and print
latval = msg.lat
concatlat = "lat:" + str(latval)
print concatlat
lcd.set_cursor(0,0)
lcd.message(concatlat)
#parse the longitude and print
longval = msg.lon
concatlong = "long:"+ str(longval)
print concatlong
lcd.set_cursor(0,1)
lcd.message(concatlong)

time.sleep(0.5)#wait a little before picking the next data.

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

PRACTICAL NO.-9
AIM:-
Visitor Monitoring with Raspberry Pi and Pi Camera
Project which is Visitors Monitoring System with Image capture functionality. Here we are
interfacing Pi camera with Raspberry Pi to capture the image of every visitor which has entered
through the Gate or door. In this project, whenever any person is arrived at the Gate, he has to
press a button to open the Gate, and as soon as he/she press the button, his/her picture will be
captured and saved in the system with the Date and time of the entry. This can be very useful for
security and surveillance purpose.
This system is very useful in offices or factories where visitor entry record is maintained for
visitors and attendance record is maintained for employees. This Monitoring system will digitize
and automate the whole visitor entries and attendances.

Component Requirements:-
Hardware Requirement:-
 Camera Module
 L293D Motor Driver Module
 DC Motor
 LED
 Push Button
 Resistors
 External 5V Power Supply
 Raspberry Pi and connection wires

L293D Motor Driver

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

PI CAMERA Connected With Raspberry Pi

Circuit Design:-

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

The DC motor is a machine that transforms electric energy into mechanical energy in form of
rotation. DC Motor is controlled by L293D driver IC Circuit. I make following connections to
connect DC motor to IC circuit, and then IC to Raspberry Pi’s GPIO Pins. I also provide external
power supply to IC.

Connection of L293D Module with Raspberry Pi:-


IC L293D PIN SR IC L293D PHYSICAL PIN GPIO PIN
NO PIN FUNCTION NUMBER NUMBER
2 IN1 Pin 11 GPIO 17
3 OUT1 Connects to Positive of DC Motor
4 ,5 GND Pins Pin 6 GND
6 OUT2 Connects to Negative of DC Motor
7 IN2 Pin 13 GPIO 27
8 +Vmotor Connects to Positive of External Battery
Power Supply
12,13 GND Pins Connects to Negative of External
Battery Power Supply
16 +V Pin 2 5v

Connect the LED to Raspberry Pi:-


LED PHYSICAL PIN GPIO PIN NUMBER
NUMBER
RED LED PIN 22 GPIO 25
GND PIN 39 GND

Connect the Push Button to Raspberry Pi:-


PUSH BUTTON PHYSICAL PIN GPIO PIN NUMBER
NUMBER
PUSH Button 1 PIN 23 GPIO 11
GND PIN39 GND

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Connect the Buzzer to Raspberry Pi:-


Buzzer PHYSICAL PIN GPIO PIN NUMBER
NUMBER
Buzzer PIN 24 GPIO 08
GND PIN 39 GND

Buzzer

System Functionality:-
Pi camera is used to capture the images of visitors, when a push button is pressed or triggered.
 A DC motor is used as a gate. Whenever anyone wants to enter in the place then he/she needs to
push the button.
 After pushing the button, Raspberry Pi sends command to Pi Camera to click the picture and
save it.
 After it, the gate is opened for a while and then gets closed again.
 The buzzer is used to generate sound when button pressed.
 LED is used for indicating that Raspberry Pi is ready to accept Push Button press, means when
LED is ON, and system is ready for operation.

Steps to perform visitor Monitoring system using Pi Camera


STEP1:-
Update the Pi
sudo apt-get update
sudo apt-get upgrade

STEP2:
Install Pi Camera Library
sudo apt-get install python-picamera
sudo apt-get install python3-picamera

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

STEP3:
Enable Raspberry Pi Camera by using Raspberry Pi Software Configuration Tool
(raspi-config):
sudo raspi-config
Then select Enable camera and Enable it.

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

STEP4:-
Then user needs to reboot Raspberry Pi, by issuing sudo reboot, so that new setting
can take. Now your Pi camera is ready to use.
sudo reboot

STEP5:-
After Reboot, Create a folder which is used to store pictures captured by Pi Camera.
(E.g. /home/pi/Desktop/Visitors)

STEP6:-
Write the Python Code and run the python code
sudo nano pivisit.py
sudo python pivisit.py

pivisit.py
import RPi.GPIO as GPIO
import picamera
import time
m11=17
m12=27
led=22
button=23
buz=24
buttonstatus = False
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(led, GPIO.OUT)
GPIO.setup(buz,GPIO.OUT)
GPIO.setup(m11,GPIO.OUT)
GPIO.setup(m12,GPIO.OUT)
GPIO.setup(button,GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.output(led, False)
GPIO.output(buzzer,False)
GPIO.output(m11,False)
GPIO.output(m12,False)
camera = PiCamera()
def capture_image():
print(" Taking Pic")
camera.start_preview()
time.sleep(3)

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

camera.capture("/home/pi/Desktop/Visitors/img.jpg")
camera.stop_preview()
def open_gate():
print("Welcome")
GPIO.output(m11,True)
GPIO.output(m12,False)
time.sleep(1.5)
GPIO.output(m11,False)
GPIO.output(m12,False)
time.sleep(3)
GPIO.output(m11,False)
GPIO.output(m12,True)
time.sleep(1.5)
GPIO.output(m11,False)
GPIO.output(m12,False)
print("Thank you")
time.sleep(4)
def beep():
GPIO.output(buz, True)
time.sleep(0.2)
GPIO.output(buz,Flase)
time.sleep(0.2)
GPIO.output(buz, True)
time.sleep(0.2)
GPIO.output(buz,Flase)
time.sleep(0.2)
try:
While True:
Print(" please Press Button to Open the gate")
buttonstatus = GPIO.input(button)
time.sleep(0.3)
if (buttonstatus == 0):
GPIO.output(LED, True)
beep()
capture_image()
open_gate()
time.sleep(3)
finally:
GPIO.cleanup()
OUTPUT:

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

PRACTICAL No.-10
AIM:-
Interfacing Raspberry Pi with RFID.
RFID or Radio Frequency Identification is a way of communication over electromagnetic wave
(Radio Frequency Waves, to be specific). RFID Tags and RFID Cards are often used for
authentication and access control.
You might have seen people swiping their identity cards at the entrance of their offices. The
identity card is in fact an RFID Card that has the personal information of the employee. The
moment he/she swipes the card, his check in time will be captured by a computer.
RFID Communication System comprises of three parts: an RFID Card or Tag (which contains the
user or product information embedded on a chip), an RFID Reader (a device which triggers the
RFID card and extracts the information from the Card) and a Host System (like a Computer or a
Microcontroller which then processes the data).
EM-18 RFID reader module is one of the commonly used reader and can read any 125KHz tags.
It features low cost, low power consumption, small form factor and easy to use. It provides both
UART and Wiegand26 output formats. It can be directly interfaced with microcontrollers using
UART and with PC using an RS232 converter.

EM-18 READER MODULE

Components Requirement:
 Raspberry Pi With Power Supply
 EM-18 RFID reader
 Connecting wires(Jumper Wire)

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

 Power Supply for RFID Reader


 Few RFID Cards or RFID Tags

Circuit Design:-
Demo:

Connection of RFID EM-18 Reader Module with Raspberry Pi


RM-18 READER PHYSICAL PIN GPIO PIN NUMBER
MODULE NUMBER
VCC External Power Supply -
Adapter
TX PIN 10 GPIO 15
RX - -
GND PIN 06 GND

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

STEPS TO PERFORM RFID MODULE:-


STEP1
Setting up Raspberry Pi for Serial Communication
The important thing I mentioned in the Raspberry Pi RFID Reader Module Interface is the EM-18
RFID Reader Module uses UART Communication i.e. Serial Communication.
Before proceeding with the Interface of Raspberry Pi and RFID Reader Module, there are a few
things you need to do in your Raspberry Pi in order to enable the Serial Communication in
Raspberry Pi.
In Raspberry Pi, the Serial Port can be used or configured in two ways: Access Console and Serial
Interface.
Open Terminal and type the following command for serial configuration
sudo raspi-config

In the “Interfacing Options”, select the “Serial” option.

Now, it asks whether you would like to access the login shell over serial communication. Select
“No” option. Then, it asks do you want to enable the Serial Port Hardware. Select “Yes” option.

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

Finish the process and Reboot the Raspberry Pi. After the Raspberry Pi is powered up, once again
login using Putty and in order to check whether the Serial Port is enabled or not, enter the following
command.

dmesg | grep tty

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

At the bottom, you can see, “ttyS0” is configured as Serial. Now, you can proceed with
Interfacing RFID Reader Module with Raspberry Pi to communicate over Serial.

STEP2:
Write the python code and run it.
sudo nano rfid.py
sudo python rfid.py

rfid.py
import serial
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(8,GPIO.OUT)
GPIO.output(8,True)
import time
ser=serial.Serial(port='/dev/ttyS0',baudrate=9600)
str=""
while True:
print "Place your Card"
for i in range(0,12,1):
c=ser.read()
str+=c
time.sleep(0.001)
print str
if(str=="4E002FBC7BA6"):
GPIO.output(8, False)
else:
GPIO.output(8, True)
print "THANK YOU"
str=""

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

OR
import serial #import serial module
def read_rfid ():
ser = serial.Serial ("/dev/ttyS0") #Open named port
ser.baudrate = 9600 #Set baud rate to 9600
data = ser.read(12) #Read 12 characters from
serial port to data
ser.close () #Close port
return data #Return data

id = read_rfid () #Function call


print id

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

PRACTICAL NO.-12
AIM: -
Installing Windows 10 IoT Core on Raspberry Pi
Windows 10 IoT Core is a version of Windows 10 that is optimized for smaller devices with or
without a display, and that runs on the Raspberry Pi 2 and 3, Arrow DragonBoard 410c &
MinnowBoard MAX. Windows 10 IoT Core utilizes the rich, extensible Universal Windows
Platform (UWP) API for building great solutions.
Components Required: -
Hardware Requirements:
 RASPBERRY PI with Power Supply
 Card Reader
 Keyboard (USB)
 Mouse (USB)
 8 GB SD CARD
 Ethernet Cable
 HDMI cable
 Access to a PC.
Software Requirement: -
 Get Windows 10 IoT Core Dashboard

Steps for Installing Windows 10 IoT Core on Raspberry Pi:


STEP1: -
Download the Windows 10 IoT Core Dashboard
Go to the Windows 10 developer center.
https://developer.microsoft.com/en-us/windows/iot/Downloads.htm
Click Get Windows 10 IoT Core Dashboard to download the necessary
application.

STEP2: -
Click on Setup Install the application and open it.

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

STEP3:
Plug your memory card with your desktop pc or laptop

STEP4:
Select set up a new device from the sidebar.

STEP5:-
Select the options as shown in the image below.
Make sure you select the correct drive for your microSD card and give your device a name and
admin password.
Select the Wi-Fi network connection.

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

STEP6:
Click download and install.

ROLL NO.14
CHANDRABHAN SHARMA COLLEGE INTERNET OF THINGS

STEP7: -
Once the image has been installed on the microSD card, it's time to eject it from your PC and go
over to the Raspberry Pi. First connect the micro USB cable and power supply, HDMI cable and
USB Wi-Fi adapter or Ethernet cable. Connect the HDMI cable to your chosen display, insert the
microSD card into the Raspberry Pi and power it up.
Unlike "proper" Windows 10, there's not much of a setup process here. You'll be asked to choose
a language and enter your Wi-Fi password to connect to the web. That's about it. It'll take a
couple of minutes, but when booted up you'll see the Windows 10 IoT Core splash screen.

When booted, you can go back to the dashboard application on your PC, and you'll see your
Raspberry Pi listed as one of your devices.

ROLL NO.14

You might also like