Unit 5 Part1 PPT Es and Iot
Unit 5 Part1 PPT Es and Iot
Simple Desktop
Raspberry pi
smart mirror
Gaming Device
Robot
CC Tv Camera
Applications of Raspberry Pi
Benefit and Limit of Raspberry Pi
• Actuation:
• IoT devices can have various types of actuators attached that allow taking actions
upon the physical entities in the vicinity of the device. Example relay switch
connected to an IoT device can turn appliances on/off based on the commands
send to the device.
• Processors:
• Processors are the brain of the IoT system. Their main function is to process the
data captured by the sensors and process them so as to extract the valuable data
from the enormous amount of raw data collected. It gives intelligence to the
data. Processors mostly work on real-time basis and can be easily controlled by
applications. These are also responsible for securing the data – that is performing
encryption and decryption of data.
IoT Physical Devices & Endpoints
• Communication:
• It is responsible for sending collected data to other devices or cloud based
servers/storage and receiving data from other devices and commands from
remote applications.
• Gateways are responsible for routing the processed data and send it to proper
locations for its (data) proper utilization. Gateway helps in to and fro
communication of the data. It provides network connectivity to the data.
• Network connectivity is essential for any IoT system to communicate. LAN, WAN,
PAN etc are examples of network gateways.
• Analysis & Processing:
• These are responsible for taking decision based upon the collected data.
• Given diagram shows the Single Board Computer(SBC) based IoT device that
includes CPU, GPU,RAM, storage and various types of interfaces and peripherals.
IoT Physical Devices & Endpoints
• What are IoT devices?
IoT Device
• IoT devices are the nonstandard computing devices that connect wirelessly to a network and have the ability to
transmit data, such as the many devices on the internet of things (IoT).
• IoT involves extending internet connectivity beyond standard devices, such as desktops, laptops, smartphones
and tablets, to any range of traditionally "dumb" or non-internet-enabled physical devices and everyday objects.
Embedded with technology, these devices can communicate and interact over the internet. They can also be
remotely monitored and controlled.
• What are the IoT devices and examples of IoT devices?
• IoT devices are pieces of hardware, such as sensors, actuators, gadgets, appliances, or machines, that are
programmed for certain applications and can transmit data over the internet or other networks. They can be
embedded into other mobile devices, industrial equipment, environmental sensors, medical devices, and more.
• There are several top devices in the market. Smart Mobiles, smart refrigerators, smart watches, smart fire
alarm, smart door lock, smart bicycle, medical sensors, fitness trackers, smart security system etc., are few
examples of IoT products.
• Why IoT Devices?
• Increasingly, IoT devices are using AI and machine learning to bring intelligence and autonomy to systems and
processes, such as autonomous driving, industrial smart manufacturing, medical equipment, and home
automation. Many of these devices are small, power- and cost-constrained microcontroller-based systems.
Network bandwidth and consumer expectations around data privacy and user experience continue to demand
more on-device processing, where data is processed on the IoT endpoint, rather than using cloud-based
approaches.
IoT Device
• How do IoT Devices Work?
• Different IoT devices have different functions, but they all have
similarities in terms of how they work. Firstly, IoT devices are physical
objects that sense things going on in the physical world. They contain
an integrated CPU, network adapter and firmware, and are usually
connected to a Dynamic Host Configuration Protocol server. It also
requires an IP address to function over the network.
• Most IoT devices are configured and managed through a software
application. For example, an app on your smartphone to control the
lights in your home. Some devices also have integrated web servers,
which eliminates the need for external applications. For example, the
lights switch on immediately when you enter a room.
Examples of IoT Devices
• Home Security
• The key driver behind smart and secure homes is IoT. A variety of sensors, lights, alarms and cameras (all
of which can be controlled from a smartphone) are connected via IoT to provide 24x7 security.
• Activity Trackers
• Smart home security cameras provide alerts and peace of mind. Activity trackers are sensor devices that
can monitor and transmit key health indicators in real-time. You can track and manage your blood
pressure, appetite, physical movement and oxygen levels.
• Industrial Security and Safety
• IoT-enabled detection systems, sensors and cameras can be placed in restricted areas to detect
trespassers. They can also identify pressure buildups and small leaks of hazardous chemicals and fix them
before they become serious problems.
• Augmented Reality Glasses
• Augmented Reality (AR) glasses are wearable computer-enabled glasses that help you get extra
information such as 3D animations and videos to the user's real-world scenes. The information is
presented within the lenses of the glasses and can help users access Internet applications.
• Motion Detection
• Motion sensors can detect vibrations in buildings, bridges, dams and other large-scale structures. These
devices can identify anomalies and disturbances in the structures that could lead to catastrophic failures.
They can also be used in areas susceptible to floods, landslides, and earthquakes.
Most Popular IoT Devices in 2021
• 1. Google Home Voice Controller
• Google Home voice controller is one of the most popular IoT devices out there today. It
provides voice-enabled services like alarms, lights, thermostats, volume control and lots more.
• 2. Amazon Echo Plus Voice Controller
• Amazon Echo Plus voice controller is another popular and reliable IoT device on the market. It
provides voice-enabled services like answering phone calls, setting timers and alarms, checking
the weather, and lots more.
• 3. August Doorbell Cam
• August Doorbell Cam is an IoT device that allows you to answer your door from any remote
location. It constantly captures motion changes and suspicious activity in your doorstep.
• 4. August Smart Lock
• August Smart Lock is a proven and reliable security IoT device that helps users to manage their
doors from any remote location. It helps keep thieves away and provides an extra layer of
security for your home.
• 5. Foobot
• Foobot is an IoT device that can accurately measure indoor pollution. It helps to improve the air
quality in houses, cafes, workplaces, and other indoor public spaces.
Building Blocks
• Building IOT with RASPERRY PI
• Internet of Things The Internet of Things (IoT) is a scenario in which
objects, animals or people are provided with single identifiers and the
capability to automatically transfer and the capability to automatically
transfer data more to a network without requiring human-to-human
or human-to-computer communication.
Introduction to Raspberry Pi
• The Raspberry Pi is a very cheap computer that runs Linux, but it also provides a
set of GPIO (general purpose input/output) pins that allow you to control
electronic components for physical computing and explore the Internet of Things
(IoT).
• Raspberry Pi was basically introduced in 2006.
• It is particularly designed for educational use and intended for Python.
• A Raspberry Pi is of small size i.e., of a credit card sized single board computer,
which is developed in the United Kingdom(U.K) by a foundation called Raspberry
Pi.
• There have been three generations of Raspberry Pis: Pi 1, Pi 2, and Pi 3
• The first generation of Raspberry (Pi 1) was released in the year 2012, that has
two types of models namely model A and model B.
• Raspberry Pi can be plugged into a TV, computer monitor, and it uses a standard
keyboard and mouse. It is user friendly as can be handled by all the age groups
Introduction to Raspberry Pi
• It does everything you would expect a desktop computer to do like word-processing, browsing the
internet spreadsheets, playing games to playing high definition videos.
• All models feature on a broadcom system on a chip (SOC), which includes chip graphics processing
unit GPU(a Video Core IV), an ARM compatible and CPU.
• The CPU speed ranges from 700 MHz to 1.2 GHz for the Pi 3 and on board memory range from
256 MB to 1 GB RAM.
• An operating system is stored in the secured digital SD cards and program memory in either the
MicroSDHC or SDHC sizes.
• Most boards have one to four USB slots, composite video output, HDMI and a 3.5 mm phone jack
for audio. Some models have WiFi and Bluetooth.
• Several generations of Raspberry Pis have been released.
• All models feature a Broadcom system on a chip (SoC) with an integrated ARMcompatible central
processing unit (CPU) and on-chip graphics processing unit (GPU).
• Processor speed ranges from 700 MHz to 1.4 GHz for the Pi 3 Model B+ or 1.5 GHz for the Pi 4; on-
board memory ranges from 256 MB to 1 GB with up to 4 GB available on the Pi 4 random-access
memory (RAM).
Introduction to Raspberry Pi
• Several generations of Raspberry Pis have been released.
• All models feature a Broadcom system on a chip (SoC) with an integrated
ARMcompatible central processing unit (CPU) and on-chip graphics processing unit
(GPU).
• Processor speed ranges from 700 MHz to 1.4 GHz for the Pi 3 Model B+ or 1.5 GHz
for the Pi 4; on-board memory ranges from 256 MB to 1 GB with up to 4 GB
available on the Pi 4 random-access memory (RAM).
• Secure Digital (SD) cards in MicroSDHC form factor (SDHC on early models) are used
to store the operating system and program memory.
• The boards have one to five USB ports. For video output, HDMI and composite
video are supported, with a standard 3.5 mm tip-ring-sleeve jack for audio output.
• Lower-level output is provided by a number of GPIO pins, which support common
protocols like I²C. The B-models have an 8P8C Ethernet port and the Pi 3 and Pi
Zero W have on-board Wi-Fi and Bluetooth.
GPIO Pin Diagram
Raspberry Pi-Components
Raspberry Pi-Components
• Components and Peripherals
• Voltages: Two 5V pins and two 3V3 pins are present on the board, as well as a
number of ground pins (0V). The remaining pins are all general purpose 3V3
pins
• A GPIO pin designated as an output pin can be set to high (3V3) or low (0V). A
GPIO pin designated as an input pin can be read as high (3V3) or low (0V).
• Processor & RAM: Raspberry based on ARM11 processor. Latest version
supports 700MHz processor and 512MB SDRAM. The Central processing unit is
the brain of the raspberry pi board and that is responsible for carrying out the
instructions of the computer through logical and mathematical operations.
• Ethernet: The Ethernet port of the raspberry pi is the main gateway for
communicating with additional devices. The raspberry pi Ethernet port is used
to plug your home router to access the internet.
Raspberry Pi-Components
• USB Ports: It has 2 USB ports. USB port provide current upto 100mA. For connecting
devices that draw current more than 100mA, an external USB powered hub is
required.
• Ethernet Port: It has standard RJ45 Ethernet port. Connect Ethernet cable or USB wifi
adapter to provide internet connectivity.
• HDMI Output: It supports both audio and video output. Connect raspberry Pi to
monitor using HDMI cable.
• Composite video Output: Raspberry comes with a composite video output with an
RCA jack that supports both PAL and NTSC video output.
• Audio Output: It has 3.5mm audio output jack. This audio jack is used for providing
audio output to old television along with RCA jack for video.
• GPIO Pins: It has a number of general purpose input/output pins. These pins are used
to connect other electronic components. For example, you can connect it to the
temperature sensor to transmit digital data.
Raspberry Pi-Components
• Display Serial Interface (DSI): DSI interface are used to connect an LCD panel to Raspberry PI.
• Cameral Serial Interface(CSI): CSI interface are used to connect a camera module to Raspberry PI.
• SD Card slot: Raspberry does not have built in OS and storage. Plug in an SD card loaded with
Linux to SD card slot.
• Power Input: Raspberry has a micro USP connector for power input.
• Memory: The raspberry pi model A board is designed with 256MB of SDRAM and model B is
designed with 51MB.Raspberry pi is a small size PC compare with other PCs. The normal PCs RAM
memory is available in gigabytes. But in raspberry pi board, the RAM memory is available more
than 256MB or 512MB
• Status LEDs: Raspberry has 5 status LEDs.
Status LED Function
ACT SD card Access
PWR 3.3V power is present
FDX Full duplex LAN Connected
LNK Link/Network Activity
100 100 Mbit LAN connected
Programming Raspberry Pi with Python
• Raspberry Pi
• The Raspberry Pi is a single-board computer developed by the
Raspberry Pi Foundation, a UK-based charity organization. Originally
designed to provide young people with an affordable computing
option to learn how to program, it has developed a massive following
in the maker and DIY communities because of its compact size, full
Linux environment, and general-purpose input–output (GPIO) pins.
• With all the features and capabilities that are packed into this small
board, there’s no shortage of projects and use cases for the Raspberry
Pi.
Programming Raspberry Pi with Python
• Some example projects include the following:
• Line-following robot
• Home weather station
• Retro gaming machine
• Real-time object detection camera
• Minecraft server
• Button-controlled music box
• Media center
• Remote experiments on the International Space Station
• If you can think of a project that would benefit from having a credit
card–sized computer attached to it, then someone has probably used
a Raspberry Pi to do it. The Raspberry Pi is a fantastic way to bring
your Python project ideas to life.
Raspberry Pi Board Overview
• The Raspberry Pi comes in a variety of form factors for different use
cases. In this tutorial, you’ll be looking at the most recent version, the
Raspberry Pi 4.
• Below is the board layout of the Raspberry Pi 4. While this layout is
slightly different from previous models of the Raspberry Pi, most of
the connections are the same. The setup described in the next section
should be the same for both a Raspberry Pi 3 and a Raspberry Pi 4:
Raspberry Pi Board Overview
Raspberry Pi Board Overview
• The Raspberry Pi 4 board contains the following components:
• General-purpose input–output pins: These pins are used to connect
the Raspberry Pi to electronic components.
• Ethernet port: This port connects the Raspberry Pi to a wired
network. The Raspberry Pi also has Wi-Fi and Bluetooth built in for
wireless connections.
• Two USB 3.0 and two USB 2.0 ports: These USB ports are used to
connect peripherals like a keyboard or mouse. The two black ports are
USB 2.0 and the two blue ports are USB 3.0.
• AV jack: This AV jack allows you to connect speakers or headphones
to the Raspberry Pi.
Raspberry Pi Board Overview
• Camera Module port: This port is used to connect the
official Raspberry Pi Camera Module, which enables the Raspberry Pi to
capture images.
• HDMI ports: These HDMI ports connect the Raspberry Pi to external
monitors. The Raspberry Pi 4 features two micro HDMI ports, allowing it to
drive two separate monitors at the same time.
• USB power port: This USB port powers the Raspberry Pi. The Raspberry Pi 4
has a USB Type-C port, while older versions of the Pi have a micro-USB port.
• External display port: This port is used to connect the official seven-inch
Raspberry Pi touch display for touch-based input on the Raspberry Pi.
• microSD card slot (underside of the board): This card slot is for the microSD
card that contains the Raspberry Pi operating system and files.
Raspberry Pi vs Arduino
• People often wonder what the difference is between a Raspberry Pi and an Arduino. The
Arduino is another device that is widely used in physical computing. While there is some
overlap in the capabilities of the Arduino and the Raspberry Pi, there are some distinct
differences.
• The Arduino platform provides a hardware and software interface for programming
microcontrollers. A microcontroller is an integrated circuit that allows you to read input
from and send output to electronic components. Arduino boards generally have limited
memory, so they’re often used to repeatedly run a single program that interacts with
electronics.
• The Raspberry Pi is a general-purpose, Linux-based computer. It has a full operating system
with a GUI interface that is capable of running many different programs at the same time.
• The Raspberry Pi comes with a variety of software preinstalled, including a web browser, an
office suite, a terminal, and even Minecraft. The Raspberry Pi also has built-in Wi-Fi and
Bluetooth to connect to the Internet and external peripherals.
• For running Python, the Raspberry Pi is often the better choice, as you get a full-fledged
Python installation out of the box without any configuration.
Setting Up the Raspberry Pi
• Unlike the Arduino, which requires only a USB cable and a computer to set up, the
Raspberry Pi has more hardware requirements to get up and running. After the initial
setup, though, some of these peripherals will no longer be required.
• Required Hardware
• The following hardware is required for the initial setup of your Raspberry Pi. If you end
up connecting to your Raspberry Pi over SSH, then some of the hardware below will not
be needed after the initial setup.
• Monitor
• You’ll need a monitor during the initial setup and configuration of the operating system.
If you’ll be using SSH to connect to your Raspberry Pi, then you won’t need the monitor
after setup. Make sure your monitor has an HDMI input.
• microSD Card
• Raspberry Pi uses a microSD card to store the operating system and files. If you buy a
Raspberry Pi kit, then it will contain a preformatted microSD card for you to use. If you
buy a microSD card separately, then you’ll need to format it yourself. Look for a microSD
card with at least 16GB of capacity.
Setting Up the Raspberry Pi
• Keyboard and Mouse
• A USB keyboard and mouse are required during the initial setup of the Raspberry
Pi. Once the setup is complete, you can switch to using Bluetooth versions of
these peripherals if you prefer. Later in this tutorial, you’ll see how to connect to
the Raspberry Pi over SSH. If you choose to connect this way, then a physical
keyboard and mouse are not required after the initial setup.
• HDMI Cables
• You’ll need an HDMI cable to connect the Raspberry Pi to a monitor. Different
Raspberry Pi models have different HDMI cable requirements:
Raspberry Pi Raspberry Pi
Raspberry Pi 4 3/2/1 Zero
micro HDMI HDMI mini HDMI
micro HDMI to HDMI to HDMI mini HDMI to
HDMI HDMI
Depending on your model, you may need to purchase a special HDMI cable or adapter.
Setting Up the Raspberry Pi
• Power Supply
• The Raspberry Pi uses a USB connection to power the board. Again,
different Raspberry Pi models have different USB connection and
power requirements.
• Below are the connection and power requirements for the different
models:
Raspberry Pi 4 Raspberry Pi 3/2/1/Zero
USB-C Micro-USB
At least 3.0 amps At least 2.5 amps
To avoid any confusion when selecting a power supply, it’s recommended that you use the official power
supply for your Raspberry Pi 4 or other model.
Setting Up the Raspberry Pi
• Optional Hardware
• You can use a whole range of additional hardware with the Raspberry Pi to
extend its capabilities. The hardware items listed below are not required to use
your Raspberry Pi but would be useful to have on hand.
• Case
• It’s nice to have a case for your Raspberry Pi to keep its components from
being damaged during normal use. When selecting a case, make sure that you
purchase the correct type for your model of the Raspberry Pi.
• Speakers
• If you want to play music or sound from your Raspberry Pi, then you’ll need
speakers. These can be any standard speakers that have a 3.5 mm jack. You can
connect the speakers to the Raspberry Pi using the AV jack on the side of the
board.
Setting Up the Raspberry Pi
• Heat Sinks (Recommended)
• The Raspberry Pi can do a lot of computing for a little board. This is one of the
reasons it’s so awesome! But this does mean that it can get a little hot
sometimes. It’s recommended that you purchase a set of heatsinks to prevent
the Raspberry Pi from throttling the CPU when it gets too hot.
• Software
• The operating system for the Raspberry Pi is stored on a microSD card. If your
card did not come from an official Raspberry Pi kit, then you’ll need to install the
operating system on it.
• There are multiple ways to set up the operating system on your Raspberry Pi. You
can find out more about the different installation options on the
Raspberry Pi website.
• In this section, you’ll look at two ways to install Raspbian, the officially
supported Raspberry Pi operating system, which is based on Debian Linux.
Setting Up the Raspberry Pi
• Raspberry Pi Imager
(Recommended)
• The Raspberry Pi foundation
recommends that you use
the Raspberry Pi Imager for the
initial setup of your SD card.
You can download the imager
from the
Raspberry Pi Downloads page.
Once on this page, download
the appropriate version for
your operating system:
Setting Up the Raspberry Pi
• After you’ve downloaded
the Raspberry Pi Imager,
start the application. You’ll
see a screen that allows
you to select the
operating system that you
want to install along with
the SD card you would like
to format:
You’ll be given two options when first loading the application: Choose OS and Choose SD Card. Select Choose OS first.
Note: There’s a chance that Windows may prevent the Raspberry Pi Imager from starting because it’s an unrecognized
application. If you receive a pop-up that says Windows protected your PC, then you can still run the application by
clicking More info and selecting Run anyway.
Setting Up the Raspberry Pi
• In the terminal window you should be able to see the following prompt:
pi@raspberrypi ~$
• This shows your username and the hostname of the Pi. Here the
username is pi and the hostname is raspberrypi.
Linux on Raspberry Pi
• Navigating and
browsing your Pi
• One of the key
aspects of using a
terminal is being able
to navigate your file
system. Go ahead and
type ls -la into the
Terminal window, and
then hit the RETURN
key. You should see
something similar to:
Linux on Raspberry Pi
• The ls command lists the contents of the directory that you are
currently in (your present working directory).
• The -la component of the command is what’s known as a 'flag'. Flags
modify the command that’s being run.
• In this case the l displays the contents of the directory in a list,
showing data such as their sizes and when they were last edited, and
the a displays all files, including those beginning with a. known as
'dotfiles'. Dotfiles usually act as configuration files for software and as
they are written in text, they can be modified by simply editing them.
Linux on Raspberry Pi
• In order to navigate to other directories, the change directory
command,cd can be used. You can specify the directory that you want
to go to by either the 'absolute' or the 'relative' path.
• So if you wanted to navigate to the phython_games directory, you
could either do cd /home/pi/phython_games or just cd
python_games (if you are currently in home/pi).
• There are some special cases that may be useful: ~ acts as an alias for
your home directory, so ~/python_games is the same as
/hoem/pi/python_games; . and .. are aliases for the current directory
and the parent directory respectively, e.g. if you were in
home/pi/python_games, cd.. would take you to /hoem/pi.
Linux on Raspberry Pi
• History and auto-complete
• Rather than type every command, the terminal allows you to scroll
through previous commands that you’ve run by pressing the up
or down keys on your keyboard.
• If you are writing the name of a file or directory as part of a command
then pressing tab will attempt to auto-complete the name of what
you are typing. For example, if you have a file in a directory
called aLongFileName then pressing tab after typing a will allow you
to choose from all file and directory names beginning with a in the
current directory, allowing you to choose aLongFileName.
Linux on Raspberry Pi
• The Sudo command
• Some commands that make permanent changes to the state of your
system require you to have root privileges to run. The
command sudo temporarily gives your account (if you’re not already
logged in as root) the ability to run these commands, provided your
user name is in a list of users ('sudoers'). When you append sudo to
the start of a command and press enter, the command following
sudo will be run using root privileges. Be very careful: commands
requiring root privileges can irreparably damage your system! Note
that on some systems you will be prompted to enter your password
when you run a command with sudo.
Linux on Raspberry Pi
• Installing software using apt
• The apt command is used to install software in Raspberry Pi OS. This is the
'package manager' that is included with any Debian-based Linux
distributions, including Raspberry Pi OS. It allows you to install and
manage new software packages on your Raspberry Pi.
• In order to install a new package, you would type sudo apt install
<package-name>, where <package-name> is the package that you want to
install.
• Running sudo apt update will update a list of software packages that are
available on your system. If a new version of a package is available,
then sudo apt full-upgrade will update any old packages to the new
version.
• Finally, sudo apt remove <package-name> removes or uninstalls a package
from your system.
Linux on Raspberry Pi
• Other useful commands
• There are a few other commands that you may find useful, these are listed below:
• cp makes a copy of a file and places it at the specified location (essentially doing a 'copy-
paste'), for example - cp file_a /home/other_user/ would copy the file file_a from your
home directory to that of the user other_user (assuming you have permission to copy it
there). Note that if the target is a folder, the filename will remain the same, but if the target
is a filename, it will give the file the new name.
• mv moves a file and places it at the specified location (so where cp performs a 'copy-
paste', mv performs a 'cut-paste'). The usage is similar to cp, so mv file_a
/home/other_user/ would move the file file_a from your home directory to that of the
specified user. mv is also used to rename a file, i.e. move it to a new location, e.g. mv
hello.txt story.txt.
• rm removes the specified file (or directory when used with -r). Warning: Files deleted in this
way are generally not restorable.
• mkdir: This makes a new directory, e.g. mkdir new_dir would create the
directory new_dir in the present working directory.
• cat lists the contents of files, e.g. cat some_file will display the contents of some_file.
Linux on Raspberry Pi
• Finding out about a command
• To find out more information about a particular command then you
can run the man followed by the command you want to know more
about (e.g. man ls). The man-page (or manual page) for that
command will be displayed, including information about the flags for
that program and what effect they have. Some man-pages will give
example usage.
Linux on Raspberry Pi
• The Linux File System
• It is important to have a basic understanding of the fundamentals of the Linux file system: where
your files are kept, where software is installed, where the danger zones are, and so on.
• Home
• When you log into a Pi and open a terminal window, or you boot to the command line instead of
the graphical user interface, you start in your home folder; this is located at /home/pi, assuming
your username is pi.
• This is where the user’s own files are kept. The contents of the user’s desktop is in a directory
here called Desktop, along with other files and folders.
• To navigate to your home folder on the command line, simply type cd and press Enter. This is the
equivalent of typing cd /home/pi, where pi is your username. You can also use the tilde key (~),
for example cd ~, which can be used to relatively link back to your home folder. For instance, cd
~/Desktop/ is the same as cd /home/pi/Desktop.
• Navigate to /home/ and run ls, and you’ll see the home folders of each of the users on the
system.
• Note that if logged in as the root user, typing cd or cd ~ will take you to the root user’s home
directory; unlike normal users, this is located at /root/ not /home/root/.
Linux on Raspberry Pi
• Linux Commands
Linux Command Use
The ls command lists the content of the current directory (or one that is specified). It
can be used with the -l flag to display additional information (permissions, owner,
ls group, size, date and timestamp of last edit) about each file and directory in a list
format. The -a flag allows you to view files beginning with . (i.e. dotfiles).
Using cd changes the current directory to the one specified. You can use relative
cd (i.e. cd directoryA) or absolute (i.e. cd /home/pi/directoryA) paths.
The pwd command displays the name of the present working directory: on a Raspberry
pwd Pi, entering pwd will output something like /home/pi.
You can use mkdir to create a new directory, e.g. mkdir newDir would create the
mkdir directory newDir in the present working directory.
To remove empty directories, use rmdir. So, for example, rmdir oldDir will remove the
rmdir directory oldDir only if it is empty.
The command rmremoves the specified file (or recursively from a directory when used
rm with -r). Be careful with this command: files deleted in this way are mostly gone for
good!
Linux on Raspberry Pi
• Linux Commands
Linux Command Use
Using cp makes a copy of a file and places it at the specified location (this is similar to copying
and pasting). For example, cp ~/fileA /home/otherUser/ would copy the file fileA from your home
cp directory to that of the user otherUser (assuming you have permission to copy it there). This
command can either take FILE FILE (cp fileA fileB), FILE DIR (cp fileA /directoryB/) or -r DIR
DIR (which recursively copies the contents of directories) as arguments.
The mv command moves a file and places it at the specified location (so where cp performs a
'copy-paste', mv performs a 'cut-paste'). The usage is similar to cp. So mv ~/fileA
/home/otherUser/ would move the file fileA from your home directory to that of the user otherUser.
mv
This command can either take FILE FILE (mv fileA fileB), FILE DIR (mv fileA /directoryB/) or DIR
DIR (mv /directoryB /directoryC) as arguments. This command is also useful as a method to
rename files and directories after they’ve been created.
The command touch sets the last modified time-stamp of the specified file(s) or creates it if it does
touch not already exist.
You can use cat to list the contents of file(s), e.g. cat thisFile will display the contents of thisFile.
cat Can be used to list the contents of multiple files, i.e. cat *.txt will list the contents of all .txt files in
the current directory.
The head command displays the beginning of a file. Can be used with -n to specify the number of
head lines to show (by default ten), or with -c to specify the number of bytes.
The opposite of head, tail displays the end of a file. The starting point in the file can be specified
tail either through -b for 512 byte blocks, -c for bytes, or -n for number of lines.
Linux on Raspberry Pi
• Linux Commands
Linux Command Use
You would normally use chmod to change the permissions for a file. The chmod command can
use symbols u (user that owns the file), g (the files group) , and o (other users) and the
chmod permissions r (read), w (write), and x (execute). Using chmod u+x filename will add execute
permission for the owner of the file.
The chown command changes the user and/or group that owns a file. It normally needs to be run
chown as root using sudo e.g. sudo chown pi:root filename will change the owner to pi and the group to
root.
ssh denotes the secure shell. Connect to another computer using an encrypted network
ssh connection. For more details see SSH (secure shell)
The scp command copies a file from one computer to another using ssh. For more details see
scp SCP (secure copy)
The sudo command enables you to run a command as a superuser, or another user. Use sudo -
sudo s for a superuser shell. For more details see Root user / sudo
The dd command copies a file converting the file as specified. It is often used to copy an entire
disk to a single file or back again. So, for example, dd if=/dev/sdd of=backup.img will create a
dd
backup image from an SD card or USB disk drive at /dev/sdd. Make sure to use the correct drive
when copying an image to the SD card as it can overwrite the entire disk
Linux on Raspberry Pi
• Linux Commands
Linux Command Use
Use df to display the disk space available and used on the mounted filesystems. Use df -h to see
the output in a human-readable format using M for MBs rather than showing number of bytes.
df
Use tar to store or extract files from a tape archive file. It can also reduce the space required by
compressing the file similar to a zip file.
tar
To create a compressed file, use tar -cvzf filename.tar.gz directory/ To extract the contents of a
file, use tar -xvzf filename.tar.gz
A pipe allows the output from one command to be used as the input for another command. The
pipes pipe symbol is a vertical line |. For example, to only show the first ten entries of the ls command it
can be piped through the head command ls | head
Use the tree command to show a directory and all subdirectories and files indented as a tree
tree structure.
Run a command in the background with &, freeing up the shell for future commands.
&
Linux on Raspberry Pi
• Linux Commands
Linux Command Use
Download a file from the web directly to the computer with wget. So wget
https://datasheets.raspberrypi.org/rpi4/raspberry-pi-4-datasheet.pdf will download the Raspberry
wget Pi 4 datasheet and save it as raspberry-pi-4-datasheet.pdf.
Use curl to download or upload a file to/from a server. By default, it will output the file contents of
curl the file
to the screen.
ShowSearch
the manual page for a file with man. To find out more, run man man to view the manual
Commands
man page of the man command.
Linux on Raspberry Pi
• Search Commands
Search Use
Command
Use grep to search inside files for certain search patterns. For example, grep
"search" *.txt will look in all the files in the current directory ending with .txt for
the string search.
grep
The grep command supports regular expressions which allows special letter
combinations to be included in the search.
nmap is a network exploration and scanning tool. It can return port and OS information
nmap about a host or a range of hosts. Running just nmap will display the options available
as well as example usage.
The hostname command displays the current hostname of the system. A privileged
hostname (super) user can set the hostname to a new one by supplying it as an argument
(e.g. hostname new-host).
Use ifconfig to display the network configuration details for the interfaces on the current
system when run without any arguments (i.e. ifconfig). By supplying the command with
ipconfig
the name of an interface (e.g. eth0 or lo) you can then alter the configuration: check
the manual page for more details.
Linux on Raspberry Pi
• Text Editors on Desktop
• Text Editor
• When using Raspberry Pi OS Desktop, in the accessories menu there is an
option to run a Text Editor. This is a simple editor which opens in a window like
a normal application. It allows use of the mouse and keyboard, and has tabs
and syntax highlighting.
• You can use keyboard shortcuts, such as Ctrl + S to save a file and Ctrl + X to
exit.
• Thonny
• Thonny is a Python REPL and IDE, so you can write and edit Python code in a
window and run it directly from the editor. Thonny has independent windows,
and syntax highlighting, and uses Python 3.
• Geany
• A fast and lightweight IDE, supporting many different file types, including C/C+
+ and Python. It is installed by default on Raspberry Pi OS.
Linux on Raspberry Pi
• Text Editors in the Terminal
• Nano
• GNU Nano is at the easy-to-use end of command-line editors. It’s installed by default, so
use nano somefile.txt to edit a file, and keyboard shortcuts like Ctrl + O to save and Ctrl + X to
exit.
• Vi
• Vi is a very old (c. 1976) command-line editor, which is available on most UNIX systems and is
pre-installed on Raspberry Pi OS. It’s succeeded by Vim (Vi Improved), which requires
installation.
• Unlike most editors, Vi and Vim have a number of different modes. When you open Vi with vi
somefile.txt, you start in command mode which doesn’t directly permit text entry. Press i to
switch to insert mode in order to edit the file, and type away. To save the file you must return
to command mode, so press the Escape key and enter :w (followed by Enter), which is the
command to write the file to disk.
• To search for the word 'raspberry' in a file, make sure you’re in command mode (press Escape),
then type /raspberry followed by n and N to flick forwards/backwards through the results.
• To save and exit, enter the command :wq. To exit without saving, enter the command :q!.
• Depending on your keyboard configuration, you may find your cursor keys don’t work. In this
case, you can use the H-J-K-L keys (which move left, down, up, and right respectively) to
navigate the file in command mode.
Linux on Raspberry Pi
• Vim
• Vim is an extension of Vi and works in much the same way, with a
number of improvements. Only Vi is installed by default so to get the
full features of Vim, install it with APT:
sudo apt install vim
• Separate PPt
• https://learn.sparkfun.com/tutorials/python-programming-tutorial-
getting-started-with-the-raspberry-pi/all
Other IoT Platforms
• The Internet of Things
concept implies the
creation of a distributed
network consisting of
numerous physical objects
equipped with embedded
software, sensors and
connectivity options that
collect and share data
with each other and with
the central platform via
the internet.
IoT Technology Overview
• IoT system architecture consists of four layers:
• Sensors and actuators collect data directly from physical objects
(devices, equipment, machines, vehicles, home appliances, people,
animals, etc.).
• Gateways and data acquisition systems convert gathered data from
the analog to the digital format.
• Edge computing ensures there’s immediate preliminary data analytics
right on devices.
• Data centers or cloud services provide deep data analysis, processing
and storage.
IoT Technology Overview
Examples of IoT systems:
• Smart home systems (security devices, intelligent lighting, conditioning,
heating, connected home appliances)
• Wearable health devices both for self-tracking of health conditions (pulse
oximeters, glucometers) and for vital sign monitoring in clinics
• Logistics tracking systems (GPS trackers, fuel level sensors, alert systems
to monitor driver behavior)
• Autonomous vehicles (farming equipment, warehouse autonomous
robots, passenger buses)
• Smart factory equipment (robotics, predictive maintenance solutions)
IoT Platform
• What Is an IoT Platform?
• An IoT platform serves as a mediator between the world of physical objects and the
world of actionable insights. Combining numerous tools and functionalities, Internet of
Things platforms enable you to build unique hardware and software products for
collecting, storing, analyzing and managing the plethora of data generated by your
connected devices and assets.
• Types of Internet of Things Platforms
• IoT products consist of numerous components:
• Hardware
• Software
• Communication technologies
• Central repository (cloud or local)
• End-user applications
Types of IoT platforms
• To cover each aspect while developing an IoT product, there are several types of IoT
platforms.
• Hardware development platforms provide physical development boards for creating
IoT devices, including microcontrollers, microprocessors, Systems on Chip (SoC),
Systems on Module (SoM).
• App development platforms serve as an integrated development environment (IDE)
with tools and features for coding applications.
• Connectivity platforms provide communication technologies to connect physical
objects with the data center (on-premise or cloud) and transmit information between
them. Among popular connectivity protocols and standards for the Internet of Things
are MQTT, DDS, AMQP, Bluetooth, ZigBee, WiFi, Cellular, LoRaWAN and more.
• Analytics platforms use intelligent algorithms to analyze collected information and
transform it into actionable insights for customers.
• End-to-end IoT platforms cover all aspects of IoT products, from development and
connectivity to data management and visualization.
Most Popular IoT Platforms in 2021
• To make it easier for you to decide which IoT platform to choose for your project, we’ve
compiled a list of the most popular Internet of Things platforms for this year, with
detailed descriptions of each one.
• Google Cloud IoT
• Cisco IoT Cloud Connect
• Salesforce IoT Cloud
• IRI Voracity
• Particle
• IBM Watson IoT
• ThingWorx
• Amazon AWS IoT Core
• Microsoft Azure IoT Hub
• Oracle IoT
IoT Platforms
1. Google Cloud IoT
• Google launched its platform for Internet of Things development on the
basis of its end-to-end Google Cloud Platform. Currently, it’s one of the
world’s top Internet of Things platforms. Google Cloud IoT is the integration
of various services that add value to connected solutions.
• Cloud IoT Core allows you to capture and handle device data. A device
manager component is used to register devices with the service, and
monitor and configure them. MQTT and HTTP protocol bridges are used for
device connection and communication with the Google Cloud Platform.
• Cloud Pub/Sub performs data ingestion and message routing for further
data processing.
• Google BigQuery enables secure real-time data analytics.
• AI Platform applies machine learning features.
• Google Data Studio visualizes data by making reports and dashboards.
• Google Maps Platform helps visualize the location of connected assets.
• The platform automatically integrates with Internet of Things hardware
producers such as Intel and Microchip. It supports various operating
systems, including Debian Linux OS.
IoT Platforms
• Core features of Google Cloud IoT:
• AI and machine learning capabilities
• Real-time data analysis
• Strong data visualization
• Location tracking
• Core use cases:
• Predictive maintenance
• Real-time asset tracking
• Logistics and supply chain management
• Smart cities and buildings
IoT Platforms
2. Cisco Iot Cloud Platform
• Cisco IoT Cloud Connect is originally an offering for mobile operators. This mobility
cloud-based software suite for industrial and individual use cases is on the list of the
best Internet of Things cloud platforms. Cisco also provides reliable IoT hardware,
including switches, access points, routers, gateways and more.
• Take a look at some examples of powerful Cisco Internet of Things products and
solutions.
• Cisco IoT Control Center ensures impeccable cellular connectivity management,
allowing you to integrate all your IoT devices in one SaaS solution.
• Extended Enterprise Solution allows for the development of IoT business applications
at the edge and ensures rapid deployment and centralized network management.
• Edge Intelligence simplifies data processing by allocating data flows either to local or
multi-cloud environments.
• Industrial Asset Vision utilizes sensors to monitor your assets continuously and
deliver data for better decision-making.
• Cisco IoT Threat Defense protects sensible data and devices against cyberattacks,
providing secure remote access, segmentation, visibility and analysis, and other
security services.
IoT Platforms
• Core features of Cisco IoT Cloud Connect:
• Powerful industrial solutions
• High-level security
• Edge computing
• Centralized connectivity and data management
• Core use cases:
• Connected cars
• Fleet management
• Home security and automation
• Payment and POS solutions
• Predictive maintenance
• Industrial networking
• Smart meters
• Healthcare
IoT Platforms
3. Salesforce IoT Cloud
• Salesforce specializes in customer relations management and
masterfully enhances this segment with the help of IoT
solutions.
• The Salesforce IoT Cloud platform gathers valuable
information from connected devices to deliver personalized
experiences to and build stronger relationships with your
customers. It works in tandem with Salesforce CRM: data from
connected assets is delivered directly to the CRM system
where context-based actions are initiated immediately.
• For example, if sensors detect an error in windmill
performance, it is instantly reflected in the CRM dashboard
and the system can either adjust parameters automatically or
create a service ticket.
IoT Platforms
• Core features of Salesforce IoT Cloud:
• Full integration of customers, products and CRM
• No need for programming skills to create rules, conditions and events due to a simple point-
and-click UI
• Compatibility with third-party websites, services and other products
• A proactive approach to customer issues and needs
• Core use cases:
• Government administration
• Machinery
• Financial services
• Marketing and advertising
• Chemicals
• By using Salesforce IoT Cloud, businesses get a holistic view of customer data, improve
customer experience and increase sales.
IoT Platforms
4. IRI Voracity
• If you need an all-in-one data management platform
that enables IoT data control at every stage of your
business processes, IRI Voracity is the perfect fit.
• This platform uses two engines, IRI CoSort and
Hadoop, to process Big Data. It can discover, govern,
integrate, analyze, transform and migrate data from
various sources and in various formats such as Unix,
Linux or Windows file systems, ISAM, MongoDB, LDIF,
HIVE, JSON, S3, PostgreSQL, MQTT, Kafka and more.
IoT Platforms
• Core features of IRI Voracity:
• A Data Governance Portal enables data search and classification in silos. It also
provides encryption and anonymization to comply with data privacy
regulations.
• A Faster ETL and Analytic Alternative performs extraction and transformation
of large-sized data much faster than legacy ETL tools.
• A DB Ops Environment allows you to administer all your databases from one
place.
• Core use cases:
• Big Data analytics
• ETL modernization
• Data governance
IoT Platforms
5. Particle
• Particle offers an IoT edge-to-cloud platform for global connectivity and device management, as well
as hardware solutions, including development kits, production modules and asset tracking devices.
With Particle’s team of IoT experts, who provide end-to-end professional services, you can develop
your product from concept to production.
• Core features of the Particle platform:
• Integration with third-party services via REST API
• Firewall-protected cloud
• Capability to work with data from Google Cloud or Microsoft Azure
• No need for technical expertise in order to use the platform
• Core use cases:
• Real-time asset monitoring
• Live vehicle tracking
• Predictive maintenance
• Environmental monitoring
• Compliance monitoring
• Real-time order fulfillment
IoT Platforms
6. IBM Watson IoT
• An IoT platform built on IBM Cloud is a fully managed cloud service for device management, flexible
and scalable connectivity options, secure communications and data lifecycle management. With
IBM Watson IoT, you can collect insights from automobiles, buildings, equipment, assets and things.
• Core features of IBM Watson IoT:
• Data ingestion from any source with the help of MQTT
• Direct access to the latest data in the Cloudant NoSQL DB solution
• Built-in monitoring dashboards to control your assets
• Analytics Service to process raw metrics
• The Cloud Object Storage solution for long-term data archiving
• Core use cases:
• Supply chain management
• Regulatory compliance
• Building management
• Energy consumption
• Shipping and logistics
IoT Platforms
7. ThingWorx
• The specialized Industrial Internet of Things (IIoT) platform ThingWorx is used in a variety of
manufacturing, service and engineering scenarios. The platform addresses common challenges across
industries, from remote monitoring and maintenance to workforce efficiency and asset optimization.
• Core features of ThingWorx:
• Access to multiple data sources due to the extension of traditional industrial communications
• Powerful ready-to-use tools and applications to create and scale IIoT solutions quickly
• Real-time insights from complex industrial IoT data to proactively optimize operations and prevent
issues
• Total control over network devices, processes and systems
• Core Use Cases:
• Remote asset monitoring
• Remote maintenance/service
• Predictive maintenance and asset management
• Optimized equipment effectiveness
IoT Platforms
8. Amazon AWS IoT Core
• One of the leading players in the market, Amazon AWS IoT Core allows you to connect devices to AWS
cloud services without the need to manage servers. The platform provides reliability and security for
managing millions of devices.
• Core features of Amazon AWS IoT Core:
• A wide choice of connection protocols, including MQTT, MQTT over WSS, HTT and LoRaWAN
• Ability to use with other AWS services such as AWS Lambda, Amazon Kinesis, Amazon DynamoDB, Amazon
CloudWatch, Alexa Voice Service and more to build IoT applications
• A high level of security provided by end-to-end encryption throughout all points of connection, automated
configuration and authentication
• Machine learning capabilities
• A variety of services for edge computing
• Core use cases:
• Connected vehicles
• Connected homes
• Asset tracking
• Smart building
• Industrial IoT
IoT Platforms
9.Microsoft Azure IoT Hub
• With the open-source Azure IoT platform from Microsoft, you can quickly build scalable and secure
edge-to-cloud solutions. Utilizing ready-to-use tools, templates and services, you can develop
flexible applications according to your company’s needs.
• 10.Analog pins The Arduino UNO board has six analog input pins A0
through A5. These pins can read the signal from an analog sensor like
the humidity sensor or temperature sensor and convert it into a
digital value that can be read by the microprocessor.
• 11.Main microcontroller Each Arduino board has its own
microcontroller (11). You can assume it as the brain of your board.
The main IC (integrated circuit) on the Arduino is slightly different
from board to board. The microcontrollers are usually of the ATMEL
Company. You must know what IC your board has before loading up a
new program from the Arduino IDE. This information is available on
the top of the IC. For more details about the IC construction and
functions, you can refer to the data sheet.
Arduino
• 14.TX and RX LEDs On your board, you will find two labels: TX
(transmit) and RX (receive). They appear in two places on the Arduino
UNO board. First, at the digital pins 0 and 1, to indicate the pins
responsible for serial communication. Second, the TX and RX led (13).
The TX led flashes with different speed while sending the serial data.
The speed of flashing depends on the baud rate used by the board. RX
flashes during the receiving process.
• 15.Digital I/O
• The Arduino UNO board has 14 digital I/O pins (15) (of which 6 provide PWM
(Pulse Width Modulation) output. These pins can be configured to work as
input digital pins to read logic values (0 or 1) or as digital output pins to drive
different modules like LEDs, relays, etc. The pins labeled “~” can be used to
generate PWM.
Arduino
• 16.AREF
• AREF stands for Analog Reference. It is sometimes, used to set an external
reference voltage (between 0 and 5 Volts) as the upper limit for the analog input
pins.
Program an Arduino
The most important advantage with Arduino is the programs can be directly loaded
to the device without requiring any hardware programmer to burn the program.
This is done because of the presence of the 0.5KB of Bootloader which allows the
program to be burned into the circuit.
All we have to do is to download the Arduino software and writing the code.
The Arduino tool window consists of the toolbar with the buttons like verify,
upload, new, open, save, serial monitor.
It also consists of a text editor to write the code, a message area which displays the
feedback like showing the errors, the text console which displays the output and a
series of menus like the File, Edit, Tools menu.
Arduino
• Steps to program an Arduino
• Programs written in Arduino are known as sketches. A basic sketch consists of 3
parts
• 1. Declaration of Variables
• 2. Initialization: It is written in the setup () function.
• 3. Control code: It is written in the loop () function.
• The sketch is saved with .ino extension. Any operations like verifying, opening a
sketch, saving a sketch can be done using the buttons on the toolbar or using
the tool menu.
• The sketch should be stored in the sketchbook directory.
• Chose the proper board from the tools menu and the serial port numbers.
• Click on the upload button or chose upload from the tools menu. Thus the code
is uploaded by the bootloader onto the microcontroller.
Arduino
5. It is more complex than IoT as IoE includes IoD (Internet of It is less complex than IoE as IoT(Internet of Things) is
Digital), IoH (Internet of Human) and IoT (Internet of Things). considered as a part of Bigger IoE ecosystem.
6. It has four pillars people, process, data, and things. It has one pillar things i.e it focuses on physical objects only.
7. It is considered as the superset for Internet of Things(IoT), along It is considered as the subset of bigger Internet of
with IoH, IoD, communication technologies and the internet Everything(IoE) and IoT is considered one generation before
iteself and it is considered a generation after IoT. IoE.
Example are Connecting roads with hospitals to save more lives, Examples are Wearable health monitors, Connected
8. Connecting homes for comfort living, Connecting food and appliances, Autonomous farming equipment, smarter energy
people in the supply chain, Elderly care monitoring. management systems, Smart surveillance.
References
• https://www.elprocus.com/building-the-internet-of-things-using-rasp
berry-pi/
• https://realpython.com/python-raspberry-pi/
• https://www.sam-solutions.com/blog/top-iot-platforms/
• https://www.sam-solutions.com/blog/what-is-internet-of-everything-i
oe
/
• https://www.geeksforgeeks.org/difference-between-ioe-and-iot/
• https://
www.raspberrypi.org/documentation/computers/using_linux.html