All in One R22
All in One R22
🟢 Definition of IoT
The Internet of Things (IoT) is a network of interconnected physical devices that are embedded with sensors, software,
and other technologies to collect and exchange data without requiring human-to-human or human-to-computer
interaction. These devices can communicate, analyze, and act on data—often in real-time—via the internet or other
communication networks.
IoT: A dynamic global network infrastructure with self-configuring capabilities based on standard and interoperable
communication protocols where physical and virtual "things" have identities, physical attributes, and virtual personalities
and use intelligent interfaces, and are seamlessly integrated into the information network, often communicate data
associated with users and their environments.
•The goal of IoT is to extend to internet connectivity from standard devices like computer, mobile, tablet to relatively
dumb devices like a toaster
Examples of IoT
• Smart Home: Thermostats (Nest), Smart Lights (Philips Hue), Smart Locks, Smart TVs.
🟢 Characteristics of IoT
1. Connectivity
• What it means: IoT devices must connect to other devices, networks, or the cloud to transmit and receive data.
• What it means: Devices must be able to adjust based on context, environment, or data received.
• Example 2: A surveillance camera switching between infrared and normal mode based on lighting.
3. Self-Configuring
• What it means: Devices should be plug-and-play—capable of configuring themselves upon first use and updating
settings automatically.
• Example: A smart speaker automatically downloading the latest firmware when connected.
4. Unique Identity
• What it means: Each IoT device must be uniquely identifiable (via IP address, MAC address, or other IDs).
• Sensors: Capture data from the environment (e.g., temperature, light, motion).
• Actuators: Perform actions based on sensor data (e.g., switch on fan, adjust valve).
6. Interoperability
• What it means: Devices from different manufacturers should be able to communicate using common protocols
and standards.
• Protocols used: MQTT, CoAP, HTTP, Zigbee, LoRaWAN, Bluetooth Low Energy (BLE), Wi-Fi.
• What it means: Devices can process and interpret data (edge computing or cloud processing) and use their
unique ID to associate data with location or user.
8. Scalability
• What it means: The IoT system should support a growing number of devices and handle increased data load.
• Example: Amazon’s warehouse uses thousands of robots and sensors to manage inventory.
• What it means: Devices are part of a broader ecosystem that includes cloud services, analytics platforms, and
apps.
• Example: Smartwatch data uploaded to health cloud and visualized in a mobile app.
• What it means: IoT includes diverse devices with different hardware, software, and network needs—forming a
heterogeneous but unified system.
• Example: In precision agriculture, soil sensors, water pumps, and weather stations work together but are made
by different vendors.
• What it means: Data privacy, secure communication, and authorized access must be enforced.
• What it means: Devices can function with minimal human intervention by analyzing data and making decisions.
• Example 1: Smart irrigation system starts watering based on soil moisture levels.
1. Things in IoT
In the context of (IoT), the term "Things" refers to smart devices or objects that are capable of collecting, processing,
and exchanging data. These "things" form the foundational layer of an IoT ecosystem and are embedded with sensors,
actuators, software, and network connectivity to interact intelligently with their environment or other systems.
The “Things” in IoT are intelligent, connected devices that enable interaction between the physical and digital worlds.
Through their capabilities to sense, process, and communicate, they transform raw data into meaningful actions. These
devices are central to building smarter systems across industries like healthcare, agriculture, manufacturing,
transportation, and home automation.
o Devices are equipped with sensors to detect physical parameters like temperature, humidity, light,
motion, pressure, etc.
o These sensors allow the devices to continuously monitor their environment and gather real-time data.
o Devices can communicate wirelessly (Wi-Fi, Bluetooth, Zigbee, LoRa, etc.) or via wired connections
(Ethernet, USB).
o They share data with other IoT devices, gateways, or cloud servers for storage and processing.
o Some devices have built-in processors to analyze and process data locally (edge computing).
o Others send data to cloud platforms where large-scale computation and machine learning algorithms
can be applied for deeper insights.
o Based on received or processed data, IoT devices can trigger actions through actuators (e.g., turn on a
fan when temperature is high, open a valve when soil is dry).
o I/O Interfaces for Sensors – connect and receive input from sensors.
o Internet Connectivity Interfaces – like Wi-Fi, Ethernet, cellular, or satellite, for cloud access.
o Memory and Storage Interfaces – onboard flash memory to store firmware, data logs.
• Each IoT "thing" has a unique identity (such as a MAC address or IP address) to ensure it can be individually
addressed and managed within the network.
• This enables remote sensing, monitoring, and control of devices over the internet.
Category Examples
Smart Home Smart thermostats, lights, refrigerators, security cameras, smart locks
Industrial IoT (IIoT) Machine sensors, vibration detectors, smart meters, control panels
Smart Agriculture Soil moisture sensors, automated irrigation systems, weather stations
A block diagram of an IoT device visually represents the internal architecture of a smart device and how different
components interact to enable sensing, processing, communication, and control.
• And interacts physically with the environment (via actuators or multimedia interfaces).
This structure allows IoT devices to operate autonomously, efficiently, and intelligently across diverse real-world
applications—from smart homes to industrial automation.
1. Connectivity Block
• USB Host: Allows connection to other USB devices like storage or peripherals.
• RJ45/Ethernet: Provides a wired internet connection, often used in industrial or high-speed setups.
2. Processor Block
• CPU (Central Processing Unit): The main brain of the device. It processes data from sensors, makes decisions,
and controls all operations.
3. Audio/Video Interfaces
• Purpose: Enables multimedia input/output for devices like smart TVs, video doorbells, or surveillance cams.
4. Memory Interfaces
• DDR1/DDR2/DDR3: Types of RAM used for temporary data storage during operations.
• Purpose: Interfaces to connect external sensors (temperature, motion) or actuators (motors, relays).
• SPI (Serial Peripheral Interface): Used for high-speed short-distance data communication.
• CAN (Controller Area Network): Used in automotive and industrial IoT systems for robust communication.
6. Storage Interfaces
• Purpose: For external storage expansion, especially when onboard memory is insufficient.
• SD, MMC, SDIO: Allow connecting external memory cards to store large amounts of data like images, logs, or
system files.
7. Graphics Block
• GPU (Graphics Processing Unit): Handles visual data, especially for devices needing image or video processing
(e.g., smart surveillance cameras).
IoT follows a layered architecture to manage communication and data transfer effectively.
This layer defines how data is physically sent over a medium (wired or wireless). It ensures data is transmitted properly
between connected devices.
2. WiFi (IEEE 802.11) – Wireless LAN (WLAN) standard for internet access.
4. LR-WPAN (IEEE 802.15.4) – Low-power wireless network for IoT applications (e.g., Zigbee, Thread).
2. Network Layer
Handles how data packets move from one network to another, ensuring they reach the correct destination. Uses IP
addresses for device identification.
3. 6LoWPAN – IPv6 protocol for low-power wireless networks (used in smart homes, industrial IoT).
3. Transport Layer
Ensures reliable or fast data transmission between devices. Manages error control, flow control, and congestion control.
o Used in live streaming, gaming, voice calls, IoT applications with real-time requirements.
4. Application Layer
Defines how applications interact with the network and allows devices to send/receive data.
3. WebSocket –
o Follows a publish-subscribe model (devices send and receive messages through a broker).
The Logical Design of IoT refers to the conceptual structure of an IoT system, describing how different components
interact without focusing on the physical hardware. It explains how IoT devices communicate, process data, and work
together.
An IoT system consists of different functional blocks that handle key tasks like sensing, communication, security, and
management.
• Sensors collect data from the environment (e.g., temperature, motion, humidity).
• Actuators perform actions based on instructions (e.g., turning on lights, adjusting thermostat).
• Example: A smart thermostat detects room temperature using a sensor and adjusts the AC using an actuator.
• Example: A smartwatch sends heart rate data to a mobile app using Bluetooth.
• Includes:
o Device Control: Allows remote control (e.g., turning on/off smart devices).
• Example: A smart home system automatically discovers and connects a new smart bulb.
• Example: A smart factory automatically updates firmware for all connected machines.
• Uses:
• Example: A smart home app shows live camera feeds and allows remote control of lights and appliances.
2. IoT Communication Models (How IoT Devices Communicate)
IoT devices communicate in different ways based on how data is sent, received, and processed.
• Client (IoT device) sends requests to the server and the server responds to the requests. When the server
receives a request, it decides how to respond, fetches the data, retrieves resource representations, prepares the
response, and then sends the response to the client
Example: A smart thermostat (client) requests the current weather from a server, and the server responds with the
temperature.
• How it works:
3. Subscribers receive data only for topics they are subscribed to.
• Publishers and subscribers don’t directly communicate, making this model efficient for large systems.
• Example: A smart weather station publishes temperature data, and multiple devices (subscribers) like a smart
AC and mobile app receive updates.
2.3 Push-Pull Model (Queue-Based System)
• Producers push data into queues, and consumers pull data from queues.
• Example: A smart city traffic system collects vehicle data from sensors and stores it in a queue. Traffic lights pull
the data when needed to optimize signal timing.
• Example: A video doorbell maintains an open connection with a smartphone app, allowing real-time video
streaming and interaction.
IoT systems use APIs (Application Programming Interfaces) to send and receive data over the internet.
The application program (or programming) interface, or API, is arguably what really ties together the connected “things”
of the “internet of things.” IoT APIs are the points of interaction between an IoT device and the internet and/or other
elements within the network.
REST (Representational State Transfer) is an architectural style for designing networked applications, especially web
services and APIs. It defines a set of constraints that simplify client-server interaction and allow systems to communicate
using standard HTTP protocols (like GET, POST, PUT, DELETE).
REST allows devices (like mobile apps, web browsers, or IoT devices) to request resources from servers and receive
responses, usually in JSON or XML format.
2. The server processes the request and sends a response back to the client.
POST Submit data to the server Upload heart rate data from a smartwatch
Data Formats: REST typically uses JSON or XML to format data in requests and responses.
Platform Agnostic: Since REST is based on HTTP, any device with internet access (mobile, computer, smart device)
can use REST APIs.
REST Architectural Constraints (Rules)
These are the six principles that REST must follow (some are optional). They ensure uniformity, scalability, and reliability
of APIs
1. Client-Server
• Definition: Separates the client (UI/logic) from the server (data storage & processing).
• IoT Example: A mobile app (client) displays smart light status, while the server stores device states.
2. Stateless
• Definition: Every request must contain all necessary data, as the server does not remember previous requests.
• IoT Example: Every time a smart door sends a request to unlock, it must authenticate itself fully, even if it
already did so earlier.
3. Cacheable
• Benefit: Reduces redundant data exchange, improving speed and reducing load.
• IoT Example: Weather updates fetched from a smart display can be cached for 10 minutes instead of requesting
every second.
4. Uniform Interface
This is the core principle of REST, ensuring consistency across the system.
• What it means: All communication must follow a standardized structure. The client should interact with
resources using URIs (Uniform Resource Identifiers).
• Resources are distinct from representations. For example, the temperature is a resource, while JSON or XML is
the representation.
• Each message should have enough information to tell the client or server what to do with the data.
• Self-descriptive Messages
• Definition: The server can send code (like JavaScript) to be executed by the client.
• Use Case: Adds flexibility, like allowing the client to run lightweight logic without updating the app.
• Definition: The client doesn’t directly interact with the server—it may interact through intermediary
components (layers) like proxies, gateways, or load balancers.
• IoT Example: A smart meter may send data to an edge server, which then forwards it to the cloud.
1. HTTP Client - A REST-aware client (like a browser or app) initiates the communication.
2. HTTP Packet
3. HTTP Server - The server receives the request, performs authorization, and invokes the correct RESTful Web
Service.
4. Resources
A smart home app sends a GET request to a smart lock’s REST API to check if the door is locked. The server responds
with “Locked” or “Unlocked.”
A smart home mobile app sends a GET request to the smart lock’s REST API:
Host: [Link]
"status": "Locked"
WebSockets allow devices to communicate in real-time by keeping a continuous connection open. Unlike REST (which
sends a request and waits for a response), WebSockets allow both client and server to send data anytime without
waiting.
• Bidirectional communication → Both client and server can send messages at any time.
• Low latency → Since the connection remains open, data is exchanged instantly without delay.
1. The client (e.g., a mobile app) sends a normal HTTP request to the server.
2. The request includes an Upgrade header, telling the server that it wants to establish a WebSocket connection.
3. Once the WebSocket handshake is completed, the connection switches from HTTP to WebSocket, using the
same TCP/IP connection.
4. Now, both client and server can send messages to each other anytime without needing repeated requests.
A stock trading app uses WebSockets to show live stock prices without needing to refresh the page.
Similarly, a real-time security camera streams live video to a smartphone using WebSockets.
Comparison table
Efficiency Less efficient for real-time updates Highly efficient for real-time data
Use Case Simple CRUD operations, APIs Live updates, gaming, chat apps, IoT data streams
Latenc y Higher due to repeated handshakes Low latency after connection established
Server Push Not supported directly Supported (server can send data anytime)
A high-level blueprint showing what the system A detailed plan showing how the system is built
Definition
should do and works
Textual, graphical, or both (like flowcharts or Mostly graphical (like block diagrams, circuit
Representation
diagrams) layouts)
Network topology, data flow diagrams, system Sensors, microcontrollers, network cables, and
Examples
behavior devices
Aspect Logical Design Physical Design
Technology Conceptual technologies, communication Actual devices, chips, ports, and network
Involved protocols mediums
Change Flexibility Easier to modify early in design process Harder to change, as it involves real components
The Internet of Things (IoT) is a network of interconnected devices that communicate and exchange data over the
Internet. Its functionality is supported by various enabling technologies that provide the necessary infrastructure, data
processing, communication, and intelligence. These include:
• Cloud Computing
• Embedded Systems
• Communication Protocols
• Security Protocols
• Mobile Internet
• Web Services
A Wireless Sensor Network is a system of distributed devices (nodes) equipped with sensors to monitor physical or
environmental conditions such as temperature, humidity, pressure, or motion.
• End Nodes: Equipped with various sensors and can also function as routers.
• Coordinator: Acts as the central node that collects data from all nodes and connects the WSN to the Internet
(acts as a gateway).
• Weather Monitoring System – Collects data like temperature and humidity for forecasting.
• Indoor Air Quality Monitoring System – Monitors gas concentrations and air purity levels.
• Health Monitoring Systems – Gathers data from body sensors for remote patient monitoring.
Features:
• Low Cost
• Self-organizing and robust – can reconfigure if nodes fail or new ones are added.
2 Cloud Computing
Cloud Computing is a model for delivering IT services (compute, storage, network, applications) over the Internet, on-
demand, and on a pay-as-you-go basis.
• Users can access software, storage, and processing power from anywhere without owning or maintaining
physical infrastructure.
o Example: Web hosting, Virtual Machines (AWS EC2, Microsoft Azure VM).
Role in IoT:
• Acts as the backend for storing, processing, and analyzing massive IoT data.
• Facilitates remote access, real-time processing, and scalability.
Big Data Analytics involves processing and analyzing massive volumes of data generated by IoT and other sources to
extract meaningful insights.
• Volume: Though there is no fixed threshold for the volume of data to be considered as big data, typically, the
term big data is used for massive-scale data that is difficult to store, manage, and process using traditional
databases and data processing architectures.
• Velocity: Velocity refers to how fast the data is generated and how frequently it varies.
• Variety: Variety refers to the forms of the data. Big data comes in different forms such as structured or
unstructured data, including text data, image, audio, video, and sensor data.
1. Data Collection
3. Data Processing
4. Data Visualization
• Retail Inventory Monitoring: Stock levels, customer behavior (e.g., BigBasket, Amazon).
Sources of Big Data: Social media, IoT devices, transaction records, surveillance systems.
An Embedded System is a specialized computing system designed to perform a specific function within a larger
mechanical or electrical system.
Unlike general-purpose computers that handle multiple applications, embedded systems are optimized for particular
tasks—offering efficiency, reliability, and real-time operation.
These systems play a crucial role in modern technological advancements, especially in IoT (Internet of Things), where
they act as the “brains” behind connected devices.
• Microprocessor or Microcontroller: The central computing unit that handles processing tasks.
• Memory (RAM, ROM, Cache): Provides storage for system operations and data retrieval.
• I/O Devices: Sensors, displays, keypads, and other components that allow interaction with the environment.
• Networking Modules: WiFi adapters, Ethernet controllers—essential for communication in IoT devices.
• Specialized Processors: Some embedded systems incorporate Digital Signal Processors (DSPs) or Graphics
Processors for specific computational tasks.
• Embedded Operating Systems: Many embedded systems run on Real-Time Operating Systems (RTOS), ensuring
predictable and timely task execution.
Embedded systems are everywhere—from everyday household items to high-tech industrial machinery:
• Point-of-Sale (POS) Terminals – Used in retail transactions with integrated payment processing.
• Surveillance Cameras – Capture, process, and store video footage with real-time monitoring capabilities.
• Medical Devices – Patient monitoring systems, pacemakers, and diagnostic equipment rely on embedded
computing.
Embedded systems serve as the core intelligence in IoT ecosystems, enabling smart functionality in devices:
• Control sensing and data collection: Devices equipped with sensors gather environmental data (temperature,
motion, humidity).
• Communication with networks: Embedded systems relay information to cloud servers, enabling real-time
decision-making.
• Automation and efficiency: Whether it’s smart home appliances or industrial monitoring tools, embedded
systems automate processes for improved efficiency and convenience.
5. Communication Protocols
Communication protocols define how data is formatted, transmitted, and received across networks in IoT systems.
Communication protocols in the Internet of Things (IoT) are vital for ensuring devices communicate efficiently, both
among themselves and with the cloud.
These protocols help transfer data, provide network connectivity, and manage communication between devices in IoT
networks.
They can be categorized based on the layer of the network stack in which they function.
Functions of Protocols:
Layer-wise Protocols:
o Low-power wireless network standard used for IoT applications like Zigbee and Thread.
o Optimized for devices with low power and limited data rates.
o 3G: Supports multimedia services like video calls and mobile internet.
2. Network Layer
o Widely used in current networking but becoming limited due to the growing number of IoT devices.
3. Transport Layer
o Provides reliable communication by ensuring packets are delivered in order, with error checking and
retransmissions.
o Used for applications requiring high reliability (e.g., web browsing, file transfers).
o Faster but without guaranteed delivery, making it suitable for time-sensitive applications.
o Common in live streaming, gaming, and IoT devices that require low-latency transmission (e.g., real-time
monitoring systems).
4. Application Layer
1. A request-response protocol used for web-based communication between IoT devices and applications.
2. Devices send messages to a broker, and other devices subscribe to receive updates.
3. Example: A smart home system where motion sensors publish data, and security systems subscribe to it.
1. A lightweight protocol designed for IoT devices with constrained resources (low power, small memory).
2. Works similarly to HTTP but is optimized for low-bandwidth and high-latency environments.
4. WebSocket:
1. Middleware protocol for machine-to-machine communication, often used in autonomous vehicles and
robotics.
These protocols are specifically designed for short-range communication between devices, often without internet
connectivity.
o Bluetooth is used for short-range communication, and BLE is a low-energy version ideal for IoT devices.
• Zigbee:
• Z-Wave:
o A protocol similar to Zigbee but mainly used in smart home applications like smart locks and lights.
o Used for long-range, low-power communication in IoT applications such as agriculture and asset
tracking.
o Cons: Low data rates, not suitable for high-speed data transmission.
An IoT system can consist of multiple components that work together to provide seamless services to the user. The
components typically include:
• Device: A physical object that performs sensing and/or actuation tasks. Examples include sensors, cameras, or
any IoT-enabled hardware.
• Resource: Software components on the IoT device that allow it to process and store sensor information or
control actuators. Resources include networking capabilities and local processing.
• Controller Service: The native service running on the device that communicates with web services. It sends data
from the device to the web service and receives control commands from the web services to actuate the device.
• Database: The data storage system where information from the IoT devices is stored. The database can be local
(on the device) or cloud-based, depending on the system architecture.
• Web Service: A link between the device, application, database, and analysis component. It can either use
HTTP/REST principles or WebSocket protocol to communicate and serve data.
• Analysis Component: This component is responsible for analyzing the IoT data and transforming it into
meaningful results that can be interpreted by the user or other systems.
• Application: An interface that allows users to control and monitor the IoT system. It displays processed data and
provides an interface to interact with the system.
These components work together to form the backbone of an IoT system, and the complexity of an IoT deployment can
vary across different levels.
The following are the levels of IoT systems and how they differ in terms of their architecture and complexity.
• Local Database: Sensor data can be stored locally for immediate decisions.
• Cloud Storage: Data such as moisture levels and irrigation schedules are stored in the cloud.
• Cloud-Based Application: The user can control the system remotely through a cloud-based app.
Level-2 systems are useful in scenarios where the data is large but the computational power required to process it locally
is not demanding. Data is offloaded to the cloud for long-term storage, but local analysis provides quicker feedback.
• Cloud-Based Storage & Analysis: All data is sent to the cloud, where complex analytics are performed to track
package movement, estimate delivery times, and detect anomalies.
• Cloud Application: Provides users with real-time tracking and status updates.
Level-3 systems are ideal for applications where massive amounts of data are generated (e.g., package tracking) and
require heavy computational analysis that cannot be done locally.
• Cloud Storage & Data Processing: Data is sent to the cloud for further analysis, aggregation, and visualization.
• Cloud-Based Application: Users can monitor noise levels from a centralized application.
Level-4 systems are useful for scenarios involving distributed sensing where local processing is still required, but data
aggregation, visualization, and advanced analytics are performed in the cloud.
• At Level-5, the IoT system is based on wireless sensor networks that consist of multiple end nodes and a
coordinator node.
• The end nodes perform sensing and/or actuation, while the coordinator node collects data from the end nodes
and sends it to the cloud for storage and analysis.
• The application is cloud-based, and the system is computationally intensive with large data.
• End Nodes: Multiple sensors placed in different locations (e.g., temperature, humidity, pollution sensors).
• Coordinator Node: Collects data from all the end nodes and sends it to the cloud for processing.
• Cloud Storage & Data Processing: The data is stored and analyzed in the cloud.
Level-5 systems are used in large-scale networks where multiple sensors are deployed over a wide area, and a central
coordinator manages data flow to the cloud.
IoT Level-6 (Fully Integrated Multi-Node System with Cloud and Centralized Control)
• Centralized Controller: Coordinates the activity of all sensors and sends commands when needed.
• Cloud Storage & Data Processing: All data is sent to the cloud for aggregation and processing.
• Cloud Application: Users can interact with the system to control traffic signals, monitor weather conditions, and
analyze data trends.
Level-6 systems are suited for complex and large-scale environments, where seamless communication between
numerous devices and centralized control is necessary for system efficiency.
Deployment Templates
o types of data
o analysis needs
o system complexity.
• The deployment model can be cloud-based, edge-based, or hybrid, depending on the requirements of the
system.
• The level of IoT is determined by how much of the processing and analysis occurs locally versus in the cloud.
UNIT - 2
Python provides various built-in libraries to handle data formats, networking, email, and hardware interfacing.
• Common Usage: JSON is commonly used for serializing and transmitting structured data over a network
connection, such as between:
• Core Structures:
• Python Integration: JSON integrates seamlessly with Python dictionaries and lists, making it a natural choice for
data manipulation in Python.
• Advantages:
import json
print(json_string)
print(data_dict["name"])
• Web servicesa
• Configuration files
The Python minidom library provides a minimal implementation of the Document Object Model (DOM) interface and
has an API similar to that in other languages.
Purpose: httplib is a module in Python for handling HTTP requests. It allows communication between a client and a
server over HTTP, supporting both client-side (sending requests) and server-side (handling responses) operations.
Key Features:
• Used in low-level HTTP operations, where you need more control over the request.
Purpose: urllib is a higher-level module compared to httplib. It provides functions for working with URLs, handling URL
parsing, and performing HTTP requests in a simpler and more abstract way.
Key Features:
• URL fetching: Supports GET, POST, and other methods for requesting data over HTTP.
• Provides functions like [Link] to open and fetch URLs and [Link] for URL parsing
The smtplib module is a built-in Python library used to send email messages via the Simple Mail Transfer Protocol
(SMTP). It allows a Python program to connect to an SMTP server, authenticate (if needed), and send an email message.
Example
import smtplib
[Link]()
[Link]("youremail@[Link]", "yourapppassword")
sender = "youremail@[Link]"
recipient = "recipient@[Link]"
[Link]()
• Used for controlling Raspberry Pi's GPIO (General Purpose Input/Output) pins.
[Link] is a Python library used to control the GPIO pins of a Raspberry Pi. These pins allow the Pi to interact with
external hardware like LEDs, buttons, motors, and sensors.
Basic Concepts
• GPIO Pins – Small physical pins on the Raspberry Pi used for input (reading data) and output (sending signals).
• Modes
IoT physical devices and endpoints are the "things" in IoT that sense, collect, and transmit data. Key components
include:
Endpoints are edge devices that interact with the real world and send data to cloud systems, e.g., smart thermostats,
fitness trackers, smart locks.
They form the edge layer of IoT, bridging the physical and digital worlds.
• Sensors (e.g., DHT11, PIR) collect data and connect via GPIO.
Raspberry Pi is a low-cost mini-computer, roughly the size of a credit card. Runs various Linux distributions, allowing it to
perform nearly all tasks of a typical desktop computer. Features general-purpose I/O pins, enabling the interfacing of
sensors and actuators. Since Raspberry Pi runs Linux, it comes with Python support right out of the box.
• Small and Affordable: Raspberry Pi is a mini-computer about the size of a credit card, making it cheap and easy
to use for various projects.
• Runs Linux: It supports various Linux-based operating systems, allowing it to perform tasks like a regular desktop
computer.
• GPIO Pins: Raspberry Pi has General Purpose Input/Output (GPIO) pins that let it connect with physical devices
like sensors, motors, and lights.
• Python Programming: Python is the main programming language used to interact with Raspberry Pi. It’s
beginner-friendly and perfect for controlling devices through GPIO pins.
• Ideal for IoT: Raspberry Pi is widely used in Internet of Things (IoT) projects to connect physical devices to the
internet.
• Flexible Uses: It can be used for a variety of projects, including home automation, robotics, weather stations,
and educational tools for learning programming.
• Connectivity: Raspberry Pi can connect to the internet, allowing it to send data to the cloud, interact with
remote devices, or control devices remotely.
• Learning Tool: It is often used by students, hobbyists, and makers to learn programming, electronics, and how
devices interact with each other.
• Affordable & Versatile: Raspberry Pi offers a powerful yet low-cost solution for both beginners and advanced
users to build interactive projects.
Architecture of Raspberry Pi
The architecture of the Raspberry Pi is based on a single-board computer design, meaning that all components are
integrated onto one board. Here's an overview of its key components:
1. CPU (Central Processing Unit):
• Raspberry Pi models use ARM-based processors (e.g., ARM Cortex-A72 in the Raspberry Pi 4).
• These processors are efficient and power-friendly, making the Raspberry Pi ideal for embedded and IoT
applications.
• Raspberry Pi uses a Broadcom VideoCore GPU, which supports OpenGL and hardware-accelerated video
decoding.
1. The memory used for temporarily storing data that the CPU needs for running programs.
2. Different Raspberry Pi models come with varying amounts of RAM (e.g., 2GB, 4GB, or 8GB in the Raspberry Pi 4).
4. Storage:
1. Raspberry Pi typically uses a microSD card as its primary storage device to run the operating system and store
files.
2. The newer Raspberry Pi models may support booting from USB drives or network storage for faster data access.
• A set of pins (26 to 40 pins depending on the model) that allows you to connect and control external devices like
sensors, motors, lights, etc.
• These pins can be configured as input or output for reading sensors or sending signals to devices.
6. USB Ports:
• Raspberry Pi has multiple USB ports (typically 4) to connect devices like a keyboard, mouse, USB storage, etc.
• USB 3.0 ports are available on the Raspberry Pi 4 for faster data transfer.
7. Network Interface:
• Ethernet Port: Used for wired internet connectivity (Raspberry Pi 4 and later).
• Wi-Fi: Built-in wireless networking on newer models like the Raspberry Pi 3 and 4.
8. HDMI Output:
9. Audio Output: An audio jack or HDMI can be used to output sound, useful for multimedia projects.
10. Power Supply: Raspberry Pi is powered by a 5V USB power supply. The power requirements vary depending on the
model (e.g., Raspberry Pi 4 needs 5V 3A).
11. Camera Interface (CSI): Allows you to connect a camera module to the Raspberry Pi, useful for projects that involve
image processing or computer vision.
12. Display Interface (DSI): Used to connect a touchscreen display directly to the Raspberry Pi.
13. Onboard LED Indicators: Raspberry Pi models usually have a set of LEDs to indicate the power status, activity (SD
card read/write), and network activity.
• Runs Linux OS: Raspberry Pi runs a full Linux operating system (like Raspbian).
• Can run any standard Python program that works on a normal computer.
• GPIO (General Purpose Input/Output) pins make it ideal for hardware interfacing.
• Interfaces available:
o Serial (UART)
o Temperature sensors
o Motion detectors
o Relays
o Motors
o Displays, etc.
• Perfect for IoT projects due to its flexibility, GPIO access, and Python support.
1. Power Pins:
2. GND (Ground Pins): 8 pins used to complete the circuit (negative side).
o Can read input (e.g., button press) or give output (e.g., turn on LED).
4. I2C Pins:
5. UART Pins:
6. SPI Pins:
7. ID EEPROM Pins:
The Raspberry Pi board supports multiple communication interfaces to enable interaction with external hardware
devices such as sensors, actuators, displays, and other microcontrollers. These interfaces include:
Each interface is designed for different types of data communication based on speed, number of devices, and wiring
complexity.
The UART (Universal Asynchronous Receiver/Transmitter) interface enables asynchronous serial communication
between the Raspberry Pi and other serial devices. This means that data transmission does not require a clock signal.
Instead, both devices agree on a common baud rate (speed of communication).
• Rx (Receive): Receives data from the device into the Raspberry Pi.
These pins are part of the GPIO header and are available by default on most Raspberry Pi models.
Key Features:
• Requires a matching baud rate on both communicating devices (e.g., 9600, 115200).
• Efficient for communication with modules like GPS, GSM, and microcontrollers.
• Microcontroller communication
Python Library for UART: pyserial: Used for handling serial communication through code.
SPI is a synchronous serial communication protocol used for high-speed data exchange between a master device
(Raspberry Pi) and one or more slave devices. The communication is synchronized using a clock line generated by the
master.
SPI communication typically uses four lines:
1. MOSI (Master Out Slave In) – Transfers data from the master to the slave.
2. MISO (Master In Slave Out) – Transfers data from the slave to the master.
This means you can connect up to two SPI slave devices directly, or use a multiplexer for more.
Key Features:
• WIRE BASED
• SD card interfaces
• OLED displays
Python Library for SPI: spidev: A Python module that provides an interface to the Linux SPI driver.
7.5.3 I2C (Inter-Integrated Circuit)
I2C is a synchronous, multi-master, multi-slave communication protocol. It uses only two wires to connect all devices,
reducing wiring complexity. The Raspberry Pi acts as a master, and all connected devices act as slaves identified by
unique addresses.
• SDA (Serial Data Line): Transfers data between master and slave.
Each I2C slave has a 7-bit or 10-bit address used to identify it on the bus.
Key Features:
• OLED/LCD displays
Python Library for I2C: smbus: A module to use the I2C interface via Python.
In this section, we explore how to control an LED using a Raspberry Pi and Python programming language. We will cover
the setup, the code, and explain how the hardware components work together.
Components Involved:
1. Raspberry Pi: The microcontroller board that provides the GPIO pins for controlling hardware.
2. LED: A light-emitting diode that can be turned on or off using GPIO pins.
3. Resistor: A current-limiting component that is typically used to prevent excessive current from flowing through
the LED.
4. Wires: For connecting the components to the GPIO pins of the Raspberry Pi.
Circuit Diagram:
The diagram shows the connection of an LED to a
Raspberry Pi, where:
The Python program below demonstrates how to toggle the LED on and off with a specific delay using the [Link]
library.
o Connect the anode (longer leg) of the LED to the chosen GPIO pin (e.g., pin 7).
o Connect the cathode (shorter leg) of the LED to ground through a resistor.
2. Open Python IDLE: Open the Python IDE on Raspberry Pi and create a new Python file.
3. Write and Save the Code: Copy the code into the editor and save it as [Link].
4. Run the Program: Run the program to see the LED blink on and off as per the specified timings.
program that runs the LED blinking indefinitely, alternating between on and off states with different time intervals.
This topic demonstrates how to connect an LED and a push-button switch to a Raspberry Pi using GPIO pins, and control
the LED based on the switch's input using Python programming.
Hardware Components
• Raspberry Pi board
• 1 LED
• 1 Push-button switch
Concept Overview
• GPIO pins on Raspberry Pi are programmable for either input (read values like button press) or output (control
devices like LEDs).
Pin Configuration
• LED connected to GPIO 18
• Internal pull-up resistor is used with the button to keep default state HIGH and detect press as LOW.
1. Logic:
CODE:
Explanation
• When the button on pin 25 is pressed, the LED on pin 18 toggles state (ON/OFF).
Code:
✅ Interfacing a Light Sensor (LDR) with Raspberry Pi
The Raspberry Pi does not have built-in analog input pins like microcontrollers such as Arduino.
All 17 GPIO pins on the Pi are digital, meaning they can only detect high or low signals (0 or 1).
However, some sensors, like Light Dependent Resistors (LDRs) or thermistors, work as variable resistors and need
analog input.
To measure varying levels (like light intensity), we can use a simple trick involving a capacitor and a GPIO pin.
Working Principle:
We use this changing resistance to charge a capacitor, and the time it takes to charge is proportional to the resistance,
which in turn depends on the light level.
1. Connect pin 1 (3.3V) of the Raspberry Pi to the positive rail on the breadboard.
6. Connect the other leg of the capacitor to the negative rail (Ground),
ensuring the negative pin of the capacitor goes to ground.
Sequence of Operation:
1. Discharge the Capacitor: Set the GPIO pin (connected to LDR) as output and LOW to discharge the capacitor
completely.
2. Start Measuring:
o The time taken for the voltage to reach ~1.4V–2V (logic HIGH) is inversely proportional to the light
intensity.
4. LED Control:
o If the LDR reading (i.e., time taken) is less than a threshold, it means the environment is bright, so turn
on the LED.
5. Repeat: Set the GPIO back to output mode to discharge and repeat the cycle.
UNIT - 3
.Machine-to-Machine (M2M)
M2M (Machine-to-Machine) is a way for machines (devices) to communicate without human involvement. It allows
devices to exchange data automatically for remote monitoring and control.
M2M can use wired (Ethernet, fiber) or wireless (Wi-Fi, Bluetooth, ZigBee) connections.
• A group of connected machines (M2M nodes) that collect and share data.
• Each machine has built-in sensors (to collect data) and actuators (to take action).
• Communication happens using local network protocols like ZigBee, Bluetooth, M-Bus, Wireless M-Bus.
Example: A smart home where sensors track temperature and send data to an AC unit, which adjusts cooling
automatically.
2. Communication Network
• Can use wired (fiber, Ethernet) or wireless (Wi-Fi, cellular, satellite) networks.
• Helps transfer data from machines to servers for processing and storage.
Example: A smart electricity meter sends energy usage data to the utility company via a cellular network.
3. Application Domain
• The brain of the system where M2M data is processed and used for decision-making.
• Contains software and business logic for automation, monitoring, and analysis.
Example: In smart farming, sensors monitor soil moisture and send data to an application that decides when to
water crops.
4. M2M Gateway
• Acts as a middleman between the M2M area network and communication network.
• Converts local network protocols (ZigBee, Bluetooth) into IP-based communication for the internet.
• Helps multiple M2M devices appear as a single virtual system for easy communication.
Example: In smart factories, a gateway connects multiple sensors and machines, sending data to a central cloud
server for real-time monitoring.
Both M2M (Machine-to-Machine) and IoT (Internet of Things) involve devices communicating with each other, but
they differ in technology, architecture, and applications.
1. Communication Protocols
M2M Communication
• Works in local networks using short-range protocols like ZigBee, Bluetooth, ModBus, M-Bus, Wireless M-Bus.
Example: A smart meter that communicates with a nearby electricity grid using ZigBee.
IoT Communication
• Common IoT protocols: HTTP, MQTT, CoAP, WebSocket, XMPP, DDS, AMQP.
Example: A smart home assistant (Alexa, Google Home) connects to the internet using Wi-Fi and HTTP to fetch
weather updates.
2. Machines
• Machines in M2M networks are similar in type and work in closed systems.
• They are designed for specific tasks and do not communicate with different types of devices.
Example: A factory automation system, where all machines are of the same type and communicate only with
each other.
• "Things" in IoT include a wide variety of devices with unique IDs (phones, smartwatches, cars, sensors).
• IoT devices can communicate with different types of devices and external systems.
Example: A smart home, where your thermostat, security camera, and lights all communicate with each other
and with cloud-based apps.
• M2M systems rely on physical hardware (machines with sensors and embedded modules).
Example: An ATM machine that sends alerts to a bank when cash is low.
Example: A fitness tracker that analyzes heart rate data and provides health recommendations via a mobile app.
Example: A medical device in a hospital stores patient data only on hospital servers.
Example: A smart security camera stores video footage in the cloud, which can be accessed remotely via an app.
5. Applications
Example: A CNC machine in a factory sends maintenance alerts only to the factory’s internal system.
• IoT data is analyzed in the cloud and can be used for advanced analytics, automation, and AI.
Example: A smart thermostat adjusts room temperature based on weather forecasts from the cloud.
Software-Defined Networking (SDN) and Network Function Virtualization (NFV) are modern networking technologies
that improve flexibility, scalability, and efficiency in managing networks, especially for IoT (Internet of Things).
What is SDN?
SDN is a new way of designing networks where the control plane (decision-making) is separated from the data plane
(actual data transmission). This allows a centralized controller to manage the entire network, making it more flexible
and easy to configure.
Traditional Networks:
SDN Networks:
• Use simple packet-forwarding hardware instead of expensive, specialized devices.
Example:
Imagine a traffic management system:
• Traditional networks: Each traffic light has built-in intelligence to control signals independently.
• SDN: A centralized controller manages all signals, optimizing traffic flow based on real-time conditions.
• Network administrators must manually configure devices from different vendors, making management difficult.
3⃣ Limited Scalability
Example: In a smart city, an SDN controller can redirect network traffic dynamically to ensure stable connections for
IoT devices like security cameras and smart meters.
Example: A cloud-based IoT platform can automatically adjust network settings to ensure smooth communication
between smart devices.
Example: If an IoT device needs more bandwidth, the SDN controller dynamically adjusts network resources in real-
time.
(B) NFV – Network Function Virtualization
What is NFV?
NFV replaces traditional network hardware (firewalls, routers, load balancers) with software-based virtual network
functions (VNFs) running on standard servers.
Example: Instead of installing physical firewalls in every office, companies can use virtual firewalls running in the
cloud.
SDN controls traffic flow, while NFV provides the infrastructure for running virtualized network functions.
Example:
• NFV ensures that network services (firewalls, VPNs) are available on demand.
Example: Instead of installing a physical router, an IoT system can use a virtual router that runs in the cloud.
Example: Data centers provide NFVI to run multiple virtualized IoT applications without needing physical hardware.
Example: A cloud service provider uses NFV orchestration to deploy a firewall automatically whenever an IoT device
connects to the network.
Why SDN and NFV Are Important for IoT?
1⃣ Scalability SDN and NFV allow IoT networks to scale dynamically without needing new hardware.
3⃣ Cost Savings
• NFV provides virtualized security functions (firewalls, VPNs) to protect IoT devices.
The Internet of Things (IoT) integrates diverse components like sensors, actuators, software, and network
infrastructure, all working together across potentially thousands of devices. Managing such a complex ecosystem
demands efficient and scalable system management. Below are the key reasons why IoT systems management is
essential:
1. Automating Configuration
o Detecting faults
o Identifying inefficiencies
o Optimizing performance
3. Improved Reliability
4. System-Wide Configuration
SNMP
What is SNMP?
SNMP Components
2. Managed Device
• These devices contain important data that SNMP can read or update.
• It defines what data can be managed using SNMP (e.g., battery level,
device ID).
4. SNMP Agent
Limitations of SNMP
1. Stateless Protocol
3. Configuration is Hard
• SNMP doesn’t clearly separate state data (e.g., current temperature) and configuration data (e.g., threshold
limit).
• SNMPv1 and SNMPv2 have very little security (no encryption or strong authentication).
NETCONF is a session-based network management protocol. It is designed to retrieve configuration and state data from
network devices, and to allow the manipulation (editing) of that configuration data.
Core Characteristics
• Content Layer: NETCONF separates configuration data from state data. These are XML-encoded and defined
using YANG, a data modeling language.
• Operations:
• Transport Protocols: Operates over secure transports like SSH, TLS, or Console.
• Client-Server Model:
Communication Process
3. The client can then send multiple RPC (Remote Procedure Call) requests for operations like:
▪ Retrieving configurations
Advantages of NETCONF
6. Security & Integrity: Leverages secure transport (SSH/TLS) for authentication, data integrity, and confidentiality.
7. Overcomes SNMP limitations: Unlike SNMP (which mainly focuses on monitoring), NETCONF supports both
monitoring and full configuration management.
NETCONF Architecture
▪ <get-config>
▪ <edit-config>
▪ <get>, etc.
Each layer communicates with the layer above and below to complete configuration tasks.
✅ 4.5 YANG
YANG (Yet Another Next Generation) is a data modeling language used to define the structure of configuration and
state data manipulated by the NETCONF protocol.
1. Purpose: Models:
o Configuration data
o Notifications
2. Encoding: YANG is human-readable and gets translated to XML/JSON for communication over NETCONF.
3. Modules:
o Each YANG module contains:
▪ RPC definitions
▪ Notifications
o A module describes what data is exchanged between the NETCONF client and server.
4. Structure:
o Composed of:
5. Reusability:
6. Constraints:
7. ‘config’ Statement: Indicates whether the data node represents configuration (true) or state (false) data.
Leaf Nodes Hold simple values (e.g., string, int). Each leaf has only one value and no children.
Leaf-List
Represents a list of leaf values. Each item is of the same type and there are no child nodes.
Nodes
Container Logical grouping. Holds only child nodes, no direct value. Can contain leafs, lists, other containers, leaf-
Nodes lists.
Represents repeating entries (like arrays/records). Each entry is like a structure, identified by keys
List Nodes
(leafs). May include nested children.
Operation Description
Scalability Supports large IoT networks Reusable models for all devices
• YANG: A language used to describe the structure of configuration and state data (like a blueprint or model).
Together, NETCONF-YANG allows us to configure IoT devices, get their status, and manage them remotely in a structured
and reliable way.
Imagine you are managing thousands of smart devices (IoT devices). You need a safe, organized, and automated way to
change settings and check device status.
1. Management System
2. Management API
• You can read/write data, check device status, and perform actions automatically, just like a human operator
would.
3. Transaction Manager
Consistency Keeps the system in a valid state before and after the change.
4. Rollback Manager
• If something goes wrong, it undoes the changes and brings the system back to its original state.
• Knows which part of the model is managed by which part of the system.
6. Configuration Validator
7. Configuration Database
• Stores both:
8. Configuration API
• Create a YANG Model - Define what configuration and status data your device will have.
• Enhance the Model - Use a tool like inctool with Libnetconf to complete the YANG model.
• Write Management Code - Fill in the device logic in a module (TransAPI) that interacts with the model.
• Generate the Code Library - Compile callback functions to interact with device functions.
• Load Modules into Server - Load your YANG model and code into the Netopeer server.
• Connect Management System to Device - Use Netopeer CLI to connect to the device.
📘 Netopeer
Netopeer is an open-source toolset built on top of the Libnetconf library. It is used for managing IoT devices or network
devices using the NETCONF protocol and YANG models.
NETCONF is a network management protocol, and YANG is the data modeling language it uses.
Netopeer facilitates communication, configuration, and management of devices by offering a complete ecosystem of
tools and components.
1. Netopeer-server
2. Netopeer-agent
3. Netopeer-cli
4. Netopeer-manager
5. Netopeer-configurator
6. SSH Client
7. YANG Modules
o Describe what settings a device can accept and what data it can report.
8. TransAPI Modules
o These are callback code modules that map configuration data to actual device-level operations.
o Compiled into .so shared object files and loaded into the server.
IoT Device
• The Netopeer-server receives the command, processes it using data models (YANG + TransAPI), and applies it to
the actual device.
• The Netopeer-manager and configurator are used to manage modules and initial setup respectively.
▪ Notifications
o These callbacks are functions that are triggered when configuration changes happen.
o Start a secure session from the operator's machine to the IoT device.
Benefits
• Secure (SSH/TLS)
• Automation-ready
Unit-4
☁️ Cloud Computing
Definition
Cloud computing is a modern computing model that allows users to access computing resources—such as storage,
servers, software, and applications—via the Internet. Instead of relying only on local computers, users can store data
online and access it anytime, from any device.
• On-Demand Self-Service
o Users can automatically access resources (like storage or processing power) whenever needed—no
human intervention required.
• Broad Network Access
o Services are accessible via standard devices like laptops, smartphones, or tablets through the internet.
• Resource Pooling
o Cloud providers use shared resources (like servers) across multiple users efficiently using a multitenant
model.
o Resources can quickly scale up or down to match user demand (e.g., more storage during peak times).
• Measured Service
o Usage is tracked and billed based on how much is consumed (similar to mobile data or electricity usage).
Cloud computing architecture refers to the components and subcomponents required for cloud computing. These
components include front-end platforms, back-end platforms, cloud-based delivery, and a network (usually the
Internet).
1. Front-End (Client Side) :Represents the user interface and devices used to interact with cloud services.
• Includes:
• Manages and secures resources, handles data, traffic control, and deployment models.
Components of Back-End:
• Storage Systems: Secure and scalable data storage (e.g., databases, file systems).
• Databases: Structured data storage (SQL, NoSQL). E.g., Amazon RDS, Azure SQL.
• Ensures data transfer, communication, and connectivity between users and cloud services.
• IaaS (Infrastructure as a Service) – Offers virtualized computing resources (e.g., AWS EC2).
• PaaS (Platform as a Service) – Provides a platform to develop, run, and manage apps (e.g., Google App Engine).
• SaaS (Software as a Service) – Delivers software over the internet (e.g., Gmail, Microsoft 365).
• Public Cloud – Shared infrastructure available to multiple users over the internet.
• Hybrid Cloud – Combination of public and private clouds for better flexibility.
Key Characteristics
Challenges
• Virtualized Resources: Users can deploy and manage virtual machines, storage, and networking resources via a
cloud platform.
• Pay-as-You-Go Model: Users pay only for the resources they consume.
• Accessibility: IaaS resources are available from anywhere with an internet connection.
• Managed Infrastructure: The cloud provider handles hardware maintenance, updates, and physical security.
Benefits of IaaS:
• Cost Efficiency: Eliminates the need for upfront capital investment in hardware.
• Rapid Deployment: Infrastructure can be provisioned in minutes, accelerating development and deployment
cycles.
• Disaster Recovery: Ensures data redundancy and recovery through the cloud provider’s infrastructure.
Use Cases:
• Website Hosting
PaaS is a cloud computing model that provides a platform and environment for developers to build, deploy, and manage
applications without worrying about the underlying infrastructure.
-> PaaS abstracts the complexities of setting up servers, networks, and storage, allowing developers to focus solely on
application development and deployment.
1. Development Framework: Offers pre-built frameworks and tools to simplify application development.
3. Integration Tools: Supports integration with databases, APIs, and other services.
4. Multi-Environment Support: Allows development, testing, staging, and production environments within the
platform.
Benefits of PaaS:
1. Increased Productivity: Developers can focus on writing code without worrying about hardware setup or
maintenance.
2. Cost-Effective: Reduces the cost and complexity of managing hardware and software licenses.
3. Rapid Development: Speeds up the application development lifecycle with built-in tools and templates.
Use Cases:
• Application Development
• Business Analytics
• IoT Applications
Examples of PaaS Providers:
SaaS is a cloud computing model where software applications are delivered over the internet on a subscription basis.
Users access these applications through a web browser or client interface without needing to install, maintain, or
manage the underlying infrastructure, platforms, or software.
• Web-Based Access: Applications are accessible through web browsers, eliminating the need for downloads or
installations.
• Subscription Model: Users typically pay on a monthly or yearly basis, often based on usage or the number of
users.
• Automatic Updates: Providers handle software updates, security patches, and maintenance.
• Multi-Tenancy: A single instance of the application serves multiple users while maintaining data security and
privacy.
Benefits of SaaS:
• Cost-Effective: Reduces costs associated with purchasing, maintaining, and upgrading software and hardware.
• Ease of Use: No setup or maintenance required; users can start using the software immediately.
• Accessibility: Available from any device with an internet connection, enabling remote work and collaboration.
• Regular Updates: Ensures users always have access to the latest features and security improvements.
• Integration: Often integrates with other SaaS or on-premises systems, enhancing productivity.
Use Cases:
1. Business Applications
4. Industry-Specific Solutions
Cloud deployment models describe the ways cloud services are deployed, depending on the ownership, accessibility,
and storage management. They define how infrastructure and services are made available to users. The primary cloud
deployment models are:
1. Public Cloud
Description: Cloud resources are owned and operated by a third-party cloud service provider and delivered over the
internet. Services are shared among multiple organizations.
Characteristics:
Advantages:
• Easy scalability
• Broad accessibility
Disadvantages:
Description: Cloud infrastructure is dedicated to a single organization and can be hosted on-premises or by a third-party
provider. It offers enhanced control and security.
Characteristics:
Advantages:
Disadvantages:
3. Hybrid Cloud
Description: Combines both public and private cloud infrastructures, allowing data and applications to move between
them for flexibility and optimization.
Characteristics:
Advantages:
Disadvantages:
4. Community Cloud
Description: Shared by multiple organizations with similar needs, such as compliance or security requirements.
Resources are dedicated to this specific group of users.
Characteristics:
Advantages:
Disadvantages:
INTRODUCTION
Virtualization is a core technology that enables the creation of virtual versions of computing resources—such as
hardware, storage, network, memory, and even entire operating systems—abstracting them from the underlying physical
infrastructure. This process allows a single physical system to host multiple independent virtual environments, each
functioning as if it were a separate physical system.
• Abstraction: Virtualization introduces a layer between physical hardware and software, allowing applications and
operating systems to run without being directly tied to specific hardware.
• Virtual Machines (VMs): These are software-based simulations of physical computers, complete with virtual
CPUs, memory, storage, and network interfaces.
• Hypervisor: A crucial software layer that enables virtualization by managing multiple VMs on a host system and
allocating resources to them.
o Type 1 Hypervisor: Runs directly on the hardware (e.g., VMware ESXi, Microsoft Hyper-V).
o Type 2 Hypervisor: Runs on top of an existing operating system (e.g., VMware Workstation, VirtualBox).
• Containers: Lightweight alternatives to VMs, containers virtualize the OS rather than hardware, allowing isolated
applications to share the same kernel (e.g., Docker, Kubernetes).
What is Cloud Storage? - Cloud storage means saving your data on the internet instead of on your personal
computer or hard drive. The data is stored on remote servers that you can access anytime from anywhere using the
internet.
In the Internet of Things (IoT), many devices (like smartwatches, home assistants, sensors) collect and send data.
Cloud storage helps by:
o A leading cloud provider offering storage, computing, and machine learning services.
o Provides services like S3 (for storage), EC2 (for servers), and more.
o Offers tools to connect, manage, and collect data from IoT devices.
o You can use Django to build cloud-based apps that store and share data.
AWS (Amazon Web Services) is a cloud platform by Amazon. It gives you access to servers, storage, databases, and
many services over the internet, so you don’t need to buy physical hardware.
• Problem: Needed to stream movies and shows to millions of people worldwide without buffering or delay.
o Used:
• Result:
o Less maintenance using serverless tech (no need to manage servers manually)
APIs (Application Programming Interfaces) help different apps and services talk to each other.
• PUBSUB (Publish/Subscribe) – One device sends data, others subscribe to receive it.
• RESTful API: A simple, fast, and popular way to communicate between applications and cloud systems.
• Django can be used to design RESTful APIs to connect web apps with cloud storage.
🔷 What is WAMP?
• It's a communication protocol that helps different devices or apps talk to each other.
• It works over WebSocket, which is like a phone line between two computers.
• WAMP is mostly used in IoT (Internet of Things), cloud applications, and real-time messaging services.
How does it work? - WAMP uses something called a Router in the middle. Think of it like a traffic police officer who
manages and forwards messages between devices.
1. Transport
2. Session
3. Client
In Publish–Subscribe model:
o Example: Weather app publishes temperature → phones subscribed to "weather" get updates.
• A Callee answers that question or performs the task and returns the result.
Example: A smart light switch (Caller) sends "turn on light" → Smart bulb (Callee) turns on and replies "done."
4. Router
Broker (for PubSub) - Sends published messages to all the right subscribers.
Dealer (for RPC) - Sends the call from the Caller to the right Callee and sends the answer back.
5. Application Code
• It's what defines what a publisher sends, what a subscriber listens to, what a callee does, etc.
Xively is introduced as a commercial cloud-based PaaS (Platform as a Service) developed by LogMeIn, specifically aimed
at simplifying the development, deployment, and management of Internet of Things (IoT) applications. It provides tools
that enable developers to connect devices to the Internet, manage them remotely, and collect and analyze sensor data
in real time.
The platform is designed to reduce the effort and complexity involved in developing IoT solutions. It achieves this by
offering a ready-made backend infrastructure so that developers can focus on application logic and frontend
functionalities such as user interfaces, data visualizations, and interactions. This significantly shortens development
cycles and enables quick prototyping and product rollouts.
Features and Workflow
1. Creating a Device:
o The process starts by logging into the Xively developer console where users can create a new device.
▪ Privacy settings: Choose between Private (data only accessible via authorized API requests) or
Public (openly viewable data streams).
o After creation, the user is directed to a device management page that includes:
▪ API Key: A secure key used to authenticate API requests when reading from or writing to the
device feed.
▪ The page provides links and options to manage the device, including adding new datastreams,
modifying device metadata, and viewing data logs.
o Each device can have multiple datastreams—these represent the various types of sensor data being
collected (e.g., temperature, humidity, pressure).
o The Xively dashboard offers real-time visualization of these datastreams in the form of interactive line
graphs.
o These graphs show time-series plots of the sensor values, helping users monitor device performance
over time.
o Data can be pushed to the Xively platform programmatically using their RESTful APIs, and it gets
automatically reflected in these graphs.
o The platform offers REST-based APIs for sending (publishing) and retrieving (subscribing to) data.
o Developers can integrate Xively with hardware devices like Raspberry Pi, Arduino, or any Wi-Fi-enabled
microcontroller using HTTP requests to update the datastreams.
o API requests must include the correct Feed ID and API key to ensure security and proper routing of data.
Feature Description
Rapid Deployment Quick setup of IoT devices with minimal backend work
Feature Description
• Push that data every 5 minutes to Xively using an HTTP POST request.
• Allow public access to the feed for open research, or keep it private for internal analytics.
About Django
• Django is an open-source web application framework used for developing web applications in Python.
• Based on the Model-Template-View (MTV) architecture which helps in separation of data model, business logic,
and user interface.
• Django offers a unified API to interact with databases, allowing portability across different backends.
• It includes an Object Relational Mapper (ORM), a templating system, and a URL dispatcher.
• Model: Represents the structure of stored data; usually maps to a database table.
• Template: HTML files with Django’s templating language used to display dynamic data.
• View: Python functions or classes that receive HTTP requests, process data using models, and render templates.
mkdir Rollnum
cd Rollnum
cd Employee
4. Create an App inside the Project : >> python [Link] startapp Emp
GENDER_CHOICES = (
('M', 'Male'),
('F', 'Female')
class Empdata([Link]):
eid = [Link]()
ename = [Link](max_length=100)
dob = [Link]()
def __str__(self):
INSTALLED_APPS = [
...
'Emp',
[Link](Empdata)
8. Migrate Database
-----
• XML: Structured format for data; use Python’s minidom for parsing.
• Scikit-learn: Machine learning library offering classification, regression, clustering, and more.
To build a RESTful Web API using Django REST Framework to handle CRUD operations for a Weather Station model that
records sensor readings.
Build a RESTful API to manage weather station data (name, timestamp, temperature, latitude, longitude).
Steps to Build
cd restfulapi
class Station([Link]):
name = [Link](max_length=10)
timestamp = [Link](max_length=10)
temperature = [Link](max_length=10)
lat = [Link](max_length=10)
lon = [Link](max_length=5)
class StationSerializer([Link]):
class Meta:
model = Station
fields = ('url', 'name', 'timestamp', 'temperature', 'lat', 'lon')
router = [Link]()
[Link](r'station', [Link])
urlpatterns = [
url(r'^', include([Link])),
url(r'^home/', [Link]),
url(r'^admin/', [Link]),
o Define DB settings.
unit - 5
Case Study in IoT – Key Points (Short):
Applications of IoT
With advanced wireless networks, superior sensors, and cutting-edge computing, IoT is transforming everyday objects
with intelligence and connectivity.
Key Applications:
• Wearables
• Smart Buildings
• Smart Infrastructure
• Security Systems
• Healthcare Monitoring
• Smart Cities
• Industrial Automation
Home automation means using smart devices and technology to automatically control things in your home like lights,
appliances, security, and safety systems. You can control them remotely using your mobile phone or computer, even if
you're not at home.
1. Smart Lighting
Smart lighting systems help you save energy and make life easier.
How it works:
• Lights can automatically turn ON or OFF based on how bright the room is (ambient light) or if someone enters
or leaves the room.
• You can also dim the lights to use just the amount of brightness you need.
• Lights are connected to the internet or Wi-Fi, so you can control them from a mobile app or voice assistant like
Alexa or Google Assistant.
Example: You're not home, but it’s getting dark — you can turn on the porch light from your phone.
You walk into your room and the lights automatically turn on.
2. Smart Appliances
These are regular household appliances like refrigerators, washing machines, etc., but made smarter with technology.
What they do:
Examples:
• A smart washer/dryer that sends a notification when your clothes are ready.
• A smart refrigerator that tracks what’s inside and reminds you when you’re running low on milk or eggs.
Bonus: Some systems like OpenRemote let you connect many devices and control everything from one place. It has:
This system keeps your home safe by detecting unwanted people (intruders).
How it works:
Types of Alerts: SMS (Text Message) , Email , Images or short videos showing the intruder
Example: If someone tries to break in, the camera captures a photo and sends it to your phone right away.
These devices keep you safe from fire and harmful gases.
Smoke Detectors:
• Can sound an alarm or send a message to your phone or fire alarm system.
Gas Detectors:
• Detect dangerous gases like Carbon Monoxide (CO) or LPG (cooking gas).
IoT helps in making urban life easier, safer, and more efficient by using sensors, real-time data, and cloud-based apps for
better city management.
1. Smart Parking
Problem: Finding parking in busy cities takes time and causes frustration.
Solution:
• Sensors are placed in each parking spot to check if it’s empty or occupied.
• This data is sent to the cloud and shown in mobile apps or car systems.
Benefits:
1. Saves time
2. Reduces traffic
How it works:
o Time of day
Benefits:
• Saves electricity
3. Smart Roads
Features:
• This information is shared through apps and social media to alert drivers.
Benefits:
What it does:
1. Sensors are attached to bridges, buildings, etc. to monitor:
1. Vibrations
2. Cracks
3. Mechanical wear
Benefits:
• Prevents accidents
5. Surveillance
Setup:
• Many cameras are installed around the city, all connected to the Internet.
• Smart software can analyze videos for patterns like suspicious activity.
Benefits:
6. Emergency Response
What it monitors:
o Buildings
o Public transport
o Power stations
How it helps:
o Public warnings
o Rerouting traffic
It means using smart sensors and devices to watch over the environment—like weather, air, noise, forests, and rivers—
and sending this data to the cloud (internet storage) where it can be analyzed and used for better decisions, safety
alerts, and environmental protection.
1. Weather Monitoring
Helps track changes in weather like rain, heat, or storms using sensors.
How it works:
o Temperature
o Humidity
o Air Pressure
• If bad weather is coming, alerts (like warnings or notifications) can be sent to users.
Example:
• A system like Air Pi tracks: Temperature, UV levels, Smoke, Carbon monoxide, and more...
• It uploads all this data to the internet for users or authorities to view.
How it works:
Example: If an area has high pollution, authorities can limit traffic or regulate factory emissions.
How it works:
• Noise monitoring stations are placed around the city.
• These stations measure sound levels in different areas (like near schools, hospitals, or parks).
• The data is sent to the cloud and combined to create a noise map of the city.
Example: If noise is too high near a school, rules can be made to restrict vehicle horns in that area.
How it works:
o Temperature
o Humidity
o Light levels
• If something unusual (like high heat and smoke) is detected, the system sends an early alert.
Example: A sudden increase in temperature and smoke detection triggers a fire alert.
How it works:
• If water rises too fast or flows too quickly, it means a flood might happen.
Example: If a river starts rising after heavy rain, people can be warned to move to safer areas in time.
IoT helps in making energy systems smarter by tracking, analyzing, and optimizing electricity generation, usage, and
equipment health using sensors and cloud-based technologies.
1. Smart Grids
Smart grids are modern electric systems that use IoT to manage and optimize electricity flow from generation to
consumption.
How it works:
• Sensors are installed to track:
o Electricity generation
o Electricity consumption
• The system can predict problems, suggest how to save energy, and even control electricity better across the
network.
Benefits:
• Real-time feedback helps users know their power use and reduce bills.
Example: Users can get alerts if they’re using too much energy or if power is cheaper at a different time.
These include solar, wind, and hydroelectric energy sources. They’re clean but their power output varies with weather,
making it tricky to manage.
Solution: When too much energy is produced (like on a sunny day), the system can cut off or manage the extra power to
protect the grid.
Example: If a solar plant produces too much power at noon, system can redirect or reduce that flow to avoid overload.
This is about predicting failures in energy machines before they happen using IoT.
How it works:
• Special sensors called PMUs (Phasor Measurement Units) collect data like:
o Voltage
o Current
o Power quality
• The system compares current performance with normal operation to detect deviation or issues.
• Large amounts of data are analyzed to predict upcoming failures or maintenance needs.
Tools: OpenPDC is a tool used to process this live sensor data and help operators make decisions in real-time.
Benefits:
IoT enables retailers to automate operations, improve customer experience, and increase efficiency by using sensors,
RFID, and connectivity.
1. Inventory Management
How it works:
• Products have RFID tags attached which help inventory management and maintaining the right inventory levels.
• RFID readers on shelves or in warehouses scan these tags to monitor stock in real-time.
• RFID tags attached to the products allow them to be tracked in the real-time so that the inventory levels can be
determined accurately and products which are low on stock can be replenished. Ø
• Tracking can be done using RFID readers attached to the retail store shelves or in the warehouse
Benefits:
2. Smart Payments
Technologies:
• NFC (Near Field Communication): Enables two devices to communicate by touch or close proximity.
How it works:
• NFC can trigger Bluetooth for a faster and larger data transfer.
Benefits:
Features:
o Inventory monitoring
o Pricing changes
o Promotions
o NFC-based payments
Smart Capabilities:
Benefits:
• Personalized experience
LOGISTICS
1. Fleet Tracking
2. Scalability: Cloud-based systems can easily scale to manage a large number of vehicles.
3. Benefits:
2. Shipment Monitoring
• Use Case: Especially important for perishable goods like fresh produce.
• Technology:
• Benefits:
• Technology:
o On-board IoT devices collect operational data (e.g., speed, RPM, coolant temperature).
• Features:
• Benefits:
🌾 IoT in Agriculture
IoT in agriculture helps increase productivity, optimize resource usage, and reduce costs through automation and data
analytics.
🅐 Smart Irrigation
How it works:
Benefits:
• Saves water
• Boosts crop yield
🅑 Greenhouse Control
How it works:
• Based on sensor data, actuators control fans, sprinklers, heaters, and lights.
Benefits:
🅒 Precision Farming
How it works:
• Uses GPS, drones, IoT sensors, and big data to monitor and manage fields at a micro-level.
• Sensors collect data on soil quality, nutrients, weather, and pest levels.
Benefits:
🅓 Livestock Monitoring
How it works:
• Animals are fitted with wearable IoT devices (e.g., collars or tags).
Benefits:
How it works:
• Cameras, drones, and sensors capture real-time images and environmental data.
Benefits:
Industrial IoT integrates smart sensors, cloud computing, and data analytics into manufacturing and industrial processes
to increase efficiency, reduce downtime, and improve safety.
How it works:
• Sensors monitor real-time machine parameters like temperature, vibration, pressure, etc.
• Case-Based Reasoning (CBR) compares current data with past issues to predict faults.
Benefits:
How it works:
• Gas sensors detect pollutants like CO, CO₂, NO₂, VOCs, etc.
• Hazardous zones are identified and alerts are sent to ensure proper ventilation.
Benefits:
🅒 Predictive Maintenance
How it works:
Benefits:
How it works:
• Energy meters and IoT sensors monitor power consumption across machines, floors, or plants.
Benefits:
🅔 Asset Tracking
How it works:
• Uses RFID, GPS, or BLE tags to track movement and location of tools, parts, or vehicles.
Benefits:
• Reduces loss/theft
• Technology:
o IoT-enabled devices like ECG monitors, pulse oximeters, and glucose meters.
• Features:
• Benefits:
• Technology:
• Benefits:
• Technology:
• Features:
• Benefits:
• Technology:
• Features:
• Benefits:
• Technology:
o Wearables with GPS and motion sensors detect falls or cardiac events.
• Benefits:
• Technology:
• Features:
• Benefits:
• Technology:
• Benefits:
• Technology:
• Benefits:
🅘 Smart Ambulances
• Technology:
• Benefits:
IoT in Healthcare –
🏠 IoT in Lifestyle
IoT in lifestyle focuses on improving daily routines, productivity, fitness, and comfort through connected, intelligent
devices.
2. Technology:
1. Devices like Fitbit, Garmin, and Apple Watch track heart rate, steps, calories, and sleep quality.
2. AI-powered analytics provide personalized fitness insights.
3. Features:
4. Benefits:
• Technology:
• Features:
• Benefits:
• Technology:
o IoT lifestyle devices connect with smart homes to trigger automated processes.
• Features:
• Benefits:
• Technology: Devices like Oura Ring or smart headbands track REM cycles, oxygen levels, and snoring patterns.
• Features:
• Benefits:
• Technology: Smart rings and wristbands measure heart rate variability (HRV), skin temperature, and sweat levels.
• Features:
• Benefits:
• Technology: IoT-enabled bottles track fluid intake and remind users to drink water.
• Benefits:
• Technology:
o Smart fridges and kitchen scales track food consumption and nutrient balance.
Wearable IoT devices that allow non-invasive and continuous monitoring of physiological parameters can help in
continuous health and fitness monitoring. These wearable devices may be in various forms such as belts and wrist-
bands.
A type of wireless sensor network called Body Area Networks (BANs) consists of measurements from multiple wearable
devices continuously sent to a master node (such as a smartphone), which then transmits the data to a server or cloud-
based backend for analysis and archiving.
Healthcare providers can use the collected data to detect health conditions or anomalies.
• Body temperature
• Heart rate
• Blood pressure
• Electrocardiogram (ECG)
• Electroencephalogram (EEG)
o Steps
o Distance
2)Wearable Electronics
• Fashion electronics (e.g., clothing integrated with electronics like Google Glass or Moto 360 smartwatch)
Functions of Wearable Electronics:
Smartwatches
• Run on mobile OS
Smart Glasses
Smart Shoes
Smart Wristbands
Home Wi-Fi, Zigbee, Bluetooth, Smart Hubs Motion, Light, Smoke, Temperature
Smart City LPWAN, 5G, Cloud, AI Air Quality, Traffic, Noise, Surveillance
Environment Satellite, Cloud Analytics, LPWAN CO2, Humidity, Rain, UV, Soil Moisture
Domain Technologies Sensors Used
Energy Systems Smart Grid, Edge Computing, Blockchain Smart Meters, Voltage, Current, Temperature
Retail RFID, Cloud POS, Beacon Tech RFID, Barcode, Motion, Shelf Sensors
Agriculture LoRa, Drones, Cloud IoT Platforms Soil, pH, Moisture, Temperature, Humidity
Industry Industrial IoT (IIoT), PLC, SCADA Vibration, Pressure, Temperature, Proximity
Health IoMT, Cloud EMR, AI Analytics ECG, Glucose, Pulse Oximeter, Heart Rate
Lifestyle Wearables, Fitness Apps, Bluetooth Accelerometer, Gyroscope, Heart Rate, Sleep