What is SPI?
Stands for Serial Peripheral Interface (SPI)
It is similar to I2C and it is a different form of serial-communications protocol specially designed
for microcontrollers to connect.
Operates at full-duplex where data can be sent and received simultaneously.
Operate at faster data transmission rates = 8Mbits or more
It is typically faster than I2C due to the simple protocol. Even if data/clock lines are shared
between devices, each device will require a unique address wire.
Used in places where speed is important. (eg. SD cards, display modules or when info updates
and changes quickly like thermometers)
How does it work?
Communicate with 2 ways:
1. Selecting each device with a Chip Select line. A separate Chip Select line is required
for each device. This is the most common way RPi’s currently use SPI.
2. Daisy chaining where each device is connected to the other through its data out to
the data in line of the next.
There is no limit to the number of SPI device that can be connected. However, there are practical
limits due to the number of hardware select lines available on the main device with the chip
select method or the complexity of passing data through devices in the daisy-chaining method.
In point-to-point communication, the SPI interface does not require addressing operations and is
full-duplex communication, which is simple and efficient.
Advantages of using SPI
The protocol is simple as there is no complicated slave addressing system like I2C.
It is the fastest protocol compared to UART and I2C.
No start and stop bits unlike UART which means data can be transmitted continuously without
interruption
Separate MISO and MOSI lines which means data can be transmitted and received at the same
time
What is I2C?
Stands for Inter-integrated-circuit (I2C)
It is a serial communications protocol similarly to UART. However, it is not used for PC-device
communication but instead with modules and sensors.
It is a simple, bidirectional two-wire synchronous serial bus and requires only two wires to
transmit information between devices connected to the bus.
They are useful for projects that require many different parts (eg. sensors, pin, expansions and
drivers) working together as they can connect up to 128 devices to the mainboard while
maintaining a clear communication pathway!
This is because I2C uses an address system and a shared bus = many different devices can be
connected using the same wires and all data are transmitted on a single wire and have a low pin
count. However, the tradeoff for this simplified wiring is that it is slower than SPI.
Speed of I2C is also dependent by data speed, wire quality and external noise
The I2C protocol is also used as a two-wire interface to connect low-speed devices like
microcontrollers, EEPROMs, A/D and D/A converters, I/O interfaces and other similar peripherals
in embedded systems.
How does it work?
It has 2 Lines which are SCL (serial clock line) and SDA (serial data line acceptance port)
CL is the clock line for synchronizing transmission. SDA is the data line through which bits of data
are sent or received.
The master device initiates the bus transfer of data and generates a clock to open the transferred
device and any addressed device is considered a slave device.
The relationship between master and slave devices, transmitting and receiving on the bus is not
constant. It depends on the direction of data transfer at the time.
If the master wants to send data to the slave, the master must first address the slave before
sending any data.
What is a Raspberry Pi?
Raspberry pi is the name of the “credit card-sized computer board” developed by the Raspberry pi
foundation, based in the U.K. It gets plugged in a TV or monitor and provides a fully functional computer
capability. It is aimed at imparting knowledge about computing to even younger students at the cheapest
possible price. Although it is aimed at teaching computing to kids, but can be used by everyone willing to
learn programming, the basics of computing, and building different projects by utilizing its versatility.
Raspberry Pi is developed by Raspberry Pi Foundation in the United Kingdom. The Raspberry Pi is a series
of powerful, small single-board computers.
Raspberry Pi is launched in 2012 and there have been several iterations and variations
released since then.
Various versions of Raspberry Pi have been out till date. All versions consist of a Broadcom system on a
chip (SoC) with an integrated ARM-compatible CPU and on-chip graphics processing unit (GPU).
The original device had a single-core Processor speed of device ranges from 700 MHz to 1.2 GHz and a
memory range from 256 MB to 1 GB RAM.
To store the operating system and program memory Secure Digital (SD) cards are used. Raspbian OS
which is a Linux operating system is recommended OS by Raspberry Pi Foundation. Some other third
party operating systems like RISC OS Pi. Diet Pi, Kali, Linux can also be run on Raspberry Pi.
Used:
It also provides a set of general purpose input/output pins allowing you to control electronic components
for physical computing and explore the Internet of Things (IOT).
Raspberry pi Diagram :
Raspberry Pi model –
There have been many generations of raspberry Pi from Pi 1 to Pi 4.
There is generally a model A and model B.
Model A is a less expensive variant and it trends to have reduce RAM and dual cores such as
USB and Ethernet.
1. pi 1 model B – 2012
2. pi 1 model A – 2013
3. pi 1 model B+ -2014
4. pi 1 model A+ – 2014
5. Pi 2 Model B – 2015
6. Pi 3 Model B- 2016
7. Pi 3 Model B+ -2018
8. Pi 3 Model A+ -2019
9. Pi 4 Model A – 2019
10. Pi Model B – 2020
11. Pi 400 – 2021
Specs of the Computer: – The computer has a quad-core ARM processor that doesn’t support the same
instruction as an X86 desktop CPU. It has 1GB of RAM, One HDMI port, four USB ports, one Ethernet
connection, Micro SD slot for storage, one combined 3.5mm audio/video port, and a Bluetooth
connection. It has got a series of input and output pins that are used for making projects like – home
security cameras, Encrypted Door lock, etc.
Versatility of Raspberry Pi: – It is indeed a versatile computer and can be utilized by people from all age
groups, it can be used for watching videos on YouTube, watching movies, and programming in languages
like Python, Scratch, and many more. As mentioned above it has a series of I/O pins that give this board
the ability to interact with its environment and hence can be utilized to build really cool and interactive
projects.
Examples of projects: – It can be turned into a weather station by connecting some instruments to it for
check the temperature, wind speed, humidity etc… It can be turned into a home surveillance system due
to its small size; by adding some cameras to it the security network will be ready. If you love reading
books it can also become a storage device for storing thousands of eBooks and also you can access them
through the internet by using this device.
In truth, cloud computing and IoT are tightly coupled. The growth of IoT and the rapid development of
associated technologiescreate a widespread connection of ―things.‖This has lead to the production of
large amounts of data, which needs to be stored, processed and accessed. Cloud computing as a
paradigm for big data storage and analytics. While IoT is exciting on its own, the real innovation will
come from combining it with cloud computing. The combination of cloud computing and IoT will enable
new monitoring services and powerful processing of sensory data streams. For example, sensory data
can be uploaded and stored with cloud computing, later to be used intelligently for smart monitoring
and actuation with other smart devices. Ultimately, the goal is to be able to transform data to insight
and drive productive, cost-effective action from those insights. The cloud effectively serves as the brain
to improved decision-making and optimized internet-based interactions.However, when IoT meets
cloud, new challenges arise. There is an urgent need for novel network architectures that seamlessly
integrate them. The critical concerns during integration are quality of service (QoS) and qualityof
experience (QoE), as well as data security, privacy and reliability. The virtual infrastructure for practical
mobile computing and interfacing includes integrating applications, storage devices, monitoring
devices, visualization platforms, analytics tools and client delivery. Cloud computing offers a practical
utility-based model that will enable businesses and users to access applications on demand anytime
and fromanywhere.
Deployment models
Deployment in cloud computing comprises four deployment models: private cloud, public cloud,
community cloud and hybrid cloud.
A cloud storage API is an application program interface that connects a locally-based application to a
cloud-based storage system, so that a user can send data to it and access and work with data stored in
it. To the application, the cloud storage system is just another target device, like tape or disk-based
storage. An application program interface (API) is code that allows two software programs to
communicate with each other. The API defines the correct way for a developer to write a program that
requests services from an operating system (OS) or other application. APIs are implemented by function
calls composed of verbs and nouns. The required syntax is described in the documentation of the
application beingcalled
Three basic types of APIs
APIs take three basic forms: local, web-like and program-like.
1. Local APIs are the original form, from which the name came. They offer OS or middleware
services to application programs. Microsoft's .NET APIs, the TAPI (Telephony API) for voice applications,
and database access APIs are examples of the local APIform.
2. Web APIs are designed to represent widely used resources like HTML pages and are accessed
using a simple HTTP protocol. Any web URL activates a web API. Web APIs are often called REST
(representational state transfer) or RESTful because the publisher of REST interfaces doesn't save any
data internally between requests. As such, requests from many users can be intermingled as they
would be on theinternet.
3. Program APIs are based on remote procedure call (RPC) technology that makes a remote
program component appear to be local to the rest of the software. Service oriented architecture (SOA)
APIs, such as Microsoft's WS-series of APIs, are programAPIs.
The Role of Cloud Computing on the Internet of Things:
Cloud computing works to improve the efficiency of daily tasks in conjunction with the Internet of
Things. Cloud computing is about providing a path for data to reach its destination while the Internet
of Things generates a huge amount of data.
According to Amazon Web Services, there are four benefits of cloud computing:
1. No need to pre-guess infrastructure capacity needs
2. Saves money, because you only need to pay for those resources that you use, the larger
the scale, the more savings
3. In a few minutes, platforms can be deployed around the world
4. Flexibility and speed in providing resources to developers
Thus, the role of cloud computing in IoT is to work together to store IoT data, providing easy access
when needed. It’s important to note that cloud computing is an easy way to move large data packets
across the Internet generated by the IoT.
Comparison of Internet of Things and Cloud Computing:
Cloud is a centralized system helping to transfer and deliver data and files to data centers over the
Internet. A variety of data and programs are easy to access from a centralized cloud system.
The Internet of Things refers to devices connected to the Internet. In the IoT, data is stored in real-
time, as well as historical data. The IoT can analyze and instruct devices to make effective decisions, as
well as track how certain actions function.
Cloud computing encompasses the delivery of data to data centers over the Internet. IBM divides cloud
computing into six different categories:
1. Platform as a Service (PaaS) –
The cloud contains everything you need to build and deliver cloud applications so there is
no need to maintain and buy equipment, software, etc.
2. Software as a Service (SaaS) –
In this case, applications run in the cloud and other companies operate devices that
connect to users’ computers through a web browser.
3. Infrastructure as a Service (IaaS) –
IaaS is an option providing companies with storage, servers, networks and hubs processing
data for each use.
4. Public cloud –
Companies manage spaces and provide users with quick access through the public
network.
5. Private cloud –
The same as a public cloud, but only one person has access here, which can be an
organization, an individual company, or a user.
6. Hybrid cloud –
Based on a private cloud, but provides access to a public cloud.
Now, the Internet of Things refers to connecting devices to the Internet. Everyday devices such as cars
and household appliances may have an Internet connection, and with the advancement of the Internet
of Things, more and more devices will join this list.
What is IoT security (internet of things security)?
IoT security (internet of things security) is the technology segment focused on safeguarding connected
devices and networks in IoT. IoT involves adding internet connectivity to a system of interrelated
computing devices, mechanical and digital machines, objects, animals and people. Each thing has
a unique identifier and the ability to automatically transfer data over a network. However, enabling
devices to connect to the internet opens them up to serious vulnerabilities if they aren't properly
protected.
The term IoT is extremely broad, and as this technology continues to evolve, the term only becomes
broader. From watches to thermostats to video game consoles, nearly every technological device can
interact with the internet, or other devices, in some capacity.
IoT security is even broader than IoT, resulting in a variety of methodologies falling under that umbrella.
Application programming interface (API) security, public key infrastructure (PKI) authentication and
network security are just a few of the methods IT can use to combat the growing threat of cybercrime
and cyberterrorism rooted in vulnerable IoT devices.
IoT security issues and challenges
The more ways there are for devices to connect to each other, the more opportunities there are for
threat actors to intercept them. Hypertext Transfer Protocol and APIs are just two of the channels that
IoT devices rely on that hackers can intercept.
The IoT umbrella doesn't strictly include internet-based devices either. Appliances that use Bluetooth
technology also count as IoT devices and, therefore, require IoT security.
The following IoT security challenges continue to threaten the financial safety of both individuals and
organizations:
Remote exposure. Unlike other technologies, IoT devices have a particularly large attack
surface due to their internet-supported connectivity. While this accessibility is extremely
valuable, it also gives hackers the opportunity to interact with devices remotely. This is why
hacking campaigns, such as phishing, are particularly effective. IoT security, including cloud
security, has to account for a large number of entry points to protect assets.
Resource constraints. Not all IoT devices have the computing power to integrate
sophisticated firewalls or antivirus software. In fact, some devices can barely connect to
other devices. IoT devices that have adopted Bluetooth technology, for example, have
suffered from a recent wave of data breaches. The automotive industry, once again, has
been one of the markets hit the hardest.
Weak default passwords. IoT devices often come with weak passwords, and most
consumers might not be aware that they need to be replaced with more secure ones. If
default passwords aren't changed on IoT devices, it can leave them vulnerable to brute-
force and other hacking attacks.
Multiple connected devices. Most households today have multiple interconnected devices.
The drawback of this convenience is that, if one device fails due to a security
misconfiguration, the rest of the connected devices in the same household go down as well.
Lack of encryption. Most network traffic originating from IoT devices is unencrypted, which
increases the possibility of security threats and data breaches. These threats can be avoided
by ensuring all the devices are secured and encrypted.
How to protect IoT systems and devices
1. Introduce IoT security during the design phase. Of the IoT security risks and issues
discussed, most can be overcome with better preparation, particularly during the research
and development process at the start of any consumer-, enterprise- or industrial-based IoT
(IIoT) device development. Enabling security by default is critical, along with providing the
most recent operating systems and using secure hardware.
2. PKI and digital certificates. PKI can secure client-server connections between multiple
networked devices. Using a two-key asymmetric cryptosystem, PKI can facilitate the
encryption and decryption of private messages and interactions using digital certificates.
These systems help to protect the clear text information input by users into websites to
complete private transactions. E-commerce wouldn't be able to operate without the security
of PKI.
3. Network security. Networks provide a huge opportunity for threat actors to remotely
control IoT devices. Because networks involve both digital and physical components, on-
premises IoT security should address both types of access points. Protecting an IoT network
includes ensuring port security, disabling port forwarding and never opening ports when not
needed; using antimalware, firewalls, intrusion detection systems and intrusion prevention
systems; blocking unauthorized IP addresses; and ensuring systems are patched and up to
date. Protecting the network is a key responsibility of IoT security.
4. API security. APIs are the backbone of most sophisticated websites. They enable travel
agencies, for example, to aggregate flight information from multiple airlines into one
location. Unfortunately, hackers can compromise these channels of communication,
making API security necessary for protecting the integrity of data being sent from IoT
devices to back-end systems and ensuring only authorized devices, developers and apps
communicate with APIs. T-Mobile's 2018 data breach exposed the consequences of poor API