0% found this document useful (0 votes)
9 views29 pages

Internet of Things (IoT) - Lecture 4

Uploaded by

inboxmwita
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views29 pages

Internet of Things (IoT) - Lecture 4

Uploaded by

inboxmwita
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

Internet of Things (IoT)

IT 8311
Credit rating: 10

LECTURE IV.
Eng.Malissa
[email protected]
OUTLINES
•Raspberry Pi
•Introduction
•Installation
•Hands On.
Need for Raspberry Pi.
• Raspberry Pi is the most cheapest and common
computing device .
• Developed by the Raspberry Pi foundation.
• First generation was released in February 2012.
What is Raspberry Pi?
• Series of small single-board computers bundled with
on-board WIFI, Bluetooth and USB boot capabilities,
GPIOs etc.
• Low cost, credit-card sized computer
• Plugs into a monitor & uses a keyboard & mouse
• Capable of exploring computing & learn how to program
• Raspberry Pi 4 released in 2019.
Capabilities of Raspberry Pi.
• Browsing the internet & playing HD video
• Making Spreadsheets and Word processing
• Playing Games
• Infra-red cameras & security systems
• Music machines & Detector for weather stations.
Raspberry Pi Hardware.
Raspberry Pi Hardware
Raspberry Pi Hardware
• Raspberry Pi 1st Generation uses Broadcom BCM2835 SoC
equivalent to the chip in 1st generation of smartphones.
• CPU -> ARMv6 Architecture
• Video Core IV Graphics processing unit (GPU) and Ram
• L1 cache of 16KB and l2 cache of 128 KB
• L2 cache is used primarily by the GPU

• Raspberry Pi 3 uses a Broadcom BCM2837 SoC


• 1.2 GHz 64bit quadcore ARM Cortex-A53 processor
• 512kb shared cache & 1GB RAM
Raspberry Pi Hardware - Processor
Raspberry Pi Hardware - RAM

• Initially Model B - >128 MB was allocated by default to the


GPU.
• Leaving 128 MB for the CPU
• Default split was 192MB (RAM for CPU), Sufficient for
1080p Video decoding or far Simple 3D, But Not For Both
Together
Raspberry Pi Hardware - Networking

• Model A,A+ and Pi Zero has no Ethernet Circuitry, Commonly connected to a


network using an external USB Ethernet or Wi-Fi adapter.
• On model B and B+ the Ethernet port is provided by built in USB Ethernet adapter
using the SMSC LAN9514 chip
• Raspberry Pi 3 & Pi Zero W (Wireless) are equipped with 2.4 GHZ WiFi
802.11n(150Mbit/s) and Bluetooth 4.1 (24 Mbit/s) Based on Broadcom BCM43438.
Raspberry Pi Hardware – Peripheral.
Raspberry Pi Hardware – Video.
• Video controller can emit standard TV resolution, such as HD and Full
HD, and Higher or Lower monitor resolution.
• Raspberry Pi 3 does not have H.265 decoding hardware, but CPU is
more powerful enough to allow the decoding of H..265-encoded
videos in software
• GPU in the Raspberry Pi 3 runs at a higher clock frequencies of
300MHz or 400MHz,compared too previous versions which ran at 250
MHz
Raspberry Pi Hardware – Connectors.
Raspberry Pi Hardware – Connectors.
Raspberry Pi OS Installation and sense hat
Demo.
• Raspberry Pi OS
Installation
• The Raspberry Pi
Foundation recommends
the use of Raspbian, a
Debian-based Linux
operating system.
Raspberry Pi OS installation
1. Download Raspberry
Pi OS from:-
www.raspberrypi.org
2. Extract the zip file
3. Copy these file to a
formatted SD card
4. Put in Raspberry Pi
SD card slot
5. Follow the
installation
instructions.
Raspberry Pi Accessories.
• HAT (Hardware Attached on Top) expansion boards –
• Together with the model B+, inspired by the Arduino shield board,the
interface for HAT boards was devices by the Raspberry Pi foundation.
• Each HAT board carries a small EEPROM containing the relevant details of
the board
• Raspberry Pi’s Os is informed of the HAT, and the technical details of it.
• Mechanical details of a HAT board are available online.
Add-on boards.
Refers to a hardware or software component that can be added to a Raspberry Pi board to enhance its
functionality or extend its capabilities. Raspberry Pi is a popular single-board computer that is widely used for
various applications such as DIY electronics projects, home automation, media centres, retro gaming consoles,
and more.
Hardware add-ons for Raspberry Pi can include peripheral devices such as displays, cameras, sensors,
actuators, motors, and expansion boards that provide additional inputs/outputs (I/O), connectivity options, or
processing capabilities. These hardware add-ons can be attached to the Raspberry Pi's GPIO (General Purpose
Input/Output) pins or through other interfaces such as USB, HDMI, or I2C, depending on the specific add-on
and Raspberry Pi model.
Add-on Software.
• Software add-ons, on the other hand, are additional software
packages or modules that can be installed on a Raspberry Pi to extend
its functionality. These can include software libraries, drivers,
applications, tools, and utilities that provide new features or
functionalities, such as media players, web servers, databases,
programming frameworks, and more.
• Add-ons are a popular way to customize and enhance the capabilities
of Raspberry Pi to suit specific projects or requirements. They can
provide additional functionality, expand connectivity options, or
enable integration with other devices or systems. Raspberry Pi has a
large community of enthusiasts and developers who create and share a
wide range of add-ons, making it a versatile and flexible platform for
various applications.
Raspberry Pi Accessories - Camera
• On 14th may 2013,the launched the raspberry
Pi camera board alongside a firmware update.
• 8 megapixel camera
• Camera board has flexible flat cable that
plugs into the CSI connector
• Located between the ethernet and HDMI
ports.
• User must enable the use of the camera board
by running raspi-config
• Produce 1080p, 720p and 640x480 video
Raspberry Pi Accessories - Camera
• In October 2013,the foundation started producing camera
module without an infrared filter, called the Pi NoIR.
Raspberry Pi Accessories – Gertboard.
• Device designed for educational purposes
• Expand the raspberry Pi’s GPIO pins to allow interface with & control
of LEDs, Switches, analogy signals, sensors and other devices.
• Includes an optional Arduino compatible controller to interface with
the Pi.
Sense Hat Demos.
• Display Text
• Displaying Images
• Setting Orientation
• Sensing the environment
• Detecting Movement.
Displaying a Text.
f ro m s e n s e _ h a t i m p o r t s e n s e H a t Importing Sense
f ro m t i m e i m p o r t s l e e p Hat.
f ro m r a n d o m i m p o r t r a n d i n t
sense = senseHat {} Initializing Sense
r = randint (0,255) Hat
s e n s e . s h o w _ l e t t e r ( “ e ” , { r, 0 , 0 } )
sleep(1) Displaying Letter
r = randint (0,255) “e” on LED
Matrix
sense.show_letter(“d”, {0, 0, r})
sleep(1) Clearing Sense
sense.clear() Hat LED Matrix.
Output.
How the Code Work.
 Imports necessary modules: The code imports the senseHat module from the sense_hat
library, the sleep function from the time module, and the randint function from the
random module.
 Initializes the Sense HAT: The code creates an instance of the senseHat class and
assigns it to the variable sense.
 Generates random colors: The code generates a random integer value between 0 and
255 using the randint function and assigns it to the variable r.
 Displays the letter "e" on the LED matrix: The code calls the show_letter method on
the sense object, passing the letter "e" as an argument, along with a tuple {r, 0, 0}
representing the RGB color value for the letter "e" on the LED matrix. The color is set
to red (r, 0, 0) based on the random value generated earlier. The letter "e" will be
displayed on the Sense HAT LED matrix with the randomly generated red color.
 Pauses for 1 second: The code calls the sleep function from the time module to pause
the program's execution for 1 second using the argument 1. This will introduce a delay
of 1 second before the next action.
How the code works.
 Generates another random color: The code generates a new random integer
value between 0 and 255 using the randint function and assigns it to the variable r.
 Displays the letter "d" on the LED matrix: The code calls the show_letter method on
the sense object again, passing the letter "d" as an argument, along with a tuple {0,
0, r} representing the RGB color value for the letter "d" on the LED matrix. The
color is set to blue (0, 0, r) based on the new randomly generated value of r. The
letter "d" will be displayed on the Sense HAT LED matrix with the randomly
generated blue color.
 Pauses for 1 second: The code calls the sleep function again to pause the
program's execution for 1 second.
 Clears the LED matrix: The code calls the clear method on the sense object, which
will turn off all the LEDs on the Sense HAT LED matrix.
 In summary, this code snippet displays the letters "e" and "d" on the Sense HAT LED matrix
with randomly generated red and blue colors respectively, and then clears the LED matrix after a
brief delay of 1 second between each action.
END.
Thanks for Listening.

You might also like