Internet of Thing Notes
Internet of Thing Notes
IoT is the concept of connecting everyday physical objects to the internet to send,
receive, and process data.
IoT stands for Internet of Things. It refers to the interconnectedness of physical
devices, such as appliances and vehicles, that are embedded with software, sensors,
and connectivity which enables these objects to connect and exchange data. This
technology allows for the collection and sharing of data from a vast network of
devices.
IOT Ecosyatem :
IoT ecosystems enable devices to communicate and exchange data in real time, making
it possible for organizations to collect and analyze large amounts of data,
automate processes, and improve decision-making. For example, an IoT ecosystem
could be used to monitor and control the energy consumption of a smart building or
to track and manage a fleet of vehicles in real-time.
Devices and Sensors ? IoT devices are embedded with sensors, actuators, and other
components that enable them to collect and transmit data. Examples of IoT devices
include smart home appliances, wearables, industrial machines, and vehicles.
Cloud Computing ? IoT platforms often include cloud-based services that enable data
storage, analytics, and visualization. The cloud provides a scalable and flexible
infrastructure for managing the large amounts of data generated by IoT devices.
Data Analytics and Machine Learning ? IoT generates vast amounts of data that can
be analyzed to derive insights and make informed decisions. Data analytics and
machine learning techniques are used to process and analyze the data to extract
meaningful insights.
Applications and Services ? IoT applications are the software programs that enable
users to interact with the IoT ecosystem. These applications can be designed for
specific use cases such as smart home automation, healthcare monitoring, or
industrial automation. Services such as device management, security, and data
processing are also important components of the IoT ecosystem.
Architecture of IoT :
The Internet of Things (IoT) architectural framewor xk refers to the structure
that defines how IoT systems are designed, deployed, and managed. It encompasses
different layers, components, and technologies that work together to collect,
transmit, process, and act on data from connected devices.
IoT architecture is the structure that allows for interconnected devices, cloud
services and protocols to create an IoT ecosystem. This network consists of smart
sensors, actuators and other connected elements that enable data flow from physical
sources through networks into storage in the cloud.
2. Network Layer
Function: Transfers the collected data to other layers (like the processing or
application layers).
Technologies: Wi-Fi, 5G, Bluetooth, Zigbee, LoRa, Ethernet, IPv6, MQTT, CoAP.
Components: Databases, cloud platforms (AWS IoT, Azure IoT Hub), edge computing
nodes.
Purpose: Filtering, preprocessing, and managing data; may include analytics and
decision-making logic.
4. Application Layer
Function: Provides application-specific services and interfaces to users.
Purpose: Enables users to interact with the IoT system and derive actionable
insights.
5. Business Layer (Optional in some models)
Function: Handles overall IoT system management, policies, and business logic.
Purpose: Defines business models, analyzes big data trends, and makes strategic
decisions.
Interoperability :Devices and platforms must work together despite being from
different vendors.
Standard protocols like MQTT, CoAP, and RESTful APIs support this.
Security and Privacy : Protecting device data, user identity, and communication
channels is critical.
Heterogeneity : IoT systems consist of various device types, data formats, and
network technologies.
Intelligence and Automation : IoT systems often use AI/ML for predictive analytics,
automation, and anomaly detection.
Energy Efficiency : Many IoT devices run on batteries; hence, low-power design is
essential.
These can also transmit information and share files through different types of
wireless or wired connections. They can generate data, which is used to perform
analysis and perform operations for improving the system.
Now let’s understand which devices are used for which function in an IoT system.
Connectivity: Devices like USB hosts and ETHERNET provide connectivity between the
devices and the server.
Processor: Processors like the CPU and other units process the data. This is used
to improve the decision quality of an IoT system.
Audio/Video Interfaces: System interfaces like HDMI and RCA devices record audio
and videos.
Input/Output interface: Devices like UART, SPI, CAN, etc give input and output
signals to sensors and actuators in iot.
Storage Interfaces: IoT devices like SD, MMC, and SDIO generate data. Storage
interfaces store those data.
Controlling of activity: Devices like DDR and GPU control the activity of an IoT
system.
IoT Protocols :
IoT communication protocols establish between a node device and a server over the
internet by sending commands to an IoT device and receiving data from an IoT
device. Both the server and client side use different types of protocols. By
network layers, they are managed. Some of the network layers are the application,
transport, network, and link layers. It works as a building block for the logical
and physical design of IoT.
IoT protocols are the rules and standards that enable communication between devices
in the Internet of Things (IoT). They are crucial for smooth data transmission and
interoperability, ensuring that different devices can work together regardless of
their manufacturer or platform. These protocols are the "language" devices use to
communicate, allowing them to share information and coordinate actions.
Categorization:
Network Protocols:
These define how devices connect and communicate across networks, such as LoRaWAN,
Bluetooth, Zigbee, and WiFi.
Data Protocols:
These focus on how data is formatted and exchanged, such as MQTT, CoAP, and XMPP.
Some of the protocols are :
Application Layer protocol- Protocols in this layer define how the data is sent
over the network. With the lower layer protocols, the application interface sends
these data. Examples include HTTP, WebSocket, XMPP, MQTT, DDS, and AMQP protocols.
HTTP (HyperText Transfer Protocol)- This protocol for transmitting media documents
in an application layer by communicating between web browsers and servers. HTTP
provides a standard between a web browser and a web server to establish
communication. It is a set of rules for transferring data from one computer to
another. Data such as text, images, and other multimedia files are shared on the
World Wide Web.
Transport Layer- it controls the flow of data segments. It also handles error
control and provides end-to-end message transfer capability.
Sensors :
In the Internet of Things (IoT), sensors are fundamental devices that gather data
from the physical environment and transmit it to the cloud or local edge devices
for analysis and action.
They act as a bridge between the physical and digital worlds, enabling IoT
devices to monitor, control, and respond to changes in their surroundings.
A sensor is a device that detects changes in the environment and converts them into
signals (usually electrical) that an IoT system can understand and process.
In the Internet of Things (IoT), sensors are crucial components that allow devices
to perceive the physical world. They gather data (like temperature, motion, light,
etc.) and send it to a processor or controller for analysis or action.
Accuracy & Precision : Sensors must provide reliable data with minimal error.
Precision refers to the sensor’s ability to deliver consistent readings over
multiple measurements.
Range : The span of values a sensor can accurately measure (e.g., 0°C to 100°C for
a temperature sensor).
Must be suitable for the intended IoT application.
Resolution : The smallest change in a measured variable that the sensor can detect.
Higher resolution means more detailed data.
Response Time : How quickly a sensor reacts to a change in the measured input.
Faster response times are critical for real-time IoT systems.
Types of Sensors :
Passive Sensors are the ones that cannot independently sense the input. However,
active sensors can sense the input independently.
Active Sensors : Active sensors emit their own signal or energy (like light, sound,
or radio waves) to detect objects or gather information. They require an external
source to work.
These sensors generate or emit signals or energy into the environment to measure a
parameter. They require an external power source. Examples include radar sensors,
LiDAR, and ultrasonic sensors. Active sensors send out signals and then measure the
response.
LIDAR (Light Detection and Ranging) – Uses laser pulses to measure distances
Ultrasonic Sensor – Sends out ultrasonic sound waves and measures their reflection
Passive Sensors : Passive sensors do not emit any signal. They simply detect and
measure energy or signals that are already present in the environment. These
sensors detect changes in the environment or receive signals from external sources
without emitting any energy or signals. They don't require an external power
source. Examples include temperature sensors, light sensors, and RFID tags. Passive
sensors only receive signals or measure existing energy.
Analog sensors : These sensors produce a continuous output signal that varies
smoothly in response to the input. The output signal is a continuous function of
the input parameter.
Analog Sensor :
Gives continuous output
Digital Sensor : These sensors produce discrete (binary) outputs. They are designed
to overcome some of the limitations of analog sensors.
Digital Sensor :
Gives discrete output
Scaler sensors only use the input parameter's magnitude to detect it. But in the
case of a vector, the magnitude of the direction and orientation of the input
parameter determines the sensor's response.
Scalar sensors measure magnitude only, not direction. They give a single value as
output.
Vector Sensors :
Vector sensors measure both magnitude and direction. They give multiple values
(usually in x, y, and z directions).
Actuators :
An actuator is a mechanical device that converts a control signal into physical
movement or action.
An actuator is a device that transforms energy into mechanical motion. It takes an
input signal—often electrical—and produces linear or rotary motion, allowing
machines and systems to perform tasks like pushing, pulling, lifting, rotating, or
clamping.
Actuators come in different types depending on the energy source and the mechanism
they use for movement. Some common types include:
Electric :
These use electrical energy to generate motion, often through the use of motors,
solenoids, or piezoelectric elements.
Advantages :
Disadvantages :
It is expensive.
It depends a lot on environmental conditions.
Advantages :
Hydraulic actuators can produce a large magnitude of force and high speed.
Used in welding, clamping, etc.
Used for lowering or raising the vehicles in car transport carriers.
Disadvantages :
Hydraulic fluid leaks can cause efficiency loss and issues of cleaning.
It is expensive.
It requires noise reduction equipment, heat exchangers, and high maintenance
systems.
Pneumatic :
Pneumatic actuators use compressed air to produce motion, often employing cylinders
or rotary actuators.
Advantages :
They are a low-cost option and are used at extreme temperatures where using air is
a safer option than chemicals.
They need low maintenance, are durable, and have a long operational life.
It is very quick in starting and stopping the motion.
Disadvantages :
Zigbee :
Zigbee is one of the wireless personal area network (WPAN) specifications. Zigbee
is a wireless communication protocol designed for short-range, low-power, low-data-
rate applications.
It is widely used in home automation, smart lighting, industrial control, and IoT
(Internet of Things) devices. ZigBee is a technological standard created for
controlling and sensing the network.
If we want a network for short-range communication for streaming audio, we opt for
Bluetooth. For streaming videos and larger files, we use Wi-Fi. But, we need a
network using which we can connect a large number of battery-powered devices.
We can't go for Wi-Fi because of its high energy requirements, and we can't choose
Bluetooth even though it consumes less power, as only a small number of devices can
be connected using Bluetooth.
We need a network that can connect many battery-powered devices, and the main
aspect here is low energy/ power consumption. This is the whole purpose of
developing Zigbee Technology. Zigbee revolves around control and sensor networks.
Hence, it is one of the most common standards and applications for the Internet of
Things (IoT).
Zigbee networks use Mesh Topology, which gives a separate link for every device
pair in the Network. Even if one link fails, the Network can utilize another
alternate path/ link for communication. Hence, it is reliable.
Wi-Fi and Bluetooth networks, on the other hand, use Star topology, where each
node/ device is connected to a central node that can be a hub, router, or switch.
If the link to a device fails, the device gets disconnected from the Network. If
the central node fails, the whole Network will be down.
The catch with these networks is that they offer a low data rate.
Advantages of Zigbee:
Mesh Networking :
Devices can relay data through each other, increasing range and reliability.
Even if one device fails, the network can still work using other routes.
Scalability :
Cost-Effective :
Zigbee modules and devices are generally cheaper than Wi-Fi or cellular modules.
Secure Communication :
Fast Setup :
Quick and easy to set up, especially for home automation systems.
❌ Disadvantages of Zigbee:
Only supports speeds up to 250 kbps — not suitable for high-data tasks like video.
Zigbee uses the 2.4 GHz band, which can cause interference with Wi-Fi devices.
Limited Compatibility :
Not all Zigbee devices work with each other unless they follow the same profile.
Needs a Coordinator/Hub :
Many Zigbee systems need a central hub (like a smart home hub), which can add to
the cost or complexity.
RFID is a wireless technology used to identify and track objects using radio waves.
RFID (Radio Frequency Identification) is a technology that uses electromagnetic
fields to automatically identify and track tags attached to objects.
RFID is commonly used in inventory management, asset tracking, access control, and
supply chain logistics due to its efficiency and accuracy in tracking and managing
items. It is a method that is used to track or identify an object by radio
transmission over the web. Data is digitally encoded in an RFID tag which might be
read by the reader.
This device works as a tag or label during which data is read from tags that are
stored in the data
base through the reader as compared to traditional barcodes and QR codes.
The transponder is in the RFID tag itself. The read range for RFID tags varies
based on factors including the type of tag, type of reader, RFID frequency and
interference in the surrounding environment or from other RFID tags and readers.
Tags that have a st ronger power source also have a longer read range.
1. Passive Tags
No built-in power source, relying on the RFID reader.
Less expensive, longer lifespan, shorter read range (up to a few meters).
2. Active Tags
Have their own power source (battery), allowing for a longer read range (up to
hundreds of meters).
More expensive, limited lifespan due to the battery.
3. Semi-Passive Tags
Small battery powers the tag’s circuitry.
Middle ground in terms of cost, range, and lifespan.
At least one transmitting device and another receiving device are needed to
transmit the signal. Many devices can use the NFC standard and are considered
either passive or active.
NFC can be used for various purposes, including contactless transactions, data
exchange, and simplified setup of more complex communications (e.g., Wi-Fi). When
one of the connected devices has internet connectivity, data exchange with online
services is also possible. The NFC standard currently has three distinct modes of
operation to determine what sort of information will be exchanged between devices.
1) The most commonly used in smartphones is the peer-to-peer mode. The exchange of
various pieces of information is allowed between 2 devices. In this mode both
devices switch between active when sending data and passive when receiving.
2) The second mode i.e. read/write mode is a one-way data transmission. The active
device, possibly your smartphone, links up with another device in order to read
information from it. NFC advertisement tags use this mode.
3) The third mode of operation is card emulation. The NFC device can function as a
smart or contactless credit card and make payments or tap into public transport
systems.
✅ Advantages of NFC:
Secure :
Works only at a very short range, making it hard for others to intercept data.
Fast Communication :
Connection happens in less than a second.
❌ Disadvantages of NFC:
Short Range :
Only works when devices are very close (within a few centimeters).
Compatibility Issues :
Both devices must support NFC.
Security Concerns :
Though secure, if not properly managed, it can still be used for data theft (e.g.,
skimming).
Clients publish messages on different topics to brokers. The broker is the central
server that receives these messages and filters them based on their topics. It then
sends these messages to respective clients that have subscribed to those different
topics. The heart of any publish/subscribe protocol is the MQTT broker. A broker
can handle up to thousands of concurrently connected MQTT customers, depending on
how it is implemented. All communications must be received by the broker, who will
then sort them, ascertain who subscribed to each one, and deliver the messages to
the clients who have subscribed. All persistent customers’ sessions, including
missed messages and subscriptions, are likewise kept by the Broker.
Hence client that has subscribed to a specific topic receives all messages
published on that topic.
Here the broker is central hub that receives messages, filters them, and
distributes them to appropriate clients, such that both message publishers, as well
as subscribers, are clients.
Working of MQTT :
The term “subscribe” refers to the reversal of the procedure. Several clients can
connect to a broker under the pub/sub paradigm and subscribe to subjects that
interest them.
MQTT method:
1. CONNECT: A client initiates a connection with the broker by sending a CONNECT
message, specifying details like client ID, username, and password.
2. SUBSCRIBE: A client subscribes to one or more topics to receive messages
published to those topics.
3. PUBLISH: A client publishes a message to a specific topic, which the broker then
delivers to all subscribed clients.
4. UNSUBSCRIBE: A client unsubscribes from one or more topics to stop receiving
messages.
5. DISCONNECT: A client terminates its connection with the broker by sending a
DISCONNECT message.
Setup: In this phase, the publishers and subscribers register themselves to the
broker and get a secret master key.
Encryption: When the data is published to broker, it is encrypted by broker.
Publish: The broker publishes the encrypted message to the subscribers.
Decryption: Finally the received message is decrypted by subscribers with the same
master key.
CoAP is based on UDP and uses a simple request-response model, making it efficient
and well-suited for IoT environments.
The Client requests for some resources and in response to that, the server sends
some response over which the client sends an acknowledgement.
Asynchronous Messaging: CoAP messages are asynchronous because it uses the User
Datagram Protocol (UDP). Unlike TCP-based protocols, CoAP does not require
acknowledgments for every message, which helps conserve energy in resource-
constrained devices.
CoAP messages are classified into four types: Confirmable (CON), Non-confirmable
(NON), Acknowledgement (ACK), and Reset. These types are distinguished by a two-bit
field in the CoAP header, indicating whether a message requires a confirmation or
can be sent without waiting for an acknowledgment.
Confirmable (CON):
Requires a confirmation (ACK) from the recipient to ensure the message was received
successfully. If an ACK is not received within a certain timeframe, the message is
resent with an exponential backoff.
Non-confirmable (NON):
Does not require a confirmation and is sent without waiting for an acknowledgment.
This type is suitable for applications where reliability is less critical and where
message loss is acceptable.
Acknowledgement (ACK):
A response message that acknowledges the successful receipt of a Confirmable
message. It confirms that the message has been received and processed by the
recipient.
Reset:
A message sent to indicate a message is out of order or to clear the state of the
communication. It helps in managing message duplication and ensuring proper
sequence of messages in the communication.
Advanced Message Queuing Protocol is an open standard session layer protocol useful
for sending transnational messages that is why mainly used in the financial
industry. It runs over TCP (Transmission Control Protocol) or UDP (User Datagram
Protocol) which is nearly similar to that of MQTT. But only difference is that
Broker(Dealer) contains Exchange and Queues as a result it is focused on not losing
messages. The exchange receives messages from publishers and distributes them to
respective queues. Different subscribers collect topic wise sensory data from
respective topic queues.
Brokers:
Brokers act as intermediaries, routing messages from producers to the appropriate
consumers based on routing rules and queue configurations.
Reliable Messaging:
AMQP provides features like acknowledgements and message delivery guarantees,
ensuring that messages are delivered reliably.
Security:
AMQP supports secure connections using protocols like SSL and TLS.
IoT Platforms :
An IoT platform is a robust software solution to build and deploy IoT applications.
An IoT platform collects, manages, and analyses the data generated by IoT devices
to provide efficient and scalable solutions for businesses.
Device Management:
IoT platforms enable the registration, configuration, and remote monitoring of
connected devices.
Data Management:
They handle the collection, storage, processing, and analysis of data generated by
IoT devices, often including data visualization tools.
Application Enablement:
IoT platforms provide tools and APIs for building applications that leverage IoT
data.
Integration:
They facilitate integration with other systems and services, allowing for seamless
data flow and interoperability.
Security:
IoT platforms implement security measures to protect connected devices and data
from unauthorized access.
Arduino :
Core Functionality:
Data Collection:
Arduino boards can be programmed to read data from sensors, such as temperature,
light, humidity, and motion.
Data Processing:
The Arduino's microcontroller processes the data received from sensors, potentially
performing calculations or filtering.
Actuation:
Arduino boards can control actuators, like motors, LEDs, or relays, to respond to
changes in data or user input.
Communication:
Arduino can communicate with other devices, including the internet, using various
protocols like Wi-Fi, Bluetooth, and Ethernet.
Raspberry Pi :
The physical attributes of a Raspberry Pi are tiny. It’s just a miniature computer,
with as much function as a user wants. If they want to add more features like an
extra USB slot, it’s a simple case of soldering one onto the circuit board.
Any Raspberry Pi model works just like every other computer. All it needs is a
power source, a display, and something to input commands.
Distributed denial of service (DDoS) attacks: DDoS attacks on IoT devices overload
the network by flooding it with constant traffic, such as fake requests. This way,
an attacker overwhelms the system, crashes it, and causes a denial of service to
legitimate users.
Password cracking: Hackers use different methods, like brute force attacks, to
decrypt system passwords and gain access to IoT devices. The weaker the default
passwords and password practices, the easier it is for attackers to hijack IoT
systems.
These most common IoT attacks underscore the importance of strong security
measures, regular software updates, secure passwords, and intrusion detection
systems (IDS). It’s always better to take care of your system security now so you
don’t have to regret it later.
How IoT devices are attacked or vulnerability analysis in IoT:
Most IoT devices offer immense convenience and efficiency for our daily lives and
routine tasks, whether at home or work. Aside from your laptop, smartphone, or
tablet, which are relatively well secured, other devices like smart TVs or
wearables to track your steps are more often exposed to cybersecurity threats, so
it's important to consider the IoT network security. The following are the most
common reasons why your IoT devices may become a sweet catch for hackers:
Weak passwords: One of the fundamental reasons IoT devices are a prime target for
threat actors is default or easy-to-guess passwords that allow them entry into the
device with little effort.
Unsecured cloud storage: Lack of protection in cloud storage may allow hackers to
manipulate or steal your confidential data easily.
Unpatched software. Because outdated IoT software or firmware contain known
vulnerabilities, it provides threat actors a loophole to exploit weaknesses.
Insecure network connections: Public or unsecured Wi-Fi networks increase the risk
of devices being attacked and ease hackers’ process of gaining control over them.
Lack of encryption: Anyone who intercepts your unencrypted traffic can read it.
This applies to any traffic you choose to leave outside the secure VPN tunnel —
exposing sensitive information is a major split tunneling security risk.
It is a concept where two or more than two machines communicate with each other
without human interaction using a wired or wireless mechanism. M2M is an technology
that helps the devices to connect between devices without using internet.
M2M involves devices, such as sensors, actuators, and other smart devices,
communicating directly with each other to exchange data, perform tasks, and respond
to events in real-time.
How it works:
M2M systems use wired or wireless communication channels to transfer data and
execute tasks autonomously. For example, a sensor might measure a specific value
and transmit it to another machine or network entity that then performs a specific
action without human intervention.
sensor node :
Processing Unit:
This unit, often a microcontroller, processes the data received from the sensing
unit. It can perform tasks such as data conversion, filtering, and analysis before
transmitting it.
Communication Unit:
This component allows the sensor node to communicate with other nodes or a central
system. It typically includes a radio transceiver or other wireless communication
modules to transmit data wirelessly.
Power Unit:
This unit provides the necessary power for the sensor node to operate. It can be a
battery, a power harvester, or another power source.
Bias:
A constant error that shifts the sensor's readings away from the true value. For
example, a temperature sensor might always read 2 degrees Celsius higher than the
actual temperature.
Drift:
A gradual change in the sensor's performance over time. This could be due to aging,
changes in temperature, or other environmental factors. Over time, a pressure
sensor might start reading lower than the true pressure.
Hysteresis:
When a sensor's output is not the same for the same input value, depending on
whether the input is increasing or decreasing. For example, a humidity sensor might
show different readings when the humidity is increasing versus decreasing.
Quantization error:
This occurs because sensors often convert analog signals (like a continuous range
of voltage) into digital values (like discrete numbers). This conversion process
has a limited resolution, meaning that small changes in the analog input might not
be accurately represented in the digital output. This can be seen as a step-like
representation of a smooth curve, with each step being a quantized value.