You are on page 1of 58

2022-2023

Shivajirao Kadam
Institute of Technology
& Management
Submitted To:- Department of Computer
(Asst. Prof., CSE Department) Science and Engineering

Internet of Things
(CS- 801)

Submitted By:- Rahul Sharma


Enrollment No.:- 0875CS191096
Class/Year/Sem:- CS-B/4th /VIII

[LAB EXPERIMENT INTERNET OF THINGS (CS-801)]


Program Outcome (PO)

The Engineering graduate of this institute will demonstrate:

a) Apply knowledge of mathematics, science, computing and engineering fundamentals to computer science
engineering problems.
b) Able to identify, formulate, and demonstrate with excellent programming, and problem solving skills.
c) Design solutions for engineering problems including design of experiment and processes to meet desired
needs within reasonable constraints of manufacturability, sustainability, ecological, intellectual and
health and safety considerations.
d) Propose and develop effective investigational solution of complex problems using research methodology;
including design of experiment, analysis and interpretation of data, and combination of information to
provide suitable conclusion. synthesis
e) Ability to create, select and use the modern techniques and various tools to solve engineering problems
and to evaluate solutions with an understanding of the limitations.
f) Ability to acquire knowledge of contemporary issues to assess societal, health and safety, legal and
cultural issues.
g) Ability to evaluate the impact of engineering solutions on individual as well as organization in a societal
and environmental context, and recognize sustainable development, and will be aware of emerging
technologies and current professional issues.
h) Capability to possess leadership and managerial skills, and understand and commit to professional ethics
and responsibilities.
i) Ability to demonstrate the team work and function effectively as an individual, with an ability to design,
develop, test and debug the project, and will be able to work with a multi-disciplinary team.
j) Ability to communicate effectively on engineering problems with the community, such as being able to
write effective reports and design documentation.
k) Flexibility to feel the recognition of the need for, and have the ability to engage in independent and life-
long learning by professional development and quality enhancement programs in context of technological
change.
l) A practice of engineering and management principles and apply these to one’s own work, as a member and
leader in a team, to manage projects and entrepreneurship.
Objective of the Outcome of the Mapping with CO
SN Title Problem Statement
Experiment Experiment CO1 CO2 CO3 CO4 CO5

To understand Students should explore applications of the Internet of To known about


1 IoT √ √
application of IoT Things (IoT) in industry. IoT application

Able to know the


Arduino/Raspberry Software installation for Brief Arduino/Raspberry Pi and perform necessary
2 Arduino/Raspberry √ √
Pi Raspberry Pi software installation.
Pi

Study of different operating systems for Raspberry Pi. To know about


To understand different
3 Operating Systems Understanding the process of OS installation on different OS of √
OS for Raspberry Pi
Raspberry Pi. Raspberry Pi

To understand To know about


Configration & connectivity and Students are studying connectivity and configration of connectivity and
4 √
connectivity configration of Raspberry Pi with basic peripherals, LEDs. configration of
Raspberry Pi Raspberry Pi

To understand concept Satyam wants to change the color of LED in RGB color Able to know, how
5 LED √ √
of LED and LED blink using Raspberry Pi. to control an LED

To understand concept How to Control an LED Using a Smartphone and To known about
6 Bluetooth √ √ √
of Bluetooth Basics Raspberry Pi. bluetooth and LED

To understand Study the temperature sensor and wirte program of To known about
7 Sensor √
temperature sensor monitor temperature using Raspberry Pi. temperature sensor

To understand concept To known about


8 LCD How to Use a LCD Screen/Display with Raspberry Pi √
of LCD LCD

To understand concept To known about,


Raspberry Pi
9 of image capturing and Image capturing via camera and send it over email. Image capturing and √
camera
send over mail send over mail

To understand concept How to capture images with USB Camera, Wi-Fi and To known about,
10 USB Camera √ √
image capturing Raspberry Pi image capturing
Shivajirao Kadam Institute of Technology &Management, Indore
Department of Computer Science and Engineering
Experiment-wise Laboratory Performance Evaluation

Academic Session: Jan – June 2022 Semester & Batch: 8Semester


&C1

Name of Lab: Internet Of Things Course Code:CS-801

Name of Experiment: CO No.

Group: Type: Periods needed:

Name of Student: Saloni Jain Enrollment No.-0875CS181126

Date of Experiment Date of Submission

Grade and remark by the tutor Score(0-10) Remark / Reason

1. Clarity about the Objective and Outcome of


experiment

2. Submitted the work in desired format

3. Shown capability to solve the problems

Average(outof10)
Experiment No: 01

Problem Statement- Students should explore applications of the Internet of Things (IoT) in
industry.
Objective- To understand application of IoT
Outcome- To known about IoT application
Hardware and Software Specification- Text editor
Description- The Internet of Things (IoT) describes the network of physical objects— “things”—
that are embedded with sensors, software, and other technologies for the purpose of connecting
and exchanging data with other devices and systems over the internet.
i) Smart Homes- One of the best and the most practical applications of IoT, smart homes really
take both, convenience and home security, to the next level. Though there are different levels at
which IoT is applied for smart homes, the best is the one that blends intelligent utility systems and
entertainment together. For instance, your electricity meter with an IoT device giving you insights
into your everyday water usage, your set-top box that allows you to record shows from remote,
Automatic Illumination Systems, Advanced Locking Systems, Connected Surveillance Systems all
fit into this concept of smart homes.

ii) Self-driven Cars-The cars use several sensors and embedded systems connected to the Cloud
and the internet to keep generating data and sending them to the Cloud for informed decision-
making through Machine Learning. Though it will take a few more years for the technology to
evolve completely and for countries to amend laws and policies, what we’re witnessing right now
is one of the best applications of IoT.

iii) Traffic monitoring. -The Internet of things can be very useful in the management of vehicular
traffic in large cities, contributing to the concept of smart cities. When we use our mobile phones
as sensors, which collect and share data from our vehicles through applications such as Waze or
Google Maps, we are using the Internet of Things to inform us and at the same time contribute to
traffic monitoring, showing the conditions of the different routes, and feeding and improving the
information on the different routes to the same destination, distance, estimated time of arrival.

iv) Health -The use of wearables or sensors connected to patients, allows doctors to monitor a
patient's condition outside the hospital and in real-time. Through continuously monitoring certain
metrics and automatic alerts on their vital signs, the Internet of Things helps to improve the care
for patients and the prevention of lethal events in high-risk patients. Another use is the integration
of IoT technology into hospital beds, giving way to smart beds, equipped with special sensors to
observe vital signs, blood pressure, oximeter and body temperature, among others.

v) Water supply - A sensor, either incorporated or adjusted externally to water meters, connected
to the Internet and accompanied by the necessary software, helps to collect, process and analyse
data, which allows understanding the behaviour of consumers, detecting faults in the supply
service, report results and offer courses of action to the company that provides the service.
Likewise, it offers final consumers the possibility of tracking their own consumption information,
through a web page and in real time, even receiving automatic alerts in case of detecting
consumption out of range to their average consumption record, which could indicate the presence
of a leak.

Advantages-

1. It can assist in the smarter control of homes and cities via mobile phones. It enhances
security and offers personal protection.
2. By automating activities, it saves us a lot of time.
3. Information is easily accessible, even if we are far away from our actual location, and it is
updated frequently in real time.
4. Electric Devices are directly connected and communicate with a controller computer, such
as a cell phone, resulting in efficient electricity use. As a result, there will be no unnecessary
use of electricity equipment.
5. It minimizes human effort because IoT devices connect and communicate with one another
and perform a variety of tasks without the need for human intervention.

Disadvantages:

1. Hackers may gain access to the system and steal personal information. Since we add so
many devices to the internet, there is a risk that our information as it can be misused.
2. They rely heavily on the internet and are unable to function effectively without it.
3. With complexity of systems, there are many ways for them to fail.
4. We lose control of our lives—our lives will be fully controlled and reliant on technology.
5. Overuse of the Internet and technology makes people unintelligent because they rely on
smart devices instead of doing physical work, causing them to become lazy.
Limitation –

o Security: As the IoT systems are interconnected and communicate over networks. The
system offers little control despite any security measures, and it can be lead the various
kinds of network attacks.
o Privacy: Even without the active participation on the user, the IoT system provides
substantial personal data in maximum detail.
o Complexity: The designing, developing, and maintaining and enabling the large technology
to IoT system is quite complicated.

Result:

Hence, we have learnt all the application of IOT.


Experiment No.-02

Problem Statement- Brief Arduino/Raspberry Pi and perform necessary software installation.

Objective- Software installation for Raspberry Pi

Outcome- Able to know the Arduino/Raspberry Pi

Hardware and Software Requirement

 Raspberry Pi — any version


 Micro SDHC card (with SD adapter)— at least 8GB although 32GB can be used which
allows for more software to be loaded.
 Micro HDMI to HDMI cable — you can also use a Micro HDMI to HDMI adapter with a
regular HDMI cable.
 5V DC via USB-C connector — this is for power.

Description- There are a wide variety of controller boards that we can use for our hardware
projects. The two most popular among them are: Arduino and Raspberry Pi.

Arduino-
Arduino is an open-source electronic device that can read inputs (such as light on a sensor, finger
on a button, or a Twitter message), and based on these inputs produces output (such as turning on
an LED or activating a motor). Arduino was designed at Ivrea Interaction Design Institute as an
easy tool aimed at students without a background in electronics and programming. After gaining
popularity, it started changing to adapt to new needs and challenges. Owing to its simple and
easily accessible user interface, it has empowered many projects, from everyday objects to
complex scientific instruments.

Arduino boards are microcontrollers, not full computers with their own operating system like
Raspberry Pi. They simply execute code written in C/C++, stored in their firmware. Arduino
Integrated Development Environment (IDE) is an open-source software used to write codes and
upload them to an Arduino board.

An important upside of Arduino is that it is open-source, which means that many design files and
source code are already available. You can pick any one among them or improve them to make
your own Arduino board.
Features

 Most of the Arduino boards come with an 8-bit Microcontroller.


 32k bytes of flash memory and 2k bytes of SRAM (Static Random Access Memory). 
 Input voltage required- 7 V – 12V
 Arduino uses C/C++ as a programming language. 
 Digital I/O pins- 14
 Analog Input pins- 6
 Clock frequency-
 Processor speed ranges from 8 MHz to 400 MHz. The average speed of most of the
Arduinos is 16 MHz.
 Flash Memory- 32KB
 It is limited to IDE (Integrated Development Environment)

Advantages

 Not much knowledge required to get started


 Fairly low cost, depending on shields you need
 Lots of sketches and shields available
 No external programmer or power supply needed

Disadvantages

 No understanding of the AVR microcontroller


 Sketches and shields can be difficult to modify
 No debugger included for checking scripts
 You get no experience of C or professional development tools

Raspberry Pi-

A small, fully functional computer that can be plugged into a computer monitor, keyboard, and
mouse. It has all qualities of a PC- a dedicated processor, memory, and a graphics driver. It even
has its own operating system called Raspberry Pi OS which is an optimized version of Linux.

Raspberry Pi does not offer storage, but you can use micro SD cards to store whatever OS
(Raspberry Pi, Ubuntu Mate, etc.) you like. Raspberry Pi also contains Bluetooth, Ethernet, and
Wi-Fi-based connectivity, so it can also be used to transfer files over the internet. Raspberry Pi
project design and the software are not open-source.
Since a Raspberry Pi board is no less than an entire computer inside a Printed Circuit Board, it is
often called Single Board Computer or SBC. Raspberry Pi foundation is continuously updating
and making it better. Since its release, it has been a popular choice for application in Robotics,
Weather monitoring, IoT, and many other electronic systems.

Features

 Superior software implementation


 64-bit Quad-core processor
 Large RAM (latest Raspberry Pi 4 Model B Board has up to 8G of RAM)
 Processor speed- 700MHz- 1.5GHz
 Raspberry Pi has 40 input/output pins.
 It can be connected to the Internet.
 It can run all kinds of applications (including MS Office and Email).
 It contains everything- CPU (Central Processing Unit), GPU (Graphics Processing Unit),
Ethernet port, GPIO (General-purpose Input/Output) pins, and power source connector.

Advantages of Raspberry Pi:

 This microcomputer is useful for small business that run on a lower budget to use their
product or to invent new technology that embeds the product. Small business owners can
use it to automate any small task. 
 The product does not require user to have extensive programming experience since it is
aimed for the younger generation to learn about programming. Python, the programming
language i.e.; Pi uses, is a smaller amount complex than other languages available
 The product gives a lot of room to experiment and turn it into something else i.e.; entirely
different. The SD cards on the board can be easily switched, i.e.; which allows to change the
functions of the device without spending a lot of time re-installing the software. 

Disadvantages of Raspberry Pi:

 It does not replace the computer, and the processor is not as fast. It is a time consuming to
download and install software i.e.; unable to do any complex multitasking.
 Not compatible with the other operating systems such as Windows.
 This is fit for those who want a gadget that they can tailor to their own needs and tastes, i.e.;
not for those that just wants to urge a job done fast. Business owners need to consider the
extra hassle if is worth it.
Key Differences between Arduino and Raspberry Pi

 Arduino boards are micro-controllers (not full computers), while Raspberry Pi boards are
microprocessors. 
 Raspberry Pi has its own operating system, while Arduino boards do not have one. The
Arduino board works on simple instructions provided to them by IDE (Integrated
Development Environment).
 Raspberry Pi supports the internet; Arduino boards do not support the internet.
 Arduino boards are cheaper; Raspberry Pi boards are a bit more expensive. 

Software installation for Raspberry Pi

How to Install Git on Raspberry Pi?


Git is a distributed version control system. It is a software that is used to handle some project
work in a team or group. Without hampering others’ work you can easily do your contribution
to the project by using Git. We all can use Git in our machine just by installing it. But, while
you are using it in Raspberry Pi we have to install properly Raspberry OS.

Step to Install Git on Raspberry Pi

To install Git on Raspberry pi follow the following steps:

Step 1: Open the terminal of Raspberry Pi OS, then write the following command:
sudo apt update

This will update the existing version of your Raspberry Pi OS.


Step 2: Then write the following command to install Git
sudo apt install git

Step 3: Then write ‘Y’ to proceed further. And wait for some time to install
Step 4: Then write the following commands step by step. Which will give proper output. If you
get ‘repo’ in the output. Then it is confirmed that it is installed correctly

sudo mkdir /repo


cd /
ls

Here, further, you don’t need to configure anymore. After it, you can directly move, create a
new project & work on it as usual.

Results

Git has been installed successfully in Raspberry Pi.


EXPERIMENT-03
Problem Statement- Study of different operating systems for Raspberry Pi. Understanding the
process of OS installation on Raspberry Pi.

Objective- To understand different OS for Raspberry Pi

Outcome- To know about different OS of Raspberry Pi

Hardware and Software Requirement


 Raspberry Pi starter kit
 Unit of beagle board
 Windows 7 64 bit or higher/ Ubuntu 16.04 or higher,
 Raspberry Pi desktop RASBIAN

Description-
Different operating systems for raspberry pi are as follows:

1. Raspbian

Raspbian is a Debian-based engineered especially for the Raspberry Pi and it is the perfect
general-purpose OS for Raspberry users.
It employs the Openbox stacking window manager and the Pi Improved Xwindows Environment
Lightweight coupled with a number of pre-installed software which includes Minecraft
Pi, Java, Mathematica, and Chromium.

Raspbian is the Raspberry foundation’s official supported OS and is capable of accomplishing


any task you throw at it.
Raspbian is a Debian-based OS for Raspberry

2. OSMC

OSMC (Open Source Media Center) is a free, simple, open-source, and easy-to-use
standalone Kodi OS capable of playing virtually any media format.
It features a modern beautiful minimalist User Interface and is completely customizable thanks to
the several built-in images that it comes with.

OSMC is a Kodi-centered Linux OS


3. OpenELEC

OpenELEC (Open Embedded Linux Entertainment Center) is a small Linux-based JeOS (Just
enough Operating System) developed from scratch to turn PCs into a Kodi media center.
On a side note,

OpenELEC Mediacenter for Raspberry Pi

4. RISC OS

RISC OS is a unique open-source OS designed specifically for ARM processors by the creators of
the original ARM. It is neither related to Linux nor Windows and is being maintained by a
dedicated community of volunteers.
If you want to choose RISC OS, you should know that it is very different from any Linux distro or
Windows OS you have used so it will take some getting used to. A good place to start is here.
RISC OS for Raspberry Pi

5. Windows IoT Core

Windows IoT Core is a Windows OS built especially for the Raspberry Pi as a development
platform for programmers and coders. Its aim is for programmers to use it to build prototypes
of IoT devices using the Raspberry Pi and Windows 10.

Windows IoT Core for Raspberry Pi


 Installing Raspbian with Mac or Windows

To install Raspbian, you will need to write the operating system image file onto the SD card.

Start by uncompressing the ZIP file you downloaded from raspberrypi.org. To do this from a Mac,
install TheUnarchiver and double-click the ZIP file. From Windows, right-click the file,
select Extract All, choose a destination for the extracted files and click Extract.

After it's done unzipping, it's time to write the image.

Mac
 Open Terminal by locating the app in Launchpad or by pressing command + spacebar and
searching for the app in Spotlight.

 Change the directory you're working in to the location of the extracted image. For example,
if you extracted the Raspbian image to your desktop, type cd Desktop/ and press enter.

 Identify the disk by typing diskutil list and pressing enter. Look for the name of the SD card
you're using (it will appear the same in Terminal as it does on the desktop) and locate its
identifier, which will look something like disk2 or disk3, depending on how many devices
you have connected to your Mac.

 Make sure you have the right storage device identifier and type the command diskutil
unmountDisk /dev/[disk identifier] and press return. The command should look something
like diskutil unmountDisk /dev/disk2.

 Finally, write the image to the disk using the command sudo dd bs=1m if=[image].img
of=/dev/r[disk identifier] and press return. The complete command will look something
like sudo dd bs=1m if=2016-03-18-raspbian-jessie.img of=/dev/rdisk2. You will need to
enter the administrator password to your computer and press enter once more. 
Windows

The process for Windows is a bit more straightforward. You will first need to download Win32
Disk Imager from SourceForge.

 Once Win32 Disk Imager is installed, run it as an administrator by right-clicking the


program icon and selecting Run as administrator. 

 Select the image file you extracted from the Raspbian ZIP file. 

 Select the correct storage drive by choosing the drive letter in the dropdown menu
below Device. Be completely certain you selected the correct drive before proceeding.

 Click Write.

This process will take several minutes to complete, but once the image is finished writing to the
the SD card, you can eject the drive, insert it into the Raspberry Pi and power it on.

The first boot will take longer than usual, but you will have a working version of Raspbian
installed.


Results
Operating system has been installed successfully.
EXPERIMENT-04

Problem statement-Students are studying connectivity and configuration of


Raspberry Pi with basic peripherals, LEDs.

Objective- To understand connectivity and configuration of Raspberry Pi

Outcome-"To know about connectivity and configuration of Raspberry Pi"

Hardware and Software Specification-


Hardware:
 connecting jumper wire
 Raspberry pi
 Led
Software :
 Operating system- ubuntu
 Ram- 4gb
 Text editor
Diagram-
Description- The Raspberry pi is a single computer board with credit card size,
that can be used for many tasks that your computer does, like games, word
processing, spreadsheets and also to play HD video. It was established by the
Raspberry pi foundation from the UK. It has been ready for public consumption
since 2012 with the idea of making a low-cost educational microcomputer for
students and children. The main purpose of designing the raspberry pi board is, to
encourage learning, experimentation and innovation for school level students. The
raspberry pi board is a portable and low cost. Maximum of the raspberry pi
computers is used in mobile phones. In the 20th century, the growth of mobile
computing technologies is very high, a huge segment of this being driven by the
mobile industries. The 98% of the mobile phones were using ARM technology.

Components of RASPBERRY-PI
1. 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.

The recommended amount is between 700mA for a Raspberry Pi Model A, and up


to 2.5A for a Raspberry Pi 3 Model B.

The Raspberry Pi boards typically draw much lower amounts, between 200 and
500mA.

Usage depends on what you’re doing with the Pi. Playing video and browsing the
web draws more power than idling and booting. It also depends on what devices
you have connected; some keyboards and mice draw more power than others.

2. SD Card Slot: Secure Digital Card slot (SD Card) slot 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). The best suited card for proper
running of all sorts of operating systems without any hiccup is Class 10 with
speed @ 10MB/sec.

3. USB Ports & Ethernet Port:

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 2.0 ports. The Pi 4 has two USB 2.0 ports and
two USB 3.0 ports.

In all models prior to the Pi 4, the USB ports connect to a combo hub/Ethernet
chip, which is itself a USB device connected to the single upstream USB port on
BCM2835. On the Pi 4, the USB hub chip is connected to the SoC using a PCIe
bus. On the Model A and Zero range, the single USB 2.0 port is directly wired to
the SoC.
Ethernet Port: In order to enable Internet connection online and to update the
software’s or to install latest packages from online repositories, Raspberry Pi
supports Ethernet Connection. Raspberry Pi (Every Model) comprise of RJ45
Ethernet Jack which supports CAT5/6 cables. It enables Raspberry Pi to be
connected to Wireless Router, ADSL Model or any other Internet connectivity
sharing device.

4. HDMI (High Definition Multimedia Interface): HDMI Port enables


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

5. Video Out (RCA Cable): In addition to HDMI Connectivity which facilitates


HD connection, Raspberry Pi also has provision to be connected to standard
monitor or TV using RCA video cable. RCA cable is less expensive as compared
to HDMI but along with RCA cable, the user has to buy 3.5mm stereo cable for
audio facilitation.
The Pi Model B+, Pi 2, Pi 3 and Pi 4 features a 4-pole 3.5mm audio jack which
also includes the composite video signal. This has allowed for the removal of the
composite video socket found on the original Model B.
The new jack is a 4-pole socket which carries both audio and video signals. It’s
similar to sockets found on other multimedia devices such as iPods, MP3 players
and smart-phones. It now used on the A+, B+, Pi 2, Pi 3 and Pi 4.
6. Status Led’s: Raspberry Pi comprise of 5 main LED’s performing the
following functions:

I. ACT: (Color-Green): The main function of ACT LED is to show card


status. Normally flashing during any SD Card activity performed by end user.
II. PWR: (Color-Red): The main function of PWR led is power. This led is
continuously ON when raspberry Pi is switched on and keep on till switched off.

III. FDX: (Color-Orange): The main function of FDX led is full


duplex. This Led is powered on when Ethernet connection is of Full Duplex type.

IV. LNK: (Color- Orange): The function performed by LNK led is Link.
This LED is powered on when Ethernet connection is established and packet
transfer starts taking place.

V. 100: (Color-Orange): The 100 Led objective is to show 100 Mbps


connection. When any connection is established at Ethernet port, this LED only
gets on when connection is of 100 Mbps speed and gets powered off when
connection is at 10 Mbps.
7. GPIO (General Purpose Input Output): GPIO facilitates connecting all sorts
of peripheral devices to Raspberry Pi. Raspberry Pi has onboard GPIO with 40
pins, 26 of which are used as digital inputs or outputs. More importantly, 9 of the
14 new GPIO pins are dedicated inputs/outputs, it also facilitates the onboard
UART, I2C, SPI Bus and still large amount of free GPIO pins are there for add-on
attachments.
8. CSI Camera Connector: Raspberry Pi has a Mobile Industry Processor
Interface (MIPI) Camera Serial Interface Type 2 (CSI-2). CSI-2 facilitates
connection of small camera to Broadcom BCM 2835 processor. The function of
this interface is to standardize the attachment of camera modules to the processors
for the mobile phone industry. MIPI CSI-2 version 1.01 supports upto 4 data
lanes, and each lane carries 1 Gbps bandwidth. The D- PHY specification defines
the physical hardware layer interface between camera and processor to facilitate
fast exchange of data.

9. System On Chip (SoC): Raspberry Pi (System on Chip) SoC is ARM Based


by Broadcom Technologies. The ARM processor runs from 700 Mhz to 1 Ghz.
The SoC also facilitates videocore 4 GPU, and is capable for fast 3D core,
openGL and supports Blueray and H.264 video playback.

Syntax and keywords-

 Gpio- General purpose input output


 Rip- raspberry pi
 HDMI (High Definition Multimedia Interface)

Advantages

1. The very first thing that you need to know about the Raspberry Pi is that it
is very affordable.

2. Another reason why a Raspberry Pi computer is pretty popular for a lot of


different users is that it doesn’t consume a lot of power.

3. Of course, one of the reasons why there are some people who prefer to use
a Raspberry Pi computer is that it is quite small and can fit any kind of
table.

4. One aspect that makes the Raspberry Pi stand out is that it is actually pretty
easy to use in comparison to other computers.

5. If you are using a computer for simple tasks that don’t require a ton of
power such as typing word documents, you are in luck because Raspberry
Pi should be more than enough for your needs as it has the capabilities and
free software that will allow you to create word documents.

Disadvantages

 Limited in its functions


Let’s face the fact that something as small as a Raspberry Pi computer has plenty
of limits in terms of what it can do. After all, it is only a single-board computer
that was made and designed for children and for basic computer literacy. It will be
great for basic tasks like programming, office work and web browsing, but not
much more.

So, if you want a computer that is capable of doing more tasks such as playing
recent games and doing heavy tasks, then a Raspberry Pi computer shouldn’t be
your first choice.

 Slow
You can’t expect a single-board computer to have lightning-fast speeds. That
said, Raspberry Pi computers generally have slower processing speeds compared
to the actual and more expensive computers in the market.

In that sense, you shouldn’t expect a Raspberry Pi to deliver you quick results if
you are in a hurry or if you are doing plenty of different tasks that would easily eat
up its memory and make it work slower.

 Bad for larger tasks and for bigger businesses


If you are using your computer for your job or your business, there might be some
instances that a Raspberry Pi would be useful especially if you are only using
computers for simple tasks and processes that don’t necessarily require a powerful
computer

However, if you are already doing larger and more complex tasks or if you are
running a bigger business, a Raspberry Pi computer won’t be useful because it
doesn’t have the power and the capacity to help you in any of those due to its
limited capacity and capabilities.

 Bad for multitasking


A Raspberry Pi computer isn’t powerful enough to help you handle multiple tasks
on a single computer. So, for those who are looking to multi-task frequently, a
Raspberry Pi wouldn’t be the best choice because it mainly has the capabilities to
handle simple tasks.
Limitations-

 It does not replace the computer, and the processor is not as fast. It is a time
consuming to download and install software i.e.; unable to do any complex
multitasking.
 Not compatible with the other operating systems such as Windows.
 This is fit for those who want a gadget that they can tailor to their own
needs and tastes, i.e.; not for those that just wants to urge a job done fast.
Business owners need to consider the extra hassle if is worth it.
 This product not be useful for bigger business that already have big servers,
i.e.; which would already do everything that the Raspberry Pi does. So, it
would not be worth and it take time to get to put it together.

Algorithm-

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 .

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.


Program-

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)

Result: Successfully learned about connectivity and configuration of Raspberry


Pi.
EXPERIMENT No. -05

Problem statement- Satyam wants to change the color of LED in RGB color and
LED blink using Raspberry Pi.

Objective- To understand concept of LED.

Outcome- Able to know, how to control an LED.

Hardware and Software Specification-

Hardware:
 connecting jumper wire
 Raspberry pi
 Led
Software:
 Operating system- Ubuntu
 Ram- 4gb
 Text editor

Description

A light-emitting diode (LED) is a semiconductor device that emits light when


an electric current flows through it. When current passes through an LED, the
electrons recombine with holes emitting light in the process. LEDs allow the
current to flow in the forward direction and blocks the current in the reverse
direction.
Light-emitting diodes are heavily doped p-n junctions. Based on the
semiconductor material used and the amount of doping, an LED will emit a
colored light at a particular spectral wavelength when forward biased.

An RGB LED is a combination of 3 LEDs RED, Green and Blue. These three
colors Red, green and blue can make any color. By varying supplied voltage to
RGB LEDs different colors are formed.

An RGB LED has 4 pin interfaces. 3 Pins are for Red, Blue and Green. There is
a common pin for all three LEDs
An RGB LED can be two types-
1. Common Anode:-Anode (+) pin is common.
2. Common Cathode:- (Cathode-/GND) pin is common.

Key functions

 p = GPIO.PWM (channel, frequency)


This is used for creating a PWM.

 p.start(dc)
Start the PWM you have created.

 p.ChangeFrequency(freq)
Change the frequency of PWM.

 p.stop( )
Stop the PWM.

Advantages

 LED’s are now capable of outputting 135 lumens/watt.


 No warm-up period.
 Not affected by cold temperatures
 Excellent Color Rendering.
 LED’s contain no mercury or other hazardous substances.
 LED’s can be controlled for brightness and color.

Disadvantages

 Blue hazard
 High initial price
 LEDs are not capable of providing divergence below a few degrees.
 LED performance largely depends on the ambient temperature of the
operating environment.

Implementation

Step 1- Login to Raspberry PI using ssh command from Linux and MacOS or
using putty from windows, then open the vim editor using the following
command:
Step2 – Code

Step 3- Test

To run the application execute the following command:


Raspberry Pi

A small, fully functional computer that can be plugged into a computer monitor, keyboard, and
mouse. It has all qualities of a PC- a dedicated processor, memory, and a graphics driver. It even
has its own operating system called Raspberry Pi OS which is an optimized version of Linux.

Writing the Python Software to blink the LED


With the circuit created we need to write the Python script to blink the LED. Before we start
writing the software we first need to install the Raspberry Pi GPIO Python module. This is a
library that allows us to access the GPIO port directly from Python.

To install the Python library, open a terminal and execute the following:
With the library installed now open your favorite Python IDE Our script needs to do the
following:

 Initialize the GPIO ports


 Turn the LED on and off in 1 second intervals

To initialize the GPIO ports on the Raspberry Pi we need to first import the Python library,
the initialize the library and setup pin 8 as an output pin.

Next we need to turn the LED on and off in 1 second intervals by setting the output pin to
either high (on) or low (off). We do this inside a infinite loop so our program keep executing
until we manually stop it.

Combining the initialization and the blink code should give you the following full Python
program:
With our program finished, save it as blinking_led.py and run it either inside your IDE or in
the console with:

Result
Able to change the color of LED in RGB color and LED blink using Raspberry Pi.
Experiment No-6

Problem Statement- How to Control an LED Using a Smartphone.

Objective- To understand concept of Bluetooth Basics

Outcome- To known about bluetooth and LED

Hardware and Software Requirement

▪ Unit of Beagle Black board


▪ LEDs
▪ Breadboard
▪ Hookup cables
▪ 5V Power Supply

• Windows 7 64 bit or Higher/ Ubuntu 16.04 or higher


• Arduino
• Beagle Board
• GCC 6.0 of Higher/ Python 3.0 or Higher

Description

How Does It Work?


There are three main parts to this project. An Android smartphone, a Bluetooth transceiver, and an
Arduino.

HC 05/06 works on serial communication. The Android app is designed to send serial data to the
Arduino Bluetooth module when a button is pressed on the app. The Arduino Bluetooth module at
the other end receives the data and sends it to the Arduino through the TX pin of the Bluetooth
module (connected to RX pin of Arduino). The code uploaded to the Arduino checks the received
data and compares it. If the received data is 1, the LED turns ON. The LED turns OFF when the
received data is 0. You can open the serial monitor and watch the received data while connecting.

Connecting the Arduino Bluetooth Hardware

This circuit is simple and small. There are only four connections to be made between the Arduino
and Bluetooth module!

Arduino Pins | Bluetooth Pins

RX (Pin 0) ———> TX
TX (Pin 1) ———> RX
5V ———> VCC
GND ———> GND
Connect an LED positive to pin 13 of the Arduino through a resistance (valued between 220Ω–
1KΩ). Connect its negative to GND, and you're done with the circuit!

You can connect the Bluetooth module to the Arduino using a set of jumper wires and a connector.

Note: Don’t connect RX to RX and TX to TX on the Bluetooth and Arduino. You will receive no
data. Here, TX means transmit and RX means receive.

Uploading the Sketch to Arduino

char data = 0; //Variable for storing received data


void setup()
{
Serial.begin(9600); //Sets the data rate in bits per second (baud) for
serial data transmission
pinMode(13, OUTPUT); //Sets digital pin 13 as output pin
}
void loop()
{
if(Serial.available() > 0) // Send data only when you receive data:
{
data = Serial.read(); //Read the incoming data and store it into variable
data
Serial.print(data); //Print Value inside data in Serial monitor
Serial.print("\n"); //New line
if(data == '1') //Checks whether value of data is equal to 1
digitalWrite(13, HIGH); //If value is 1 then LED turns ON
else if(data == '0') //Checks whether value of data is equal to 0
digitalWrite(13, LOW); //If value is 0 then LED turns OFF
}

Upload the given sketch to Arduino using the Arduino IDE software, you can also get it
from Github.

Installing the Android Application

In this tutorial, I will not cover Android app development. You can download the Android
application from here and the source code of the entire project.
 Download the application from Amazon App Store or Github.
 Pair your device with the HC 05/06 Bluetooth module:
 Turn ON the HC 05/06 Bluetooth module by powering the Arduino.
 Scan your smartphone for available devices.3. Pair your smartphone to the HC 05/06 by
entering default password 1234 OR 0000.
 Install the LED application on your Android device. 
 Open the application.

 Press "paired devices". 


 Select your Bluetooth module from the list (HC-05/06)
 After connecting successfully, press the ON button to turn the LED on and the OFF button
to turn the LED off. 
 Disconnect the button to disconnect the Bluetooth module.

Result:
Hence we learned how to control LEDs via smartphones.
Experiment No.- 7

Problem Statement- Study the temperature sensor and write program of monitor temperature
using Raspberry Pi.

Objective- To Understand Temperature Sensor

Outcome- To know about temperature sensor

Hardware and Software Requirement-

 Raspberry Pi — any version


 Micro SDHC card (with SD adapter)— at least 8GB although 32GB can be used which
allows for more software to be loaded.
 Micro HDMI to HDMI cable — you can also use a Micro HDMI to HDMI adapter with a
regular HDMI cable.
5V DC via USB-C connector — this is for power

Description
Sensors

There are four sensors we recommend using because they are inexpensive, easy to connect, and
give accurate readings; DSB18B20, DHT22, BME280, and Raspberry Pi Sense HAT.

DHT22 — This temperature and humidity sensor has temperature accuracy of +/- 0.5 C and a
humidity range from 0 to 100 percent. It is simple to wire up to the Raspberry Pi and doesn’t
require any pull up resistors.

DSB18B20 — This temperature sensor has a digital output, which works well with the Raspberry
Pi. It has three wires and requires a breadboard and resistor for the connection.
BME280 — This sensor measures temperature, humidity, and barometric pressure. It can be used
in both SPI and I2C.

Sense HAT — This is an add on board for Raspberry Pi that has LEDs, sensors, and a tiny joystick.
It connects directly on to the GPIO on the Raspberry Pi but using a ribbon cable gives you more
accurate temperature readings.

Initial State Account

You’ll need somewhere to send your data to keep a historical log and view the real-time data
stream so we will use Initial State. Go to https://iot.app.initialstate.com and create a new account or
log into your existing account.

*You may need to install pip if it is not preinstalled in your Python version.
sudo apt install python-pip

Next, we need to install the Initial State Python module onto your Pi. At a command prompt (don’t
forget to SSH into your Pi first), run the following command:
$ cd /home/pi/
$ \curl -sSL https://get.initialstate.com/python -o - | sudo bash

After you enter the curl command in the command prompt you will see something similar to the
following output to the screen:
pi@raspberrypi ~ $ \curl -sSL https://get.initialstate.com/python -o - | sudo bash
Password:
Beginning ISStreamer Python Easy Installation!
This may take a couple minutes to install, grab some coffee :)
But don't forget to come back, I'll have questions later!Found easy_install: setuptools 1.1.6
Found pip: pip 1.5.6 from /Library/Python/2.7/site-packages/pip-1.5.6- py2.7.egg (python 2.7)
pip major version: 1
pip minor version: 5
ISStreamer found, updating...
Requirement already up-to-date: ISStreamer in /Library/Python/2.7/site-packages
Cleaning up...
Do you want automagically get an example script? [y/N]
Where do you want to save the example? [default: ./is_example.py]Please select which Initial State app
you're using:
1. app.initialstate.com
2. [NEW!] iot.app.initialstate.com
Enter choice 1 or 2:
Enter iot.app.initialstate.com user name:
Enter iot.app.initialstate.com password:

When prompted to automatically get an example script, type y. This will create a test script that we
can run to ensure that we can stream data to Initial State. The next prompt will ask where you want
to save the example file. You can either type a custom local path or hit enter to accept the default
location. Finally, you’ll be asked which Initial State app you are using. If you’ve recently created
an account, select option 2, enter your user name and password. After that the installation will be
complete.

Let’s take a look at the example script that was created.

$ nano is_example.py

Program:

import
os
import glob
import time
from ISStreamer.Streamer import Streamer

streamer = Streamer(bucket_name="Temperature Stream",


bucket_key="piot_temp_stream031815",
access_key="PUT_YOUR_ACCESS_KEY_HERE")

os.system('modprobe w1-gpio')
os.system('modprobe w1-therm')
base_dir = '/sys/bus/w1/devices/'
device_folder = glob.glob(base_dir + '28*')[0]
device_file = device_folder + '/w1_slave'

def read_temp_raw():
f = open(device_file, 'r')
lines = f.readlines()
f.close()
return lines

def read_temp():
lines = read_temp_raw()
while lines[0].strip()[-3:] != 'YES':
time.sleep(0.2)
lines = read_temp_raw()
equals_pos = lines[1].find('t=')
if equals_pos != -1:
temp_string = lines[1][equals_pos+2:]
temp_c = float(temp_string) / 1000.0
return temp_c

while True:
temp_c = read_temp()
temp_f = temp_c * 9.0 / 5.0 + 32.0
streamer.log("temperature (C)", temp_c)
streamer.log("temperature (F)", temp_f)
time.sleep(.5)

Results
Hence Temperature Sensor is known.
Experiment No- 8

Problem Statement- How to use a LCD Screen/Display with Raspberry Pi.

Objective- To understand the concept of LCD

Outcome- To know about LCD

Hardware and Software Requirement-

 Raspberry Pi — any version


 Micro SDHC card (with SD adapter)— at least 8GB although 32GB can be used which
allows for more software to be loaded.
 Micro HDMI to HDMI cable — you can also use a Micro HDMI to HDMI adapter with a
regular HDMI cable.
 5V DC via USB-C connector — this is for power.
 16X2 LCD display
 10 GPIO pins

Description-

The Raspberry Pi Touch Display is an LCD display which connects to the Raspberry Pi through
the DSI connector. In some situations, it allows for the use of both the HDMI and LCD displays at
the same time (this requires software support).
Screen Orientation

LCD displays have an optimum viewing angle, and depending on how the screen is mounted it
may be necessary to change the orientation of the display to give the best results. By default, the
Raspberry Pi Touch Display and Raspberry Pi are set up to work best when viewed from slightly
above, for example on a desktop. If viewing from below, you can physically rotate the display, and
then tell the system software to compensate by running the screen upside down.
 KMS and FKMS Mode - KMS and FKMS modes are used by default on the
Raspberry Pi 4B. KMS and FKMS use the DRM/MESA libraries to provide graphics
and 3D acceleration.To set screen orientation when running the graphical desktop,
select the Screen Configuration option from the Preferences menu. Right click on the
DSI display rectangle in the layout editor, select Orientation then the required option.
 Legacy Graphics Mode - Legacy graphics mode is used by default on all Raspberry Pi
models prior to the Raspberry Pi 4B, and can also be used on the Raspberry Pi 4B if
required, by disabling KMS and FKMS modes by commenting out the KMS or
FKMS line in config.txt.
Touchscreen Orientation

Additionally, you have the option to change the rotation of the touchscreen independently of the
display itself by adding a dtoverlay instruction in config.txt, for example:

dtoverlay=rpi-ft5406,touchscreen-swapped-x-y=1,touchscreen-inverted-x=1

Features

 32k bytes of flash memory and 2k bytes of SRAM (Static Random Access Memory). 
 Input voltage required- 7 V – 12V
 It uses python as a programming language. 
 Digital I/O pins- 14
 Analog Input pins- 6
 Clock frequency-
 Processor speed ranges from 8 MHz to 400 MHz. The average speed of most of the
Arduinos is 16 MHz.
 Flash Memory- 32KB
 It is limited to IDE (Integrated Development Environment)

Advantages of Raspberry Pi:

 This microcomputer is useful for small business that run on a lower budget to use their
product or to invent new technology that embeds the product. Small business owners can
use it to automate any small task. 
 The product does not require user to have extensive programming experience since it is
aimed for the younger generation to learn about programming. Python, the programming
language i.e.; Pi uses, is a smaller amount complex than other languages available
 The product gives a lot of room to experiment and turn it into something else i.e.; entirely
different. The SD cards on the board can be easily switched, i.e.; which allows to change the
functions of the device without spending a lot of time re-installing the software. 

Disadvantages of Raspberry Pi:

 It does not replace the computer, and the processor is not as fast. It is a time consuming to
download and install software i.e.; unable to do any complex multitasking.
 Not compatible with the other operating systems such as Windows.
 This is fit for those who want a gadget that they can tailor to their own needs and tastes, i.e.;
not for those that just wants to urge a job done fast. Business owners need to consider the
extra hassle if is worth it.
To use a LCD Screen/Display with Raspberry Pi.

1. Connecting to an HDMI Display

This is the easiest and most reliable method of connecting an external screen to your
Raspberry Pi. HDMI is a video standard created in the early 2000’s which has supports
1080p High Definition (HD) and 2 channel (stereo) audio. It’s a plug and play standard,
which means there’s no special drivers to install and no fiddling to get it to work. You
simply power down your Pi, plug either end of an HDMI cable into the HDMI port on your
Pi, and the other into the HDMI port on your display.

2. Connecting to a Composite Video Display

Raspberry Pi composite PAL/NTSC display.Whilst every TV and consumer display is now


supported by HDMI, some older displays such as bulky CRT monitors aren’t, but instead
may have the older RCA Red, White, and Yellow plugs. Composite video isn’t
recommended for most users because you have to alter the config.txt file to tell your Pi to
use composite video, and it’s only Standard Definition (SD) which means your picture
quality won’t be very good.

3. Connecting to an LCD DSI Display

The Raspberry Pi has a small connector for a 15-pin ribbon cable which supports the
Display Serial Interface (DSI) standard which allows for high-speed communication
between LCD screens. At the moment, the best display to use with this connector is the
official Raspberry Pi 7” Touchscreen which supports 10-point capacitive touch. Connecting
up the display is fairly straight forward, it’s designed so that the Pi can be mounted on the
back of it with all of the cables tucked away nice and neatly. To connect up your display,
follows these steps:
 Attach Raspberry Pi board to the back of the display using the screws and standoffs
provided
 Carefully connect the ribbon cable to both the Pi board and display control board
noting the orientation of the ribbon cable pins.

4. Connecting to a GPIO Header Display

And the fourth method for connecting a display to your Raspberry Pi is using the GPIO
headers. This isn’t the recommended method for a primary display as it takes up all of the
GPIO headers. It can still be a good option as a small display for projects, however,
depending on the display, some extra drivers may be required to use the display.

Result – Understood the concept of using LCD screen/display with Raspberry Pi.
Experiment No.-9

Problem Statement- Image capturing via camera and send it over email.

Objective- To understand concept of image capturing and send over mail

Outcome- To known about, Image capturing and send over mail

Hardware and Software Requirement

● Raspberry Pi — any version


● Micro SDHC card (with SD adapter)— at least 8GB although 32GB can be used which
allows for more software to be loaded.
● Micro HDMI to HDMI cable — you can also use a Micro HDMI to HDMI adapter with a
regular HDMI cable.
● 5V DC via USB-C connector — this is for power.

Description

There are a wide variety of controller boards that we can use for our hardware projects. The two
most popular among them are:Raspberry Pi Camera.
Raspberry Pi

A small, fully functional computer that can be plugged into a computer monitor, keyboard, and
mouse. It has all qualities of a PC- a dedicated processor, memory, and a graphics driver. It even
has its own operating system called Raspberry Pi OS which is an optimized version of Linux.

Raspberry Pi does not offer storage, but you can use micro SD cards to store whatever OS
(Raspberry Pi, Ubuntu Mate, etc.) you like. Raspberry Pi also contains Bluetooth, Ethernet, and
Wi-Fi-based connectivity, so it can also be used to transfer files over the internet. Raspberry Pi
project design and the software are not open-source.

Since a Raspberry Pi board is no less than an entire computer inside a Printed Circuit Board, it is
often called Single Board Computer or SBC. Raspberry Pi foundation is continuously updating
and making it better. Since its release, it has been a popular choice for application in Robotics,
Weather monitoring, IoT, and many other electronic systems.
Features

● Superior software implementation


● 64-bit Quad-core processor
● Large RAM (latest Raspberry Pi 4 Model B Board has up to 8G of RAM)
● Processor speed- 700MHz- 1.5GHz
● Raspberry Pi has 40 input/output pins.
● It can be connected to the Internet.
● It can run all kinds of applications (including MS Office and Email).
● It contains everything- CPU (Central Processing Unit), GPU (Graphics Processing Unit),
Ethernet port, GPIO (General-purpose Input/Output) pins, and power source connector.

Advantages of Raspberry Pi:

● This microcomputer is useful for small business that run on a lower budget to use their
product or to invent new technology that embeds the product. Small business owners can
use it to automate any small task.
● The product does not require user to have extensive programming experience since it is
aimed for the younger generation to learn about programming. Python, the programming
language i.e.; Pi uses, is a smaller amount complex than other languages available
● The product gives a lot of room to experiment and turn it into something else i.e.; entirely
different. The SD cards on the board can be easily switched, i.e.; which allows to change the
functions of the device without spending a lot of time re-installing the software.

Disadvantages of Raspberry Pi:

● It does not replace the computer, and the processor is not as fast. It is a time consuming to
download and install software i.e.; unable to do any complex multitasking.
● Not compatible with the other operating systems such as Windows.
● This is fit for those who want a gadget that they can tailor to their own needs and tastes, i.e.;
not for those that just wants to urge a job done fast. Business owners need to consider the
extra hassle if is worth it.

Software installation for Raspberry Pi

How to Install Git on Raspberry Pi?


Git is a distributed version control system. It is a software that is used to handle some project work
in a team or group. Without hampering others’ work you can easily do your contribution to the
project by using Git. We all can use Git in our machine just by installing it. But, while you are
using it in Raspberry Pi we have to install properly Raspberry OS.
Step 1:
Adjust Default Settings in Your Gmail
By default, Google does not allow to send emails containing Python code. To update this default
setting, turn on “Allow less secure apps” in your account settings with the following steps:

1. Login to our Gmail account by entering our login credentials.


2. Click on our profile picture and then click on “Google account”.
3. Under “Sign-in and Security” click “Connected apps and sites”.
4. Click “Allow less secure apps” to turn it on.

Step2:
Connect the Motion Sensor to the Raspberry Pi
Connect the VCC and GND pins of the motion sensor to the 5V and GND of the Raspberry Pi,
then connect the OUT pin of the motion sensor to GPIO17. Make sure that you connected the
camera to the Raspberry Pi and have turned on the camera from the interfacing options.

Step3:

The Python Code to Send Emails

Before running the code, make sure the sender and receiver email addresses and the password of
the email sender are all entered.

The code will read the output from the sensor and, upon detecting motion, will capture an image
and save it on the database folder.

When we run the code for the first time, it will automatically create the folder. Once the camera
captures an image, the image will be attached in the email and sent to the sender’s address.
Results

At last, using these we have captured an image via camera and sent it over email.
Experiment No.- 10
Problem Statement -How to capture images with USB Camera, Wi-Fi and
Raspberry Pi
Objective -To understand concept image capturing
Outcome-To known about, image capturing.
Hardware and Software requirements-
Hardware Required:
• Raspberry Pi
• SD card
• Power supply
• VGA to HDMI converter (Optional)
• USB camera
Software Required:
• Raspbian Stretch OS
• SD card Formatter
• Win32DiskImager (or) Etcher
Description:
PyGame is used for accessing the camera and capturing images which are stored
inside the SD
card of RPi. A background model is created for the scene to discover the
changes from the default
state. A simple circuit, connected to the GPIO pins, lights a led as an indication
of such states.
Syntax and keywords-
Rpi- Raspberry Pi
Gpio- General purpose input output
Advantages-

This microcomputer is useful for small business that run on a lower budget to
use their product or to invent new technology that embeds the product. Small
business owners can use it to automate any small task.
● The product does not require user to have extensive programming
experience since it is aimed for the younger generation to learn about
programming. Python, the programming language i.e.; Pi uses, is a
smaller amount complex than other languages available
● The product gives a lot of room to experiment and turn it into something
else i.e.; entirely different. The SD cards on the board can be easily
switched, i.e.; which allows to change the functions of the device without
spending a lot of time re-installing the software.

Disadvantages

 It does not replace the computer, and the processor is not as fast. It is a
time consuming to download and install software i.e.; unable to do any
complex multitasking.
 Not compatible with the other operating systems such as Windows.
 This is fit for those who want a gadget that they can tailor to their own
needs and tastes, i.e.; not for those that just wants to urge a job done fast.
Business owners need to consider the extra hassle if is worth it.

Algorithm-
1) Connecting RPi to a PC using the wireless interface.
2) Connecting a USB camera to RPi.
3) Capturing images using PyGame.
4) Building the background model.
5) Detecting changes to the background model.
6) Building a simple circuit that lights a led when a change occurs
Program-
import pygame
import pygame.camera
# Captured image dimensions. It should be less than or equal to the maximum
dimensions acceptable by the camera.
width = 320
height = 240
# Initializing PyGame and the camera.
pygame.init()
pygame.camera.init()
# Specifying the camera to be used for capturing images. If there is a single
camera, then it have the index 0.
cam = pygame.camera.Camera("/dev/video0",(width,height))
# Preparing a resizable window of the specified size for displaying the captured
images.
window = pygame.display.set_mode((width,height),pygame.RESIZABLE)
# Starting the camera for capturing images.
cam.start()
# Capturing an image.
image = cam.get_image()
# Stopping the camera.
Cam.stop()
# Displaying the image on the window starting from the top-left corner.
window.blit(image,(0,0))
# Refreshing the window.
pygame.display.update()
# Saving the captured image.
pygame.image.save(window,'PyGame_image.jpg')
Result: Here’s how we can capture images with USB Camera, Wi-Fi and

Raspberry Pi

You might also like