Professional Documents
Culture Documents
Shivajirao Kadam
Institute of Technology
& Management
Submitted To:- Department of Computer
(Asst. Prof., CSE Department) Science and Engineering
Internet of Things
(CS- 801)
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 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 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
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:
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
Advantages
Disadvantages
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
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.
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.
Step 1: Open the terminal of Raspberry Pi OS, then write the following command:
sudo apt update
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
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
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.
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.
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,
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
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.
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.
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.
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
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 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.
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.
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.
Advantages
1. The very first thing that you need to know about the Raspberry Pi is that it
is very affordable.
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
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.
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.
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.
5. It will open the nano editor. Use following pseudo code in the python to blink
LED and save .
7. Now LED will be blinking at an interval of 1s. You can also change the interval
by modifying time.sleep in the file.
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)
Problem statement- Satyam wants to change the color of LED in RGB color and
LED blink using Raspberry Pi.
Hardware:
connecting jumper wire
Raspberry pi
Led
Software:
Operating system- Ubuntu
Ram- 4gb
Text editor
Description
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.start(dc)
Start the PWM you have created.
p.ChangeFrequency(freq)
Change the frequency of PWM.
p.stop( )
Stop the PWM.
Advantages
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
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.
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:
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
Description
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.
This circuit is simple and small. There are only four connections to be made between the Arduino
and Bluetooth module!
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.
Upload the given sketch to Arduino using the Arduino IDE software, you can also get it
from Github.
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.
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.
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.
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.
$ nano is_example.py
Program:
import
os
import glob
import time
from ISStreamer.Streamer import Streamer
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
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)
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.
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.
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.
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.
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.
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
● 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.
● 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.
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:
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