Lecture 2 - IoT Architectures & a Use Case
Lecture Note 2: IoT Architectures and a Use Case
Course: CSS452 Internet of Things Instructor: Dr. Seksan Laitrakun School of ICT, SIIT, Thammasat University
Outlines
- IoT Building Blocks – Component Diagram
- IoTWF Standardized Architecture – Resemble OSI Layers
- A Simplified IoT Architecture – Functional and Data Stack
- Supplementary: An IoT Use-Case Study - Telemedicine Palliative Care
References
- [1] Chapter 2 of IoT Fundamentals: Networking Technologies, Protocols, and Use Cases for the Internet of Things, by D. Hanes et al. (1st ed., Cisco Press, 2017)
- [2] Chapter 1 of IoT and Edge Computing for Architects: Implementing edge and IoT systems from sensors to clouds with communication systems, analytics, and security, by P. Lea (2nd ed., Packt Publishing, 2020)
- [3] Chapter 2 of Enabling the Internet of Things: Fundamentals, Design and Applications, by M. A. Iqbal et al. (1st ed., Wiley-IEEE Press, 2020)
1. IoT Building Blocks
IoT Building Blocks
An end-to-end IoT system is built from five essential components:
- Smart Devices: The sensors and actuators that interact with the physical world.
- IoT Gateway: The bridge that connects devices to the cloud.
- IoT Cloud: For scalable data storage and management.
- Data Analytics: The brain that processes data and finds insights.
- User Application: The interface that delivers value to the end-user.
H1 (Diagram: Smart Thing → IoT Gateway → Internet/Intranet → Cloud → IoT Analytics → IoT App)
Think of it like a relay race: the Smart Device senses the world, hands the data baton to the Gateway, which passes it to the Cloud, where Analytics figures out what it means, and finally the App shows it to you.
1. The Smart Things/Devices
- A smart thing is a physical object that can sense its environment, process information, act on its surroundings, and communicate data over a network.
H1 (Diagram: Smart Thing wheel — Sensor / Communicator / Actuator / Controller)
1. The Smart Things — Bridge Between Physical & Digital World
- It is the essential bridge between the physical world and the digital world.
H1 (Diagram: Smart Thing → Electronic Device / Physical Thing → Tag / Sensor / Actuator)
- With reference to a smart thing in IoT, the attached electronic devices may have three subtypes: tags, sensors, and actuators.
- Tags: provide digital identification (Barcode, QRcode, RFID, etc.) to smart things and are read by reader sensors.
- Sensors: embedded/attached to smart things; responsible for identity reading, state monitoring of physical things, and communication.
- Actuators: act on the physical thing to update its state.
Analogy: a Tag is like a name badge (identifies you), a Sensor is like your eyes/ears (perceives the world), and an Actuator is like your hands (does something to the world).
1. The Smart Things — How does an object become smart?
- Born Smart: Designed from the ground up with built-in sensors and connectivity.
- Examples: A smartwatch, a smart thermostat, a connected car.
- Made Smart: A regular, non-smart object that has been retrofitted with sensors or electronic tags.
- Examples: Placing a sensor on an old factory machine, adding a smart tag to a shipping pallet.
1. The Smart Things: Sensors
Related
- Core Function: A sensor is a device that detects a physical change in its environment and converts it into a digital electrical signal.
- It is the fundamental component that allows a smart device to perceive the real world.
- Common Types of IoT Sensors:
| Category | Example |
|---|---|
| Environmental | Temperature, Humidity, Pressure, Gas, Smoke |
| Motion & Position | Accelerometer, Gyroscope, Proximity, GPS |
| Optical & Sound | Light Sensor, Camera, Infrared, Microphone |
| Flow & Force | Water Flow Sensor, Force Sensor, Load Cell |
1. The Smart Things: Actuators
Related
- Core Function: An actuator receives a digital command and converts it into a physical action.
- It is the component that "does the work."
- Common Types of Actuators:
| Actuator Type | Energy Source | Common Application |
|---|---|---|
| Electric | Electricity | Motors, Solenoid Valves |
| Hydraulic | Pressurized Liquid | Heavy Machinery, Brakes |
| Pneumatic | Compressed Air | Robotics, Valve Control |
| Mechanical | Mechanical Force | Gears, Chains, Pulleys |
1. The Smart Things: Communication
- Core Function: After sensing data, a smart device needs to transmit it. This is done using built-in, low-power wireless radios.
- How it Connects:
- Devices use various wireless technologies to send data to a central point.
- This data is often sent to an IoT Gateway, which acts as a bridge between the local devices and the internet.
- Common Wireless Technologies:
| Category | Example |
|---|---|
| Short-Range | Bluetooth, Zigbee |
| Medium-Range | Wi-Fi |
| Long-Range | LoRaWAN, Cellular (5G) |
1. The Smart Things: Microcontroller
- The Microcontroller (MCU) is a small, self-contained computer on a single chip that acts as the brain for an embedded device.
- Its Role: It runs the software that takes input from sensors, makes decisions, and sends commands to actuators.
- Key Features of a Microcontroller (MCU):
| Component | Function |
|---|---|
| Processor (CPU) | Executes program instructions (the "thinking"). |
| Memory (RAM/Flash) | Stores the program and temporary data. |
| Input/Output (I/O) Pins | Connects to sensors, actuators, and other components. |
| Peripherals | Built-in modules for networking (Wi-Fi, Ethernet), timing, etc. |
1. The Smart Things: Microcontroller — OS & Prototyping
Related
- Choosing an Operating System (OS): The software on the controller determines its capabilities.
| OS Option | Key Characteristic | Best For |
|---|---|---|
| Bare-metal | No OS; code runs directly on the hardware. | Maximum speed and efficiency; requires expert programming. |
| RTOS (Real-Time OS) | Guarantees tasks finish within a strict deadline. | Time-critical systems (e.g., industrial controls, robotics). |
| Linux (Full OS) | A full computer environment; easy to program. | Complex applications that are not time-critical (e.g., gateways). |
- Prototyping with Development Boards
- What they are: A ready-to-use circuit board that includes the MCU plus all the necessary supporting components (power, I/O pins, etc.).
- Their Purpose: They make it fast and easy to build and test a prototype without designing custom hardware.
- Popular Examples: Arduino, Raspberry Pi, ESP32.
1. The Smart Things - Capabilities
The smartness of a device (thing) depends on its level of capability:
- Level 1: Core Capability
- Level 2: Enhanced Capability
- Level 3: Advanced Capability
H1 (Diagram: Pyramid — Essential Level / Enhanced Level / Advanced Level)
Analogy: think of it like a video game character leveling up — first you get basic stats (name, memory), then skills (sense, act, network), then finally "boss-level" self-awareness.
a) Core Capabilities: The Must-Haves of a Smart Thing
The four essential features every smart object needs to function:
- Identification (A Name Tag): The ability to have a unique digital identity so it can be recognized on the network.
- Retention (A Memory): The capacity to store essential information about itself and its environment.
- Communication (A Voice): The ability to send and receive data with other devices and systems.
- Energy Harvesting (A Power Source): The ability to power itself, either from a battery, a wired source, or by generating its own energy (e.g., solar).
b) Enhanced Capabilities (Making a Thing Interactive)
- Sensing & Actuating: The ability to perceive the environment and perform physical actions.
- Processing: An onboard brain (MCU) to execute instructions.
- Networking: The ability to communicate using standard protocols (e.g., Wi-Fi, Bluetooth).
- Logging: The capacity to record important events and data points.
- Shielding: Security and privacy features to protect the device and its data.
c) Advanced Capabilities (Making a Thing Autonomous)
- Self-Awareness: The device understands its own internal state, condition, and history.
- Example: "My battery is at 20% and my filter is 90% clogged."
- Self-Management: The device uses its self-awareness to manage its own lifecycle, including maintenance and updates.
- Example: "Because my filter is clogged, I will reduce my performance and automatically order a replacement."
2. IoT Gateways: A Bridge to the Cloud
H1 (Diagram: Sensors → IoT Gateway → Internet/Intranet → Cloud → IoT Analytics → IoT App)
- What is it? A physical device and/or software program that acts as the central hub connecting local IoT devices to the internet.
- Key Functions of a Gateway:
- Protocol Translation: Acts as a universal translator, allowing devices that use different languages (like Bluetooth, Zigbee) to communicate with the internet.
- Fog Computing: Filters, aggregates, and summarizes data locally before sending it to the cloud. This saves bandwidth and reduces cloud costs.
- Security: Provides a secure checkpoint to encrypt data and manage access for all connected devices.
- Note: A gateway typically manages data from other sensors; it might have or not have sensors of its own.
2. IoT Gateways: Component Stack
A gateway is a combination of specialized hardware and software components working together.
- Hardware Core:
- Processor (MCU/MPU): The brain that runs the gateway's software and processes data.
- Connectivity Radios: Multiple wireless modules to communicate with various devices (e.g., Wi-Fi, Bluetooth, Zigbee, LoRaWAN, Cellular).
- Security Hardware: Dedicated crypto-authentication chips to secure data and device identities.
- Software Stack:
- Operating System (OS): Manages the hardware and software resources. While Linux or Android can be used, a Real-Time OS (RTOS) is often preferred for its reliability and predictable timing.
- Communication Protocols: Software that handles different communication protocols (e.g., MQTT, CoAP, 6LoWPAN) to ensure interoperability.
Where data processing can happen? Edge/Fog/Cloud Computing
To manage the massive amount of data from IoT, processing can occur at different layers, each with its own advantages.
- Edge Computing (On the Device)
- Where: Directly on the smart device/sensor itself.
- What: Instant, real-time decisions and data pre-processing.
- Fog Computing (Local Network Hub)
- Where: On a local gateway or server.
- What: Aggregates data from multiple devices, filters it, and performs local analysis before sending it to the cloud.
- Cloud Computing (Centralized Brain)
- Where: Remote data centers.
- What: Deep analysis, long-term storage, and big-picture business intelligence.
Analogy: Edge is like making a decision yourself on the spot (reflex), Fog is like asking your local team leader (department), and Cloud is like sending it up to headquarters for deep, long-term analysis.
2. IoT Gateways: Edge/Fog Computing
- What it is: A computing model where data processing and analysis happen locally, on or near the IoT gateway, before data is sent to the central cloud.
- Why it is needed: Sending all raw data to the cloud is often too slow, expensive, or unreliable.
- Key Benefits of Fog/Edge Computing:
- Reduced Latency: Enables near real-time decisions by processing data locally.
- Lower Bandwidth Costs: Filters and aggregates data, sending only what's important to the cloud.
- Improved Reliability: Can continue to operate locally even if the internet connection is lost.
- Edge & Cloud: A Partnership, Not a Rivalry
- Edge/Fog Layer: Handles immediate, time-sensitive tasks.
- Cloud Layer: Handles long-term storage, complex analysis, and big-picture insights.
3. IoT Cloud
H1 (Diagram: Cloud with Load Balancers → Application Servers → Database Servers, and Physical Servers in Virtual Resource Pool)
- Core Purpose: The IoT Cloud is a network of high-performance servers designed to store, process, and analyze the massive amounts of data generated by an IoT system.
- Core Components:
- Databases: For securely storing vast amounts of IoT data.
- Application Servers: To run the software that performs analysis and business logic.
- Load Balancers: To distribute incoming data traffic efficiently and prevent server overload.
4. IoT Analytics: From Raw Data to Smart Decisions
- Core Goal: To analyze data from IoT devices to discover patterns, predict future trends, and prescribe actions. The aim is to improve products, services, and operational efficiency.
- Relationship with Big Data:
- IoT analytics uses many of the same tools as Big Data analytics (e.g., data warehouses, data mining).
- However, IoT presents its own unique set of challenges.
- Unique Challenges in IoT Analytics:
- Data Heterogeneity: Managing data from countless different types of sensors, all with different formats.
- Real-Time Velocity: Processing continuous, high-speed data streams as they arrive.
- Data Quality & Noise: Cleaning and refining messy, incomplete, or inaccurate sensor readings.
- Spatiotemporal Context: Analyzing data where both the location (where) and the time (when) are critically important.
- Security & Privacy: Ensuring sensitive and personal data is handled securely and anonymized before analysis.
4. IoT Analytics: The IoT Analytics Lifecycle
H1 (Diagram: Data Collection Phase → Data Unification Phase → Data Analysis Phase → Data Operational Phase)
- Collect
- Gather raw data from heterogeneous devices and sensors.
- Prepare
- Clean, validate, and unify the data to ensure its quality, consistency, and accuracy.
- Analyze
- Apply machine learning and data mining techniques to transform the clean data into actionable insights and knowledge.
- Act & Visualize
- Implement actions based on the insights. Visualize the results on dashboards and make the data available for reuse.
5. IoT Applications
To fully understand an IoT solution, we must look at both its technical delivery method and its real-world vertical market.
- Application Tools (The "How": User Interface)
- Defines the software layer, user interface, and interaction mechanisms.
- Focuses on how data is displayed, analyzed, and acted upon by humans or other systems.
- Application Areas (The "Where": Domain)
- Defines the target domain, industry, or environment.
- Focuses on where the physical sensors/actuators are deployed to solve specific domain problems.
5. IoT Applications — Examples
| 1. Application Tools (The Interface) | 2. Application Areas (The Domain) |
|---|---|
| Dashboards: Real-time data visualization and operational control (e.g., ThingSpeak, Grafana). | Consumer & Smart Home: Wearables, home automation, smart appliances. |
| Web & Mobile Apps: User-facing remote control and system configuration. | Industrial IoT (IIoT): Factory automation, asset tracking, predictive maintenance. |
| Analytics & Reporting: Machine learning engines, ERP integrations, and historical reporting. | Healthcare: Remote patient monitoring, medical equipment tracking. |
| Voice & Ambient Interfaces: Voice assistants (e.g., Alexa, Google Assistant) and edge displays. | Smart Agriculture: Precision farming, livestock tracking, automated irrigation. |
| Event Triggers & APIs: Webhooks, SMS/Email alerts, and system-to-system integrations. | Smart Cities & Infrastructure: Traffic management, environmental monitoring, smart grids. |
| Etc. | Etc. |
2. IoTWF Standardized Architecture
IoT needs its own architectures.
The Open Systems Interconnection (OSI) model for Computer Networks
Related
| Layer | Name | Description |
|---|---|---|
| 7 | Application Layer | Human-computer interaction layer, where applications can access the network services |
| 6 | Presentation Layer | Ensures that data is in a usable format and is where data encryption occurs |
| 5 | Session Layer | Maintains connections and is responsible for controlling ports and sessions |
| 4 | Transport Layer | Transmits data using transmission protocols including TCP and UDP |
| 3 | Network Layer | Decides which physical path the data will take |
| 2 | Datalink Layer | Defines the format of data on the network |
| 1 | Physical Layer | Transmits raw bit stream over the physical medium |
Credit: cloudflare.com/learning/network-layer/what-is-a-protocol
IT vs. IoT Networks: Two Different Worlds
While they share some technologies, their purpose, focus, and challenges are fundamentally different.
| Feature | Traditional IT Networks | IoT Networks (often OT) |
|---|---|---|
| Primary Focus | Supporting business applications (email, databases, web). | Capturing, analyzing, and acting on data from physical things. |
| Core Concern | The secure and reliable flow of business information. | The entire data lifecycle: from sensor to action. |
| Domain | Information Technology (Data centers, offices). | Operational Technology (Factories, cities, physical environments). |
| Maturity | Mature and well-understood architecture. | New and evolving architecture with unique requirements. |
- The Bottom Line: IT networks support the business. For many companies, IoT networks are the business that creates new value directly from sensor data.
A Standard for IoT: The IoTWF Reference Model
- The Need: The unique challenges of IoT required a new, standardized architecture, different from traditional IT.
- The Solution: In 2014, the IoT World Forum (IoTWF), led by companies like Cisco and IBM, created a seven-layer architectural reference model.
- Why It is Important:
- It provides a clear, simplified blueprint for designing complex IoT systems.
- It formally incorporates modern concepts like edge/fog computing.
- It emphasizes that security is not just one layer, but a requirement that spans the entire model.
The IoT World Forum (IoTWF) Standardized Architecture
H1 (Diagram: 7-layer pyramid — 1 Physical Devices & Controllers, 2 Connectivity, 3 Edge Computing, 4 Data Accumulation, 5 Data Abstraction, 6 Application, 7 Collaboration & Processes)
Layer 1: Physical Devices & Controllers
- Core Function: This layer is the foundation of IoT, containing the physical hardware that interacts with the real world. It is the "things layer."
- Key Components:
- Sensors: To collect data (e.g., temperature, motion).
- Actuators: To perform physical actions (e.g., open a valve).
- Controllers: The embedded brains that manage the device.
- Primary Function:
- To generate data from the physical environment.
- To be controlled or queried over the network.
- Scope: Ranges from microscopic sensors to massive industrial machines.
Layer 2: Connectivity
- Core Function: To provide reliable and timely data transmission.
- What it Connects:
- Upstream: Transmits data from the physical devices (Layer 1) to the network.
- Downstream: Delivers commands from the network back to the devices.
- Its Scope: This layer includes all the networking infrastructure required to move data, such as:
- The last-mile network (e.g., Wi-Fi, LoRaWAN connecting devices to a gateway).
- IoT gateways.
- Backhaul networks (e.g., Cellular, Fiber).
H1 (Diagram: Layer 2 Connectivity — router/switch icons with functions listed)
- Layer 2 Functions: Communications Between Layer 1 Devices; Reliable Delivery of Information Across the Network; Switching and Routing; Translation Between Protocols; Network Level Security.
Layer 3: Edge (Fog) Computing
- Core Function: Process data as close to the source as possible. This layer acts as a local mini data center.
- Primary Goal: To reduce the volume of data and turn raw data streams into useful information before sending it to the cloud.
- Key Functions:
- Filtering & Aggregation: Summarize data to send only what is important.
- Data Formatting: Translate and reformat data into a standard structure.
- Threshold Analysis: Assess data in real-time to see if it crosses a critical threshold, triggering immediate alerts or local actions.
H1 (Diagram: Layer 3 Edge/Fog Computing — Data Packets in → Data Ready for Processing at Higher Levels out)
- Layer 3 Functions: Evaluate and Reformat Data for Processing at Higher Levels; Filter Data to Reduce Traffic Higher Level Processing; Assess Data for Alerting, Notification, or Other Actions.
Layer 4: Data Accumulation (The Library/Database)
- Core Function: To capture and store the vast amount of incoming data.
- Key Transformation: It converts the continuous, real-time data stream (Data in Motion) into a queryable database (Data at Rest).
Layer 5: Data Abstraction (Standardization)
- Core Function: To combine and normalize data from many different sources and formats.
- Key Actions:
- Ensures data is consistent and complete.
- Creates a single, unified view of the data for applications to use.
Layer 6: Applications (The Interpreter)
- Core Function: To use software applications to interpret the organized data.
- Key Outputs: This is where you find your dashboards, reports, and control interfaces.
Layer 7: Collaboration & Processes (The Action Plan)
- Core Function: To get the right information to the right people at the right time to improve how they work.
- Key Impact: This is the ultimate goal of IoT — using the insights to change business processes, drive efficiency, and create new value.
IT and OT Responsibilities in the IoT Reference Model
The IoT Reference Model provides a clear framework for dividing responsibilities.
- OT Domain (The Field & Factory Floor)
- Focus: Physical Devices, Real-Time Control, Connectivity
- Layers:
- Layer 1: Physical Devices & Controllers (The things)
- Layer 2: Connectivity (The network)
- Layer 3: Edge Computing (Local data processing)
- IT Domain (The Cloud & Data Center)
- Focus: Data, Applications, Business Logic
- Layers:
- Layer 4: Data Accumulation (Storage)
- Layer 5: Data Abstraction (Combining data sources)
- Layer 6: Application (Reporting, analytics)
- Layer 7: Collaboration & Processes (The business value)
H1 (Diagram: 7-layer pyramid split into IT [Query Based, Data at Rest, Non-real Time] vs OT [Event Based, Data in Motion, Real-Time])
OT and IT on Data Management
- The Challenge: A Fundamental Speed Mismatch
- OT Layers (1-3): Generate vast amounts of high-velocity, real-time "Data in Motion."
- IT Layers (4-7): Applications are designed to work with stored, structured "Data at Rest."
- The Architectural Solution: Layered Buffering
- Data must be systematically stored and organized at key points within the IoT stack (e.g., database).
- This process transforms the data from a continuous stream into a manageable, queryable state.
- The Organizational Result: Required Collaboration
- The core of a successful IoT project is the collaboration between IT and OT teams to manage this data transformation process effectively.
Analogy: OT is like a fire hose spraying constant real-time water (data), while IT is like a swimming pool that needs the water to be collected first before anyone can "swim" (query) in it.
3. A Simplified IoT Architecture
This section will specify a simple IoT architecture.
A Simplified IoT Architecture
- The Challenge: Many IoT reference models exist, and they can be complex.
- The Common Goal: All models aim to connect devices to applications, moving data across a network.
- A Simpler View: We can simplify this into a fundamental framework with two parallel stacks:
- The Core IoT Functional Stack: Describes what the system does (e.g., device management, connectivity, security).
- The Data Management & Compute Stack: Describes where data is handled (e.g., at the Edge, in the Fog, or in the Cloud).
H1 (Diagram: Two parallel stacks side by side — Core IoT Functional Stack [Applications / Communications Network / Things] and IoT Data Management and Compute Stack [Cloud / Fog / Edge], connected by "Security" arrow)
1. The Core IoT Functional Stack
For an IoT system to work, three fundamental layers must operate together:
- Layer 1: The Things (The Senses & Muscles)
- Physical devices, sensors, and actuators that interact with the real world.
- Layer 2: Communications Network (The Nervous System)
- Provides the communication path for data to travel from the "things" to the application layer.
- Layer 3: Applications & Analytics (The Brain)
- Processes data to make intelligent decisions.
- Controls devices and tells them how to adapt.
Analogy: Think of the human body — Things = senses & muscles, Network = nervous system, Applications = brain.
1. Core IoT Functional Stack — Layer 1: Things: Sensors and Actuators Layer
The type of smart things you choose determines the entire IoT architecture. Classified by these key characteristics:
1) Power Source: Battery vs. Wired
- Battery-Powered: Offers mobility and flexibility.
- Constraint: Limited lifetime and power budget, which impacts how often it can send data.
- Example: A wearable fitness tracker.
- Wired Power: Provides a continuous, reliable power source.
- Constraint: The device is stationary.
- Example: A smart thermostat connected to your home's electrical system.
2) Mobility: Static vs. Mobile
- Static: The device stays in one fixed location.
- Example: A humidity sensor installed in a wall.
- Mobile: The device moves, either on its own or attached to something else.
- Constraint: Mobility often requires battery power and a more complex network connection.
- Example: A GPS tracker on a delivery truck.
3) Reporting Frequency: Low vs. High
- Low Frequency: Reports data occasionally (e.g., once a day or month).
- Benefit: Consumes very little power.
- Example: A structural health sensor on a bridge.
- High Frequency: Reports data hundreds or thousands of times per second.
- Constraint: Requires significant power and bandwidth.
- Example: A vibration sensor on an industrial motor.
4) Data Richness: Simple vs. Rich
- Simple Data: Sends a small amount of data per report.
- Example: A smart light bulb sending a simple "on/off" status.
- Rich Data: Sends a large, complex set of parameters per report.
- Constraint: Requires more power and network bandwidth.
- Example: A modern jet engine sensor reporting hundreds of variables simultaneously.
5) Communication Range: Short vs. Long
- Short Range: Communicates over a few meters.
- Technology: Bluetooth, NFC.
- Example: Your smartwatch syncing with your phone.
- Long Range: Communicates over hundreds of meters or even kilometers.
- Technology: LoRaWAN, Cellular.
- Example: A moisture sensor in a large agricultural field.
6) Device Density: Low vs. High
- Low Density: A few devices spread over a large area.
- Example: Monitoring sensors placed miles apart on an oil pipeline.
- High Density: Many devices concentrated in a small area, often connected to the same gateway.
- Constraint: Can create network congestion and interference.
- Example: Hundreds of smart sensors on machinery in a single factory room.
1. Core IoT Functional Stack — Layer 2: Communications Network Layer
Based on the device's needs (range, power, etc.), this layer provides end-to-end connectivity. Composed of four functional sublayers:
- Access Network
- The "first hop" connecting devices to the network (e.g., Wi-Fi, LoRaWAN, Bluetooth).
- Gateways & Backhaul
- The bridge that aggregates device data and connects the local network to the core network (e.g., via Cellular, Fiber).
- Network Transport
- The core protocols that manage data routing and reliability across the internet (e.g., IP, TCP, UDP).
- IoT Network Management
- The services that oversee the entire communication process, ensuring performance and security.
1. Core IoT Functional Stack — Layer 3: Applications and Analytics Layer
Application Types
Applications generally fall into two categories:
- Analytics Applications (Providing Insight)
- Goal: To understand what is happening.
- Function: Collects data from many devices, processes it, and displays it as historical reports, statistics, or trends.
- Example: A dashboard showing the energy consumption of an entire building over the past month.
- Control Applications (Taking Action)
- Goal: To control the behavior of a device.
- Function: Uses data to trigger an action in the physical world based on a set of rules.
- Example: An application that automatically turns on a water pump when a pressure sensor detects a drop.
Types of Analytics
- Data Analytics (Analyzing the What)
- Focus: Understanding the information collected by the smart devices.
- Question it Answers: What does the sensor data tell us about the real world?
- Example: Analyzing temperature data to determine the optimal climate settings for a greenhouse.
- Network Analytics (Analyzing the How)
- Focus: Monitoring the health and performance of the communication network itself.
- Question it Answers: Are my devices connected and communicating reliably?
- Example: Detecting that a critical sensor in a mine has lost its connection and sending an alert.
Applications and Analytics Layer → Smart/Intelligent/Automatic Services
- What is a Smart Service?
- Using IoT data and analytics to improve a process, create a new experience, or increase efficiency in a way that wasn't possible before.
- It is about adding a layer of intelligence to an existing service.
- Real-World Examples:
- Predictive Maintenance: Instead of fixing machines on a rigid schedule, sensors predict exactly when a part will fail, and maintenance is scheduled just in time.
- Smart Hospitality: Motion sensors in a hotel lobby evaluate guest traffic in real-time, allowing management to redirect staff to busy areas instantly.
- Anticipatory Lighting: A smart lighting system does not just react to you entering a room—it learns your movement patterns and turns the lights on just before you arrive.
2. IoT Data Management and Compute Stack
IoT data management and compute stack is an equivalent diagram of the Core IoT Functional Stack shown previously. It is a data centric point of view.
- Cloud Computing (Centralized Brain)
- Where: Remote data centers.
- What: Deep analysis, long-term storage, and big-picture business intelligence.
- Fog Computing (Local Network Hub)
- Where: On a local gateway or server.
- What: Aggregates data from multiple devices, filters it, and performs local analysis before sending it to the cloud.
- Edge Computing (On the Device)
- Where: Directly on the smart device/sensor itself.
- What: Instant, real-time decisions and data pre-processing.
2. IoT Data Management and Compute Stack — The Core Problem: A Data Tsunami
- IoT creates two fundamental challenges that traditional architectures cannot handle:
- Massive Scale: Billions of devices generating data.
- Massive Data Volume: A constant flood of information.
- This leads to critical bottlenecks:
- Network Strain: Can the network pipes handle the sheer volume of traffic?
- Server Overload: Can the cloud or data center ingest and process data fast enough?
2. IoT Data Management and Compute Stack — Edge/Fog Computing
The Solution: Move the Compute to the Raw Data
- The Core Idea: Instead of sending all raw data to the cloud, we distribute the processing and storage tasks to devices at the edge of the network.
- What is Edge/Fog Computing?
- Edge computing: Compute at IoT devices.
- Fog computing: Compute at gateway devices.
- What Does It Do?
- Filters: Ignores irrelevant data.
- Aggregates: Combines multiple data points into a summary.
- Analyzes: Makes immediate, low-latency decisions locally.
- The Primary Goals:
- Reduce Data Volume: Send less traffic to the cloud, saving bandwidth and cost.
- Increase Response Speed: Enable real-time actions without waiting for the cloud.
2. IoT Data Management and Compute Stack — Defining Characteristics of Edge/Fog Computing
Edge/Fog computing turns raw data into actionable knowledge locally. Defined by four key attributes:
- Low Latency & Location Awareness: Edge/fog nodes are placed close to the data source to enable the fastest possible analysis and response time.
- Geographic Distribution: Unlike the centralized cloud, edge/fog nodes are deployed as a wide, distributed network, wherever they are needed.
- Bandwidth Optimization: Significantly reduces network traffic by pre-processing, filtering, and aggregating data locally before sending it upstream.
- Real-Time Interaction: Specifically designed for applications that require immediate, interactive processing, not delayed batch analysis.
4. Supplementary: An IoT Use-Case Study - Telemedicine Palliative Care
This section will discuss an IoT use-case example.
1. Telemedicine Palliative Care
A provider of in-home care and consultation for elderly and senior citizens intends to modernize their current practice of in-home nursing and nursing assistance care with better, more actionable, and economical solutions to address the growing crisis of costs and patient numbers.
- Currently the service maintains in-home care with 7-day routine visits to over 500 patients within a 100-mile radius of a metro area in Madison, Wisconsin.
- Visits consist of everything from delivery of medicine and special care services to measurements of patient vitals.
- Patients are typically over 70 years old and have no ability to administer any IT infrastructure brought into the home.
- Additionally, patient homes may not have any Internet connectivity or broadband connection.
2. Requirements
The provider wishes for a system to provide these minimum feature sets and services:
- Each patient will be assigned a wearable device to monitor heart rate, blood oxygen, movement, temperature, and steps taken.
- An additional device(s) will be installed in patient homes to monitor specific patient conditions and vitals such as blood pressure, blood glucose levels, weight, oral temperature, and so on.
- The system must report data on patient vitals to a central operations dashboard.
- The system will also remind patients of events such as when to take a certain pill or when to administer a vital test.
- The system must be able to track status of a patient in the event of power failure.
- A wearable system is provided with an easily identifiable push button that will signal an emergency situation (such as a fall) to the awaiting operator service. The device will flash to indicate an emergency has been activated. The device will have two-way audio communication with the operator. In the event of a hearing-impaired patient situation, an alternative method will be used to communicate to the patient.
- The entire network must be able to manage 500 current patients and grow in scale at 10 percent per year.
- The system must deliver an overall cost savings and ROI (return of investment) of 33 percent within three years of implementation. This key performance indicator (KPI) is measured by reducing in-home nursing and nursing assistance care from three hours per day to two hours per day while increasing the quality of healthcare for patients in the program.
3. Challenges
Medical IoT and telemedicine are one of the most rapidly growing fields of IoT, AI/ML, and sensor systems. With a growth rate year over year (YoY) of 19 percent and a market of $534 billion by 2025, it has garnered much interest. However, this case study is examined for the sizable constraints it places on the system designer.
- Specifically, in areas of healthcare, the stringent requirements and HIPAA and FDA regulations impose constraints that have to be overcome to build a system that affects patients' well-being. For example, HIPAA will require patient data to be secured, so encryption and data security will have to be designed and qualified for the entire system.
- Additionally, here we examine constraints of the elderly, namely the lack of robust Internet connectivity, while attempting to build an Internet-connected system.
4. Implementation
The system will be broken down into three major components:
1. The far edge layer
- Two devices: a wearable device for the patient, and a myriad of different medical grade measurement tools.
- The wearable will be a wireless device while the other measurement devices may or may not be wireless.
- Both will establish secured communication to the PAN-LAN layer component.
2. The (near) edge PAN-WAN layer
- A secured device installed within the locality of the patient home or where they may be cared for.
- Should be portable but once installed, it shouldn't be used and tampered with by the patient.
- Houses the PAN-LAN networking infrastructure equipment.
- Also contains the edge computing systems to manage the devices, control situational awareness, and securely store patient data in the event of a failure.
3. Cloud layer
- The aggregation point to store, record and manage patient data.
- Presents dashboards and situational awareness rules engines.
- The clinician manages a fleet of installed home-care systems through a single dashboard and pane-of-glass.
- Managing 500 patients with 10 percent growth YoY presents challenges in managing that amount of data quickly, especially in emergency situations. Therefore, rules engines will be built to determine when an event or situation exceeds a boundary.
These three layers of the architecture comprise the system from sensor to cloud.
Implementation — Data Flow Diagram
H1 (Diagram: Far Edge Wearable Device [HR/BP/Temp Sensor → Read Sensor Data → Bluetooth Advertise Data] → BLE → Edge Computer [Read Bluetooth Advertise Data → Encrypt and Cache Data to Local Storage → Publish Data to Cloud via MQTT over TLS → Cellular LAN] → MQTT over Cellular → Cloud Backend [Azure IoT Hub ↔ UI Reporting Tools ↔ Device Management, Azure IoT Hub → Azure Stream Processing → Business Integration Logic Apps])
The dataflow stretches through all three layers of this IoT use case:
- This use case will read from integrated sensors and broadcast the data as BLE advertised packets as a paired BLE device to the edge computer.
- The edge system manages the relationship to the Bluetooth PAN and will retrieve, encrypt, and store the incoming data in the event of a power or communication failure to the cloud.
- The edge system has the additional responsibility of converting the Bluetooth data into TCP/IP packets wrapped in an MQTT transport.
- It also must set up, manage, and control a cellular communication with a subscription provider. MQTT allows for the reliable and robust transport to the awaiting cloud system (Azure in this example). Data is encrypted over the wire through TLS and then ingested by the Azure IoT Hub.
- At that point, data will be authenticated and marshalled through the Stream Analytics engine and to the Logic Apps where cloud-based web services will host a dashboard of patient information and events.
The next sections detail aspects of each layer.
4.1 Far Edge Architecture – Patient's Wearable Device
Breaking down the user requirement into actionable system requirements:
| Use case | Choices | Detailed description |
|---|---|---|
| Wearable patient monitor | Wrist strap / Neck strap / Chest strap / Arm strap | Patient-wearable device. Device should maintain integrity under several environmental parameters such as water submersion, cold, heat, humidity and so on. |
| Wearable vital monitors | TI AFE4400 heart rate and pulse oximeter | Medical-grade heart rate monitor and blood oxygen sensor |
| ST Micro MIS2DH Medical Grade MEMS Accelerometer | Movement and pedometer sensor | |
| Maxim MAX30205 Human Body Temperature Sensor | Medical-grade temperature sensor | |
| Emergency call button | A single visible push button with an LED on the unit | The button should depress but not create false positive events. Additionally, a light should flash when an emergency situation is activated. Additionally, a two-way communication can be initiated. |
| Edge control system | ST Micro STM32WB microcontroller | System to interface sensors and provide PAN communication to PAN-WAN layer. Edge system contains necessary radio hardware and audio codecs. |
| Microphone | Knowles SPU0410LR5 audio, microphone and amplifier | Two-way communication in event of emergency. |
| Power system | Encased Li-ion battery in wearable. | The system should have multi-day rechargeable battery life with warnings to the patient and clinician in event of a low-power state. Power system should be rechargeable or replaceable. |
| Pairing | Bluetooth / Zigbee / Wi-Fi | Need a method to pair and associate wearable attributes within the home PAN-LAN hub. |
Considerations for the Wearable Device
1. Device Component and Maintenance
- The intent of the wearable device in a palliative care situation is to be reliable, robust, and durable.
- Medical-grade components and environmentally tested electronics were chosen to withstand use cases that may arise in home care.
- The device also will have no serviceable parts.
- We chose not to burden the patient with recharging the wearable as this procedure may not be followed reliably.
- Since the project still requires in-home nursing and nursing assistance care, part of the task of the nursing assistance will be to recharge and monitor the health of the wearable.
2. Wearable Device Design
- A system usually starts with the constraints of the embodiment of the components. A wearable system for in-home health care of the elderly could be in the form of a wristband, neck strap, arm strap, and so on.
- This project has chosen a wrist strap akin to a hospital-style name band that a patient would already have some familiarity with.
- The wrist strap allows for fitting close to the skin and arteries to allow for collection of health characteristics.
- Other forms of wearables failed to provide more robust contact.
- The wrist strap does have significant constraints in size, power, and shape that must contain all the electronics, power supply, and radios.
3. Circuit Design
H1 (Block diagram: STM32WB Microcontroller [ARM Cortex M4 @64MHz, ARM Cortex M0 @32MHz, 256 KB RAM, 1MB Flash, AES Encryption Engine] connected to Bluetooth 5 Antenna, 8x80 LCD, Momentary Push Button, Microphone, Speaker/Amplifier, Heart Rate and Pulse Oximeter [SPI], MEMS Accelerometer [I2C] x2, Integrated Power Management Unit, Power - Battery)
- From a block diagram perspective, the wearable will consist of as few components as possible to minimize space and weight while conserving as much power as possible.
- A very power-efficient microcontroller with a Bluetooth 5 radio (BLE) is used. The BLE radio serves as the PAN communication to the PAN-WAN hub. BLE 5 has a range of up to 100 meters (or further when LE Long-Range Mode is enabled).
4.2 Edge Layer Architecture – Gateway/Router
The PAN-WAN edge layer is the central edge computer, gateway, and router.
- In many instances this functionality is performed by a smartphone device.
- However, in this implementation, a system is needed using a different and more economical cellular service plan than what is typically offered for smartphone consumers. Because the scale is 500 users and growing, a hub is built using off-the-shelf hardware components to deliver the best solution for the customer.
H1 (Block diagram: Inforce 6560 SOC — Kryo 260 CPU x4 @1.8GHz, Adreno 512 GPU, USB 2.0, Cellular LTE Radio, Bluetooth 5 Radio, connected to 32 GB eMMC, 1 GB LPDDR4, Power Failover Control + Battery + 12V Line Current, Cellular Antenna, Bluetooth 5.1 Angle of Arrival Antenna)
- The edge computer chosen is an industrial-grade single board computer capable of running an enterprise grade distribution of Linux. The Inforce 6560 acts as a gateway between the Bluetooth 5.0 PAN and a cellular WAN. The SOC incorporates:
- Snapdragon 660 processor with a Qualcomm Kryo 260 CPU
- 3 GB of onboard LPDDR4 DRAM
- 32 GB of eMMC storage
- One microSD card interface
- Bluetooth 5.0 radio
- 802.11n/ac Wi-Fi 2.4GHz and 5GHz radio
4.3 Cloud Layer Architecture – Microsoft Azure IoT
The cloud layer provides the services of ingestion, long-term data storage, stream analytics, and patient-monitoring dashboards.
- Provides the interface to healthcare providers to manage hundreds of edge systems securely through a common interface.
- Also the method to quickly provide alerts to health situations, error conditions, and system failures, and provide device upgrades securely.
- Requires a service to ingest data from multiple edge devices securely. The data needs to be stored for analysis and monitoring.
- Cloud services should also include a method to manage and provision edge installations.
- Finally, a method to get real-time data from the patients and display it to qualified staff.
For this project, Microsoft Azure IoT was chosen as the cloud provider to manage this large installation and allow for growth and scalability.
H1 (Diagram: Client1...Clientn → IoT Hub → Azure Stream Analytics → [Threshold Rules Store → Logic App Dynamics to Azure → Service Bus] and [Service Bus → Logic App Azure to Dynamics] → Desktop/Monitor icon, plus Azure Stream Analytics → Azure Stream Analytics BI → Azure SQL)
- Data will stream from various authenticated sources to the Azure IoT Hub. The IoT Hub is a collection of data center processes and services listening and responding to incoming events.
- The IoT hub will route qualified streams to the Stream Analytics engine. Here, data will quickly be analyzed in real time as fast as data is capable of being ingested.
- Data can be marshalled to business intelligence services and stored for long persistence in an Azure SQL databaseand/or moved to a service bus.
- The service bus responds to events and faults in the form of queues to allow the system to respond to them.
- The final component is the cloud "glue" layers which route data to the IoT device (Logic App Dynamics to Azure) or respond to incoming data (Logic App Azure to Dynamics).
- Microsoft Dynamics 365 interfaces as a logic app and allows for visibility of IoT events, creation of dashboards, web frameworks, and even mobile and smartphone alerting.
5. Software Architectures for Wearable Devices
The software structure of the wearable device must be compatible with the hardware chosen — tools, operating systems, device drivers, and libraries compatible with the architecture and peripherals used.
- The wearable device is based on the STM32WB microcontroller which is designed as a dual core; essentially two systems to manage:
- the higher performance ARM M4 core that runs the specific wearable firmware,
- the lower-power ARM M0 core that manages the I/O across Bluetooth.
- A commercial real-time operating system such as ThreadX by Express Logic was chosen to allow for a modern development experience rather than a simple control loop which is not appropriate for this product.
H1 (Diagram: ARM M4 Core [Application Firmware: Display Thread / Audio Thread / IO Thread ↔ Communication Thread ↔ BLE Host Stack: GATT/GAP / SMP / L2CAP / HostCtl; Kernel Layer: I2C/SPI/LCD/GPIO/Audio Drivers → Express Logic ThreadX RTOS] and ARM M0 Core [M0 Firmware Package → HostCtl Interface → Link Layer → BT MAC → HCL Layer])
- The M4 core handles the operating system and two processes.
- A process (many threads within) hosts the application firmware to manage the wearable display, the speaker and microphone hardware, I/O to the heartbeat and movement sensors, and the Bluetooth stack.
- The M0 core manages hardware layers of the Bluetooth radio.
6. Software Architectures for Edge Computers
The edge computer has more processing resources as it must provide for a full TCP/IP stack, PAN and WAN communication and routing, encryption services, storage services, device provisioning, and failsafe firmware upgrades.
- For the edge system, a Linux Debian-variant system was chosen as it provides more features and services than a tightly embedded RTOS.
H1 (Diagram: Edge Software Stack — Rules Engine on top; below it: Encryption Service, Storage Service, Bluetooth 5 Stack, Cellular LAN Stack, MQTT Library, Auth, Power Mgmt Interface, Network Stack; below that: Debian Linux OS; bottom: Preboot - Bootloader)
- Coordination with the cloud system and all services on the edge computer or on the wearable are coordinated through the "rules engine." The rules engine could be a simple "expert system" using custom logic for this customer or use case.
- A more robust design may use a standardized framework like Drools. Since each patient may need to have a different set of rules, it makes sense to use a dynamic and fungible rule engine that can be uploaded with different patient directives.
- This is an autonomous top-level supervisor that periodically captures health data, addresses security issues, releases new firmware updates reliably, manages authentication and security, and handles a significant number of error and failure conditions.
- The rules engine must be autonomous to satisfy the product requirement of the system working without direct control via the cloud.
7. Edge Services and Cloud Services
Edge and Cloud devices provide different services.
- Edge services include:
- Low-latency and real-time reactions to events
- PAN communication to sensors
- Minimum connectivity requirements
- Cloud services include:
- Data ingestion and management for multiple edge patients and systems
- Almost unlimited storage capacity
- A controlled software deployment and updates to edge
Use Case Retrospective
What this brief introductory use case shows is that IoT and edge computing requirements for enterprise and commercial designs involve many disciplines, technologies, and considerations. The design involves many interoperable components that comprise a system. It is essential that an architect responsible for an IoT system should be knowledgeable to some level of these system components:
- Hardware design
- Power management and battery design
- Embedded systems design and programming
- Communication systems, radio signaling, protocol usage, and communication economics
- Network stacks and protocols
- Security, provisioning, authentication, and trusted platforms
- Performance analysis and system partitioning
- Cloud management, streaming systems, cloud storage systems, and cloud economics
- Data analytics, data management, and data science
- Middleware and device management
Questions?
Linked from
- Lecture 2 - Protocol Architectures
- Lecture 7 - Network Layer (Part 1)
- Chapter 14 - Edge Computing and Fog Computing
- Lecture 1 - Introduction to IoT
- Lecture 3 - Introduction to ESP32
- Lecture 4 - ESP32 – Multitasking and Deep Sleep
- Lecture 5 - Web Servers and Clients
- Lecture 6 - MQTT Clients
- Lecture 9 - Network Forensics
- Lecture 2