2. IoT Architecture, Devices and ConnectivityIntroduction and ContextThe Internet of Things (IoT) is not merely a collection of internet-connected devices. It is a distributed technical system in which physical objects sense conditions, communicate observations, perform local or remote computation, and sometimes initiate actions. IoT analytics depends on the quality and structure of this system. If sensors are poorly selected, connectivity is unreliable, device clocks are inconsistent, or gateways discard important context, even sophisticated analytical models will produce weak results. An IoT solution therefore has to be understood as an architecture rather than as an isolated device. The architecture connects the physical environment with embedded computation, communication networks, data platforms, analytical services, and business or operational processes. This chapter examines those layers and the design decisions that connect them. Particular attention is given to sensors, actuators, embedded systems, gateways, resource constraints, reference architectures, and communication technologies including MQTT, CoAP, HTTP, LPWAN, 5G, and industrial protocols. A central design principle is that no single connectivity technology or architectural pattern is optimal for every application. A battery-powered soil sensor, a robotic assembly line, a connected vehicle, and a hospital monitoring system have different requirements for latency, bandwidth, reliability, safety, energy consumption, privacy, and manageability. IoT engineering is consequently an exercise in matching requirements to architectural and communication choices. Learning ObjectivesBy the end of this chapter, students should be able to: 1. Explain the roles of sensors, actuators, embedded systems, gateways, networks, platforms, and applications in an IoT architecture. 2. Distinguish physical, device, edge, network, platform, and application layers. 3. Analyse device constraints involving energy, processing, memory, connectivity, timing, security, and physical environment. 4. Compare MQTT, CoAP, HTTP, LPWAN, 5G, and selected industrial protocols. 5. Select an appropriate communication and deployment architecture for a stated IoT scenario. 6. Evaluate reliability, security, governance, and operational issues in IoT systems. 7. Interpret how architectural choices influence the quality and cost of IoT analytics. From Physical Phenomenon to Analytical ActionAn IoT system begins with a physical phenomenon such as temperature, vibration, pressure, location, light, chemical concentration, or human movement. A sensor converts a property of that phenomenon into an electrical or digital representation. The measurement is sampled, possibly filtered, time-stamped, calibrated, and transmitted. Software then interprets the measurement and may combine it with device identity, location, operating state, and historical context. An actuator performs the reverse operational function. It receives a command and changes a physical condition: a valve opens, a motor changes speed, a relay switches, or a lock engages. Sensors support observation; actuators support intervention. Many systems contain both, creating a closed loop in which sensing informs decisions and decisions alter the environment. The distinction between a sensor and a transducer is useful. A transducer converts one form of energy into another, while a sensor is generally understood as a transducer used to detect or measure a physical quantity. A temperature sensor may produce an analogue voltage, a resistance change, or a digital data word. The measurement is not automatically meaningful: calibration, accuracy, resolution, range, response time, drift, noise, and sampling frequency determine its analytical usefulness. Actuators also have operating characteristics. Important properties include force or torque, travel range, response time, precision, power demand, duty cycle, and failure mode. A control application must account for the difference between issuing a command and achieving the intended physical result. Feedback from another sensor may be necessary to verify that an actuator has operated successfully. Embedded Systems and DevicesAn embedded system combines hardware and software for a defined function. It normally includes a microcontroller or processor, memory, input/output interfaces, a power supply, firmware, and communication capability. Firmware controls sampling, local calculations, protocol handling, fault detection, and sometimes secure boot or device updates. Devices vary substantially in capability. A simple sensor node may measure one variable and transmit a compact message. A more capable edge computer may run a Linux operating system, containerised applications, data buffering, computer vision, and machine-learning inference. The term “smart device” should therefore be used carefully: intelligence may refer to local computation, adaptive behaviour, connectivity, or merely the ability to report data. Device identity is foundational. A device should have a unique, managed identity, credentials, configuration, software version, ownership relationship, and lifecycle status. An identifier alone is not authentication. Secure identity normally requires cryptographic keys or certificates, protected storage, and a process for provisioning, renewal, revocation, and decommissioning. Gateways and Edge NodesA gateway connects devices or local networks to wider networks and services. It may translate protocols, aggregate messages, buffer data during outages, enforce access control, compress or filter observations, and provide a management boundary. For example, a gateway can collect data from industrial fieldbus devices and publish selected observations through MQTT over an IP network. An edge node is a broader concept. It is a computational resource located near the data source, possibly within a gateway, device, factory, vehicle, or telecommunications network. Edge computing reduces the need to transmit every raw observation to a central cloud. It can support low-latency control, local privacy, bandwidth reduction, and continued operation during disconnection. However, edge deployment increases the number of systems that must be secured, monitored, updated, and maintained. A gateway is not always required. IP-capable devices may communicate directly with a cloud or enterprise service. Conversely, gateways are essential where field devices use non-IP protocols, have limited security capabilities, require local coordination, or operate in a constrained network. The architectural question is not whether gateways are fashionable, but whether their functions justify their cost and operational complexity. A Reference Architecture for IoT AnalyticsA practical reference architecture can be represented through six interacting zones: 1. Physical and sensing zone: Sensors, actuators, machines, people, and the surrounding environment. 2. Device and embedded zone: Microcontrollers, firmware, local storage, device drivers, and real-time functions. 3. Edge and gateway zone: Protocol translation, aggregation, local analytics, buffering, filtering, and control coordination. 4. Connectivity zone: Personal-area, local-area, wide-area, cellular, industrial, and internet networks. 5. IoT platform and data zone: Message brokers, device registries, digital representations, time-series storage, stream processing, APIs, and analytical pipelines. 6. Application and governance zone: Dashboards, alerts, enterprise systems, control applications, identity management, audit, compliance, and business processes. These zones are logical rather than necessarily physical. A function may be placed in different locations depending on latency, cost, privacy, and reliability requirements. A vibration anomaly detector might run on a machine controller when milliseconds matter, at a factory gateway when local aggregation is sufficient, or in the cloud when large-scale model training is required. The architecture should also be viewed as a set of planes. The data plane carries measurements and commands. The control plane manages configuration, routing, access, and policies. The management plane supports provisioning, monitoring, diagnostics, updates, inventory, and retirement. Neglecting the latter planes creates systems that work in demonstrations but fail at operational scale. A useful data path is: measurement, local validation, encoding, transmission, ingestion, storage, transformation, analysis, decision, command, actuation, and feedback. At each transition, metadata should preserve meaning. A value such as “72” is analytically weak unless its unit, variable, location, device identity, timestamp, calibration status, and quality indicator are known. Architectural StylesIn a cloud-centric architecture, devices send data to central services where storage and analysis are concentrated. This simplifies central governance and supports large-scale analytics, but depends heavily on connectivity and may create latency or privacy concerns. In an edge-centric architecture, computation and decision-making are distributed near devices. This supports rapid response and local autonomy, but requires stronger edge management and may fragment data and models. A hybrid architecture combines the two. Local systems perform filtering, control, and urgent inference, while central platforms provide fleet management, historical storage, cross-site analysis, model training, and business integration. Hybrid designs are common because IoT workloads have both immediate operational and long-term analytical requirements. Device Constraints and Design Trade-offsIoT devices are constrained systems. Processing power and memory may be insufficient for complex encryption, large software libraries, or machine-learning models. Energy may be supplied by a small battery, energy harvesting, or an intermittent source. Radio transmission often consumes more energy than local computation, making sampling and communication schedules important design variables. Connectivity may be intermittent, expensive, low-bandwidth, or unavailable inside industrial structures. Devices must therefore tolerate disconnection through local buffering, retry policies, sequence numbers, and idempotent commands. A retry without careful design can duplicate an action such as opening a valve. Time is another constraint. Applications may require precise synchronisation, bounded latency, or deterministic delivery rather than merely average network performance. The physical environment introduces temperature extremes, moisture, vibration, electromagnetic interference, dust, corrosion, and physical access limitations. A device designed for an office cannot automatically be deployed in a mine or chemical plant. Enclosures, ingress protection, intrinsic safety, redundancy, and maintenance access must be considered. Security competes with constraints but cannot be treated as optional. Minimum controls include unique identity, authenticated communication, access control, secure configuration, protected credentials, signed updates, logging, and a plan for vulnerability response. Devices should expose as little network functionality as possible and should fail safely. A security design must address both the device and its supporting cloud, gateway, mobile, and enterprise components. The main trade-offs include: - Higher sampling frequency improves temporal detail but increases energy use, storage, and network traffic.
- Stronger local processing reduces bandwidth and latency but requires more capable and costly hardware.
- Long battery life may require delayed transmission, reduced radio power, or event-driven sensing.
- Greater redundancy improves availability but increases installation and maintenance costs.
- Open interoperability reduces dependence on one vendor but may require more integration effort.
Communication Technologies and Protocol ChoicesCommunication selection should begin with requirements rather than brand preference. Relevant dimensions include range, throughput, latency, reliability, mobility, energy consumption, spectrum, topology, security, device density, cost, and regulatory conditions. MQTTMQTT is a lightweight publish–subscribe messaging protocol widely used in IoT. Devices publish messages to topics, and subscribers receive messages through a broker. Publishers and subscribers do not need direct knowledge of each other, which supports decoupling and scalable event distribution. MQTT includes quality-of-service levels. At most once offers minimal overhead and no delivery guarantee; at least once can deliver duplicates; exactly once provides stronger semantics with greater protocol overhead. Retained messages can provide the latest known value to a new subscriber, while a last-will message can indicate an unexpected disconnection. MQTT is appropriate for telemetry, event notification, and command distribution, especially where devices maintain a connection to a broker. It is not, by itself, a complete security architecture; TLS, authentication, authorisation, topic design, and broker governance remain necessary. CoAPThe Constrained Application Protocol is designed for resource-constrained devices and commonly follows a REST-like request–response model. It typically operates over UDP and supports methods such as GET, POST, PUT, and DELETE. CoAP can be efficient for small devices and can support confirmable messages, multicast, and proxying. DTLS or object-security mechanisms may protect communication. CoAP is useful when constrained devices need resource-oriented interaction without the overhead of conventional HTTP. HTTPHTTP is widely understood, supported by browsers, APIs, proxies, cloud services, and enterprise infrastructure. It is therefore convenient for device registration, configuration, data ingestion, and integration. Its comparatively larger overhead and connection behaviour may be unsuitable for very constrained or battery-powered nodes, although persistent connections, compression, and suitable implementation can reduce the cost. HTTP is often used between gateways and cloud services even when field devices use another protocol. MQTT, CoAP, and HTTP are application-layer protocols; they do not replace the underlying network. A design may use CoAP over a constrained link, MQTT over TCP and TLS, or HTTP over a cellular or Ethernet connection. LPWANLow-Power Wide-Area Network technologies support long-range communication with low energy consumption and small payloads. They are suitable for dispersed sensors that transmit infrequently, such as utility meters, environmental monitors, and agricultural devices. Important design limitations include low throughput, message-size restrictions, duty-cycle or spectrum rules, variable latency, and limited suitability for continuous data or closed-loop control. LPWAN solutions may use licensed cellular spectrum or unlicensed technologies such as LoRaWAN. The precise security, network architecture, coverage, and service model depend on the technology. LPWAN is attractive when battery life and coverage matter more than bandwidth, but a system designer must evaluate gateway coverage, downlink constraints, regional regulation, device density, and the cost of network operation. 5G and Cellular Connectivity5G provides high capacity, mobility, and the potential for low latency and differentiated service characteristics. It can support connected vehicles, industrial automation, video analytics, and dense device deployments. Features such as private networks, network slicing, and edge integration may help organisations align connectivity with operational requirements, although actual performance depends on deployment, spectrum, network configuration, and application design. Cellular connectivity generally offers managed coverage and strong security mechanisms, but subscription costs, power consumption, indoor coverage, and dependence on an operator must be assessed. A 5G label does not guarantee deterministic control performance; critical industrial systems may still require local wired or industrial networks. Industrial ProtocolsIndustrial environments commonly contain protocols developed for reliable machine communication. Modbus is simple and widely deployed, but older forms provide limited native security. OPC UA offers structured information modelling, interoperability, and security features and is used for machine-to-machine and industrial integration. PROFINET, EtherNet/IP, CAN, and related technologies address different automation and field communication requirements. Industrial protocol selection involves more than bandwidth. Determinism, timing, safety certification, device interoperability, legacy integration, fault behaviour, and engineering tools are central. A gateway may translate an industrial protocol into MQTT or another cloud-facing protocol, but translation must preserve units, quality codes, timestamps, command semantics, and alarms. Blindly exposing an industrial network to the internet is unsafe; segmentation and controlled interfaces are essential. Applied Scenario: Predictive Maintenance in a Food-Processing PlantBackgroundConsider an illustrative food-processing plant with motors, pumps, compressors, and conveyor systems. Unexpected motor failure interrupts production and can cause product loss. The plant wants to detect abnormal vibration and temperature before failure while retaining safe local control. Situation and ProblemExisting machines use industrial controllers and wired protocols. Some older assets expose only Modbus measurements. The plant has reliable local Ethernet but inconsistent wireless coverage near metal processing equipment. Engineers need alerts within seconds, while management wants monthly analysis across several sites. Devices must meet hygiene and electrical-safety requirements. AnalysisContinuous raw vibration streaming to a distant cloud would consume substantial bandwidth and create dependence on external connectivity. Conversely, analysing everything only at each machine would make cross-site comparison and model improvement difficult. The system therefore requires a hybrid architecture. Sensors measure vibration, temperature, motor current, and rotational speed. An edge gateway collects data from industrial controllers and new sensor nodes. It validates ranges, aligns timestamps, computes features such as root-mean-square vibration and frequency-band energy, and stores data during network outages. A local anomaly detector generates an alert when a machine deviates from its baseline. Approach and SolutionThe plant uses an industrial network for time-sensitive machine communication. The gateway publishes selected telemetry and alerts through MQTT over a secured connection to a central broker. HTTP APIs integrate maintenance records and work orders. Raw high-frequency data is retained locally for a limited period, while features, alarms, and representative samples are stored centrally. Each asset has a managed identity and metadata describing location, motor type, sensor position, units, calibration date, and firmware version. Commands are restricted: the analytics platform may request a diagnostic test, but safety-critical shutdown remains under the plant control system. The gateway uses store-and-forward behaviour, sequence numbers, duplicate protection, and health monitoring. OutcomeThe architecture reduces unnecessary network traffic while preserving rapid local response and enabling fleet-level analytics. Maintenance teams receive contextual alerts rather than isolated threshold violations. The design also exposes important non-technical requirements: sensor mounting quality, calibration, operator acceptance, maintenance workflow integration, and the need to distinguish a genuine fault from a loose sensor. Learning PointsThe case illustrates that protocol choice follows operational requirements. MQTT is useful for decoupled telemetry distribution, but it does not replace industrial control. Edge analytics supports latency and resilience, while central analytics supports comparison and model governance. Most importantly, analytical performance depends on metadata, data quality, asset context, and the connection between predictions and maintenance action. Risks, Governance, and Professional PracticeIoT systems enlarge the attack surface because they include physical devices, radios, gateways, brokers, cloud platforms, applications, and people. Common weaknesses include default passwords, unencrypted communication, excessive privileges, insecure update mechanisms, exposed debug interfaces, poor certificate management, and devices that remain active after ownership changes. Privacy requires special attention when devices monitor people, homes, workplaces, movement, health, or consumption. Organisations should define purpose, minimise collection, restrict access, retain data only as necessary, and communicate monitoring practices transparently. Aggregated data may still enable re-identification when combined with location or time information. Governance should assign responsibility for device ownership, data stewardship, incident response, software updates, supplier risk, retention, and retirement. Regulatory obligations may arise from data protection, workplace safety, radio spectrum, medical devices, critical infrastructure, or industrial safety. Compliance should be treated as part of system design rather than as documentation added after deployment. Common implementation mistakes include selecting a protocol before defining requirements, assuming network availability, ignoring time synchronisation, treating telemetry as self-describing, deploying untested firmware updates, storing unlimited raw data, and failing to design for device retirement. Another error is confusing a dashboard demonstration with an operationally reliable system. Production IoT requires observability, test environments, rollback procedures, spare devices, documented ownership, and measurable service levels. Current DevelopmentsIoT architectures increasingly incorporate edge AI, where compact models perform classification or anomaly detection near the device. Federated learning and privacy-preserving methods may reduce the need to centralise sensitive raw data, although they introduce challenges in model coordination, data heterogeneity, and validation. Digital twins provide software representations of assets, processes, and relationships. Their value depends on accurate identity, state, history, and semantics; a three-dimensional visualisation alone is not necessarily a digital twin. Interoperability initiatives increasingly emphasise common information models, semantic metadata, and standard APIs. Modern deployments also use zero-trust principles, automated device provisioning, software bills of materials, remote attestation, containerised edge applications, and observability platforms. These developments improve manageability but increase dependence on lifecycle automation and skilled operations teams. The long-term direction is toward composable, policy-driven architectures in which data, computation, and control can be placed dynamically across device, edge, and cloud locations. Best-Practice Design PrinciplesA sound IoT architecture should: - Begin with measurable functional, performance, safety, security, and governance requirements.
- Select sensors according to accuracy, calibration, environment, sampling needs, and maintenance conditions.
- Use unique identities, least privilege, encryption, secure updates, and planned credential rotation.
- Preserve metadata, units, timestamps, quality indicators, and provenance throughout the data lifecycle.
- Design for intermittent connectivity through buffering, retries, ordering, and duplicate-safe operations.
- Place computation at the edge when latency, privacy, resilience, or bandwidth justify it.
- Separate safety-critical control from non-critical analytics and external commands.
- Prefer open interfaces and documented information models where interoperability matters.
- Monitor device health, network quality, data quality, security events, and model performance.
- Plan the complete lifecycle from procurement and provisioning to maintenance, ownership transfer, and secure retirement.
Chapter SummaryIoT analytics is built upon an architecture linking physical phenomena, sensors, actuators, embedded systems, gateways, networks, platforms, and applications. Sensors transform physical conditions into measurements, while actuators convert decisions into physical effects. Embedded devices operate under constraints involving energy, memory, processing, connectivity, timing, environment, and security. A layered and plane-based reference architecture helps locate functions and clarify responsibilities. Cloud-centric, edge-centric, and hybrid designs offer different balances of latency, resilience, cost, privacy, and manageability. MQTT supports brokered publish–subscribe messaging; CoAP supports resource-oriented interaction for constrained devices; HTTP offers broad integration; LPWAN favours long-range, low-energy, low-volume communication; 5G supports mobility and high-capacity connectivity; and industrial protocols address machine interoperability, timing, and control requirements. Effective design is requirement-driven. It must preserve data meaning, manage device identity, tolerate failures, protect people and infrastructure, and connect analytical outputs to operational decisions. The most successful IoT systems are therefore not defined by connectivity alone, but by disciplined architecture and lifecycle governance. Key TermsSensor: A device or component that detects and measures a physical property. Actuator: A device that converts a control command into a physical action. Embedded system: Hardware and software designed for a specific operational function. Gateway: A system that connects local devices or networks to another network or service. Edge computing: Processing data near its source rather than exclusively in a central cloud. Telemetry: Automated measurement and transmission of operational data. MQTT: A lightweight publish–subscribe messaging protocol using a broker and topics. CoAP: A constrained, REST-like application protocol commonly designed for resource-limited devices. HTTP: A widely used request–response protocol for web and application integration. LPWAN: Low-Power Wide-Area Network technology designed for long-range, low-energy communication. 5G: A generation of cellular networking supporting high capacity, mobility, and advanced service possibilities. Industrial protocol: A communication protocol designed for machine, automation, or process environments. Quality of service: Rules or guarantees concerning message delivery, reliability, or performance. Digital twin: A software representation of a physical asset or process connected to relevant data. Device identity: A unique and managed cryptographic or logical representation of a device. Store-and-forward: Buffering data locally until a network connection becomes available. Interoperability: The ability of different systems to exchange and meaningfully use information. Determinism: The ability of a system to provide predictable timing and behaviour. Device lifecycle: The stages from provisioning and operation through maintenance and secure retirement. Review QuestionsShort Answer Questions1. What is the functional difference between a sensor and an actuator? 2. Why is a gateway used in an IoT architecture? 3. Define edge computing and identify one reason for using it. 4. What is the publish–subscribe model used by MQTT? 5. State two constraints commonly experienced by IoT devices. Long Answer Questions1. Explain the six logical zones of an IoT reference architecture and show how they support analytics. 2. Compare MQTT, CoAP, and HTTP in terms of interaction model, resource requirements, and typical use. 3. Discuss how energy, connectivity, timing, security, and environmental conditions influence device design. 4. Explain the differences between cloud-centric, edge-centric, and hybrid IoT architectures. 5. Analyse the role of industrial protocols and gateways in connecting legacy operational technology to IoT platforms. Analytical / Application Questions1. A rural environmental-monitoring project needs battery life of several years, small messages, and coverage across widely dispersed locations. Which connectivity approach would you recommend, and what limitations must be assessed? 2. A factory requires millisecond-level local control but also wants centralised predictive-maintenance analytics. Design an architecture and justify the placement of sensing, control, edge processing, and cloud services. 3. An organisation plans to publish all device data directly to a cloud platform using HTTP. Critically evaluate this decision for a large fleet of battery-powered devices and propose a more suitable alternative where appropriate. 22. Multiple Choice Questions with AnswersQuestion 1A factory needs local anomaly detection during intermittent internet connectivity while sending summaries to a central platform. Which architecture is most appropriate? A. Cloud-centric architecture with no local storage B. Hybrid architecture with edge processing and central analytics C. HTTP-only architecture with all processing on devices D. LPWAN architecture used for closed-loop machine control Correct Answer: B. Hybrid architecture with edge processing and central analytics Question 2Which MQTT feature allows a broker to distribute a message to multiple interested applications without the publisher knowing them directly? A. Publish–subscribe communication B. Industrial determinism C. Sensor calibration D. Store-and-forward control Correct Answer: A. Publish–subscribe communication Question 3A battery-powered sensor sends small measurements from widely dispersed agricultural fields at infrequent intervals. Which option best matches these requirements? A. Continuous high-bandwidth 5G video B. LPWAN connectivity C. A wired industrial fieldbus only D. High-frequency HTTP streaming Correct Answer: B. LPWAN connectivity Question 4What is the main risk of using at-least-once MQTT delivery for an actuator command? A. The command can never reach the broker B. The message cannot contain metadata C. Duplicate delivery may cause repeated action D. The device must use optical communication Correct Answer: C. Duplicate delivery may cause repeated action Question 5Which information is most important for interpreting a telemetry value such as “72” correctly? A. Only the device’s colour and model name B. Unit, timestamp, variable identity, location, and quality information C. The number of subscribers to the broker D. The physical size of the gateway Correct Answer: B. Unit, timestamp, variable identity, location, and quality information Question 6Why might CoAP be selected instead of HTTP for a highly constrained device? A. CoAP is designed for resource-constrained communication with lower overhead B. CoAP requires a large web browser on every sensor C. CoAP guarantees unlimited bandwidth D. CoAP is exclusively an industrial safety protocol Correct Answer: A. CoAP is designed for resource-constrained communication with lower overhead Question 7Which statement best describes the role of a gateway? A. It necessarily replaces every sensor in the system B. It may aggregate data, translate protocols, buffer messages, and enforce local policies C. It guarantees that all physical measurements are accurate D. It is only a visual dashboard for managers Correct Answer: B. It may aggregate data, translate protocols, buffer messages, and enforce local policies Question 8A plant wants central predictive maintenance but does not want safety-critical shutdown commands controlled by a cloud application. Which design principle applies? A. Place all control in the public cloud B. Separate safety-critical local control from non-critical analytics C. Remove feedback sensors from the machines D. Use unencrypted industrial protocols over the internet Correct Answer: B. Separate safety-critical local control from non-critical analytics Question 9Which factor is especially important when choosing an industrial communication protocol for automation? A. The colour of the user interface B. Deterministic timing, fault behaviour, and interoperability C. The number of social-media users D. Whether the device supports office printing Correct Answer: B. Deterministic timing, fault behaviour, and interoperability Question 10Which practice most directly supports secure IoT device lifecycle management? A. Using one shared password for the entire fleet B. Leaving devices active after ownership transfer C. Using unique identities, protected credentials, signed updates, and secure retirement D. Disabling all logging to reduce storage use Correct Answer: C. Using unique identities, protected credentials, signed updates, and secure retirement
|