IoT Architecture & Protocols

Chapter 3
Things, Sensors, Actuators and Embedded Systems

Diploma in IOT
IoT Architecture & Protocols   •   Diploma

Things, Sensors, Actuators and Embedded Systems

Introduction

The physical world becomes observable and controllable in an Internet of Things (IoT) system through a chain of devices. A sensor measures a physical condition, an embedded system processes the measurement, a communication interface transfers information, and an actuator produces a physical response. Gateways connect local devices to wider networks, while identification technologies provide the identity needed to associate data with the correct object, location or process.

A competent IoT designer must therefore select more than a sensor with a suitable measurement range. The designer must consider accuracy, resolution, repeatability, calibration, response time, sampling rate, interface compatibility, power consumption, environmental conditions, security, cost and maintainability. These decisions are interdependent. A highly accurate sensor may be unsuitable if it consumes excessive energy, requires complex calibration or cannot operate in the required temperature range.

This chapter develops the foundations required to select and integrate things, sensors, actuators, microcontrollers, gateways and identification technologies in constrained IoT environments.

Learning Objectives

After studying this chapter, a learner should be able to:

  1. Explain the roles of things, sensors, actuators, embedded systems and gateways in an IoT architecture.
  2. Classify sensors and actuators according to their operating principles and applications.
  3. Interpret range, resolution, sensitivity, accuracy, precision, repeatability, hysteresis and response time.
  4. Select an appropriate sampling rate and explain aliasing.
  5. Compare analogue, digital and common serial interfaces.
  6. Estimate energy use and battery life under stated assumptions.
  7. Select a microcontroller, gateway and identification technology for a practical IoT application.
  8. Explain calibration, reliability, security, privacy and safety requirements for constrained devices.

1. Things and the Physical Layer of IoT

A thing is a physical or logical entity that can be identified and represented in an IoT system. Examples include a motor, a water tank, a wearable device, a vehicle, a room, a crop field or a medical instrument. A thing may contain sensors, actuators, processing capability and communication capability, or it may be represented by a separate device attached to it.

The physical layer is concerned with interaction with the real world. It includes:

  • Sensors, which convert physical quantities into electrical signals or digital data.
  • Signal-conditioning circuits, which amplify, filter, isolate or linearise sensor signals.
  • Microcontrollers, which execute firmware and make local decisions.
  • Actuators, which convert electrical commands into physical action.
  • Power systems, including batteries, regulators, energy harvesters and charging circuits.
  • Communication interfaces, such as GPIO, UART, I²C, SPI, CAN, Ethernet, Wi-Fi, Bluetooth Low Energy, LoRaWAN and cellular radio.
  • Identification technologies, such as barcodes, QR codes, RFID, NFC, electronic product codes and device certificates.

A useful model is a closed control and information loop: the sensor observes a condition, the controller compares the measurement with a desired state, and the actuator changes the physical process. Communication with a gateway or cloud service may support monitoring, configuration and long-term analysis, but local control should often remain possible when connectivity is interrupted.

IoT physical device and gateway architecture Physical processtemperature, motion,pressure or flow Sensorsmeasure and condition Actuatorsproduce physical action MCU / embeddedprocessing, control,power management GatewayWAN /cloud
IoT physical device and gateway architecture
Figure: IoT physical device and gateway architecture

Figure: A typical IoT device combines sensing, local processing, actuation and gateway connectivity.

2. Sensors and Measurement Principles

A sensor detects a measurand—the physical quantity being measured—and produces a corresponding output. Temperature sensors, for example, may use resistance change, semiconductor junction behaviour or thermoelectric voltage. Motion sensors may use acceleration, gyroscopic rotation, infrared radiation or radar reflection.

2.1 Sensor classifications

Sensors may be classified in several useful ways:

ClassificationExamplesDesign implication
Analogue outputThermistor, strain gauge, microphoneRequires signal conditioning and ADC
Digital outputDigital temperature sensor, accelerometerSimplifies noise handling and data transfer
ContactLimit switch, contact thermometerMay disturb the measured object
Non-contactInfrared thermometer, ultrasonic sensorUseful for moving, hazardous or inaccessible objects
PassiveResistive sensor, thermocoupleUsually needs excitation or amplification
ActiveRadar, ultrasonic range sensorConsumes power to generate a stimulus
InertialAccelerometer, gyroscopeMeasures motion and orientation-related variables
EnvironmentalHumidity, pressure, gas, lightOften affected by temperature and contamination

The classification does not determine quality. A digital sensor can still have poor accuracy, and an analogue sensor can be highly precise when properly conditioned.

2.2 Important measurement characteristics

Range is the interval over which a sensor is specified to operate, such as 0–100 °C or 0–10 bar. Measurements outside the range may be invalid or may damage the sensor.

Resolution is the smallest discernible change. For an n-bit ideal ADC with reference voltage Vref, the voltage step is approximately:

q = Vref / 2n

Here, q is the quantisation step in volts, Vref is the ADC reference voltage in volts, and n is the number of bits. This ideal expression assumes a uniform ADC and does not include noise, offset, gain error or non-linearity. The practical effective resolution may be lower.

Sensitivity is the change in output per unit change in input. If a temperature sensor produces 10 mV per °C, its sensitivity is 10 mV/°C. Sensitivity is not the same as accuracy.

Accuracy describes closeness to the true or accepted value. Precision describes the consistency of repeated measurements. A sensor may be precise but inaccurate if it has a calibration offset.

Repeatability is agreement among measurements under the same conditions. Reproducibility concerns agreement when conditions such as operator, instrument or location change.

Offset error is a constant displacement from the ideal output. Gain error is an error in the slope of the response. Non-linearity is deviation from the ideal straight-line relationship. Hysteresis occurs when output depends on whether the input is increasing or decreasing.

Response time describes how quickly the sensor reacts to a change. A common specification is the time required to reach 63.2% of a final step response for a first-order sensor. This percentage follows the first-order model and should not be assumed for every sensor.

For a first-order response:

y(t) = yf + [y(0) − yf]e^(−t/τ)

where y(t) is output at time t, yf is the final output, y(0) is the initial output and τ is the time constant. At t = τ, the output has completed approximately 63.2% of the total change. The model is applicable when the sensor dynamics are adequately approximated by a single first-order system.

2.3 Calibration

Calibration compares an instrument with a traceable reference and establishes a correction or confirms compliance with a tolerance. A simple linear correction can be written as:

ycorrected = a ymeasured + b

where a is a gain correction, b is an offset correction, and all quantities must use consistent units. Calibration should document the reference, environmental conditions, date, uncertainty, correction values and acceptance criteria.

Calibration may be performed at one point, two points or several points. Two-point calibration can correct offset and gain for an approximately linear sensor, but it cannot reliably correct strong non-linearity. Field calibration is valuable because installation, cable resistance, enclosure heating and environmental exposure can alter performance.

2.4 Sampling and aliasing

A microcontroller usually observes a continuous physical signal at discrete times. If the highest meaningful signal frequency is fmax, ideal sampling requires:

fs > 2 fmax

This is the Nyquist condition for avoiding spectral overlap in an ideal band-limited signal. fs is the sampling frequency in hertz. In practice, designers use margin and an analogue anti-aliasing low-pass filter because real signals contain noise and frequencies above the intended band.

If a signal is sampled too slowly, aliasing causes a high-frequency component to appear as a false lower-frequency component. Increasing the sampling rate alone may not be sufficient if unwanted frequencies enter the ADC; filtering before sampling is also required.

Sampling must also reflect the physical process. A room temperature sensor may need one sample every few seconds, whereas vibration monitoring may require thousands of samples per second. Excessive sampling wastes energy, memory and communication bandwidth; insufficient sampling loses information.

3. Actuators and Physical Control

An actuator converts an electrical command into a physical effect. Examples include motors, solenoid valves, relays, heaters, pumps, speakers, LEDs and piezoelectric elements.

Actuator selection depends on force or torque, speed, travel, duty cycle, response time, operating voltage, current, heat dissipation, noise, mechanical wear and fail-safe behaviour. The microcontroller normally cannot drive a high-current actuator directly. A transistor, MOSFET, motor driver, relay driver, optocoupler or dedicated controller may be required.

Inductive loads such as relay coils and motors can generate a voltage spike when current is interrupted. A flyback diode or an appropriate transient suppression device is commonly used for DC coils. Power switching must also respect voltage, current, thermal and electromagnetic compatibility limits.

Actuators may be:

  • Binary, such as an on/off valve or relay.
  • Proportional, such as a variable-speed motor or modulating valve.
  • Continuous-position, such as a servo motor.
  • Energy-output devices, such as heaters, lamps and pumps.

A safety-critical actuator should have a defined safe state. For example, a valve may be designed to close when power is lost, or a motor may require a hardware emergency-stop circuit independent of software.

4. Embedded Systems and Microcontrollers

An embedded system is a computer designed as part of a larger product or process. A microcontroller unit (MCU) normally integrates a processor core, memory, timers, GPIO, ADCs, communication peripherals and power-management features on one chip.

A microcontroller differs from a general-purpose computer in its close relationship with hardware, predictable real-time behaviour, lower power consumption and more limited resources. Important selection criteria include:

  • processor performance and clock frequency;
  • flash, RAM and non-volatile data memory;
  • number and resolution of ADC channels;
  • timers, PWM channels and interrupt capability;
  • GPIO voltage and current limits;
  • interfaces such as UART, SPI, I²C, CAN and USB;
  • sleep modes and wake-up sources;
  • security features such as secure boot, hardware cryptography and protected key storage;
  • development tools, software libraries, documentation and long-term availability.

The MCU should be selected from system requirements rather than processor speed alone. A low-power 32-bit MCU may be preferable to a faster device if the application spends most of its time asleep. Conversely, local signal processing or machine-learning inference may require more RAM, processing capability and energy.

4.1 Interfaces

GPIO provides simple digital input and output. Inputs may read switches, while outputs may control logic-level drivers. Debouncing may be required for mechanical switches.

ADC converts analogue voltage into a digital code. Input range, reference stability, sampling time, source impedance and grounding affect the result.

PWM represents a variable average output using a digital waveform. For an ideal PWM signal, duty cycle is:

D = ton / T

where D is duty cycle, ton is on-time and T is the total period. Duty cycle is dimensionless and is often expressed as a percentage. PWM can control LED brightness or motor power, but the relationship between duty cycle and physical output depends on the load and driver.

UART is an asynchronous serial interface commonly used for point-to-point communication. Baud rate, framing, voltage levels and grounding must be compatible.

I²C uses shared clock and data lines and supports addressed devices. Pull-up resistors and bus capacitance affect signal integrity.

SPI generally provides higher speed than I²C but uses separate chip-select lines and has no universal addressing scheme.

CAN supports robust multi-master communication and message prioritisation, making it useful in vehicles and industrial systems.

Interfaces should be assessed for electrical compatibility as well as protocol compatibility. Logic levels, isolation, cable length, termination, noise and connector protection are practical engineering concerns.

5. Power, Energy and Constrained Devices

IoT nodes are often constrained by battery capacity, memory, processor capability, bandwidth and physical size. Power planning must include sensing, processing, communication, sleep current, leakage, regulator losses and actuator operation.

Electrical power is:

P = V I

where P is power in watts, V is voltage in volts and I is current in amperes. Energy over a time interval is:

E = P t

where E is energy in joules and t is time in seconds. For a device operating in several states, average power is:

Pavg = Σ(Pi ti) / Σti

where Pi is power in state i and ti is the time spent in that state. The expression assumes power is approximately constant within each state.

A battery estimate can be made using average current:

Iavg = Σ(Ii ti) / Σti

and, as a first approximation,

Thours ≈ CAh / Iavg

where CAh is nominal battery capacity in ampere-hours and Thours is operating time in hours. This estimate assumes suitable voltage regulation, constant effective capacity, moderate discharge rate and no significant ageing or temperature effects. Real battery life is usually lower.

Worked example. A node sleeps at 20 µA for 59 seconds, measures at 10 mA for 0.5 seconds and transmits at 80 mA for 0.5 seconds in each 60-second cycle. The average current is:

Iavg = (0.020 mA × 59 s + 10 mA × 0.5 s + 80 mA × 0.5 s) / 60 s

Iavg = (1.18 + 5 + 40) / 60 ≈ 0.770 mA

With a nominal 2.4 Ah battery, the ideal estimate is 2.4 / 0.770 ≈ 3.12 thousand hours, or approximately 130 days. In practice, transmission peaks, regulator losses, battery self-discharge and environmental conditions must be included; a design margin is essential.

Power-saving strategies include deep sleep, event-driven wake-up, adaptive sampling, local data aggregation, compressed messages, efficient antennas, scheduled communication and energy harvesting. However, aggressive sleeping can increase latency and reduce availability. Power design is therefore a system-level trade-off.

6. Gateways and Identification Technologies

A gateway connects local devices using one or more networks to an IP network, enterprise system or cloud service. It may perform protocol translation, data buffering, filtering, device management, security enforcement and local analytics. A gateway is particularly useful when end devices use non-IP technologies, when connectivity is intermittent or when local operation must continue during cloud outages.

Gateway selection should consider radio coverage, number of supported devices, backhaul options, processing capacity, storage, operating temperature, physical security, remote updates and cybersecurity. A gateway can become a single point of failure, so critical applications may require redundancy or local fallback control.

Identification technologies serve different purposes:

TechnologyTypical rangePower requirementCommon use
BarcodeLine of sightPassiveRetail and inventory
QR codeShort optical rangePassiveEquipment identification and links
NFCVery short rangeUsually passive tagAccess, pairing and payments
HF/UHF RFIDCentimetres to several metresPassive or activeLogistics and asset tracking
BLE beaconSeveral metres to tens of metresBattery-poweredProximity and indoor location
Device certificateNetwork-dependentComputational/storage overheadCryptographic identity

An identifier is not automatically an authenticator. A printed serial number identifies an object but does not prove that a message came from that object. Secure IoT systems combine identifiers with cryptographic keys, certificates, access control and secure provisioning. Privacy must also be considered: location or proximity identifiers can reveal personal behaviour if collected without appropriate safeguards.

7. Selecting Components: A Practical Method

A disciplined selection process begins with requirements rather than available components.

  1. Define the measurand and decision. Determine what must be measured, why it matters and what action follows.
  2. Specify operating conditions. Record range, accuracy, response time, environment, mounting method, contamination and maintenance access.
  3. Determine sampling and communication needs. Estimate signal bandwidth, reporting interval, latency, packet size and acceptable data loss.
  4. Select the sensing principle. Compare direct and indirect measurement, contact and non-contact operation, and analogue and digital outputs.
  5. Check interfaces and electrical limits. Confirm voltage, current, pull-ups, ADC range, isolation, connectors and cable characteristics.
  6. Estimate energy and lifetime. Include all operating states, radio peaks, sleep current, conversion losses and temperature effects.
  7. Select processing and gateway capability. Assess memory, local analytics, storage, protocol translation and update mechanisms.
  8. Address safety and security. Define fail-safe behaviour, authentication, encryption, secure boot, logging and physical protection.
  9. Prototype and validate. Test calibration, environmental drift, radio performance, battery life, electromagnetic compatibility and fault recovery.
  10. Document lifecycle requirements. Include component availability, firmware updates, calibration intervals, repairability and disposal.

A component with the lowest purchase price may have the highest total cost if it requires frequent calibration, consumes more energy or becomes unavailable during the product lifetime.

8. Illustrative Case: Cold-Storage Monitoring

Background

A food distributor operates refrigerated rooms. Temperature excursions can spoil products, but the rooms are large, radio signals are obstructed and battery replacement is expensive. The system must alert staff quickly and retain evidence of temperature conditions.

Problem analysis

A suitable sensor must operate across the expected temperature range and provide adequate accuracy near the food-safety limit. A slow sensor may be acceptable for ordinary monitoring but unsuitable if a refrigeration failure must be detected quickly. Condensation, door opening, sensor placement and calibration drift are significant risks.

The node should measure periodically, store recent values locally and transmit summaries and alarms. It must continue logging during a gateway or internet outage. A gateway should serve multiple rooms and provide a backhaul connection to the monitoring service.

Approach and solution

Each room uses two calibrated digital temperature sensors at representative locations. Redundancy helps identify a failed or displaced sensor. An MCU wakes every minute, reads both sensors, checks plausibility and stores the result in non-volatile or protected local memory. It transmits a periodic summary and immediately sends an alarm when a validated threshold is exceeded.

The wireless link is selected after a site survey rather than by nominal range alone. The gateway buffers data during backhaul interruption and synchronises time when connectivity returns. Each device has a unique cryptographic identity, and firmware updates are signed. The enclosure and cable entry are selected for condensation and cleaning conditions.

Outcome

The design reduces communication energy by sending summaries while preserving rapid alarm reporting. Local storage prevents loss of the audit trail. Dual sensors and plausibility checks reduce false alarms, while scheduled calibration provides traceability.

Learning points

The case illustrates that sensor selection is inseparable from placement, calibration, communication, energy, security and operational procedures. A technically accurate sensor can still produce poor decisions if installed near a cooling outlet or if its data cannot be trusted during a network outage.

9. Challenges, Ethics and Governance

IoT devices create risks beyond ordinary measurement error. Incorrect readings can cause unsafe control actions; insecure actuators can create physical hazards; and poorly protected identifiers can expose people or assets.

Important practices include:

  • collect only data necessary for the stated purpose;
  • protect data in transit and at rest;
  • use unique credentials rather than shared default passwords;
  • restrict privileges and authenticate firmware updates;
  • provide secure decommissioning and key revocation;
  • maintain calibration and maintenance records;
  • design for safe failure and manual override;
  • test accessibility and human factors in alarms and controls;
  • follow applicable electrical, radio, machinery, environmental and data-protection regulations.

AI may be used locally for anomaly detection or predictive maintenance, but it does not remove the need for reliable sensing. A machine-learning model trained on biased, poorly calibrated or incomplete data can produce misleading alerts. Operators should understand the basis and limitations of automated decisions, especially where health, safety or essential services are involved.

10. Contemporary Developments and Best Practices

Current IoT designs increasingly use edge computing to reduce latency, bandwidth and cloud dependence. Matter and other higher-level ecosystems seek interoperability, while low-power wide-area networks support long-range, low-data-rate devices. Energy harvesting from light, vibration or thermal gradients can extend battery life, although harvested energy is variable and requires storage and power budgeting.

Best practice is to use modular hardware, documented interfaces, replaceable credentials, secure boot, signed updates, watchdog timers, brownout detection, local buffering and explicit fault states. Measurements should carry metadata such as unit, timestamp, sensor identity, calibration status and quality flag. Data without context is difficult to interpret and dangerous to automate.

Chapter Summary

IoT systems connect physical processes to digital services through things, sensors, embedded controllers, actuators, gateways and identification technologies. Sensors must be evaluated using range, resolution, sensitivity, accuracy, precision, repeatability, response time and calibration requirements. Sampling frequency must reflect the signal bandwidth, and anti-aliasing filtering is important in practical systems.

Actuators require suitable drivers, protection and defined safe states. Microcontroller selection depends on processing, memory, interfaces, security and power requirements rather than clock speed alone. Power calculations use state-based average current or power, but battery-life estimates require realistic margins. Gateways provide protocol translation, buffering, security and local intelligence. Identification establishes association, while authentication requires cryptographic protection.

Successful component selection begins with application requirements and ends with prototype validation, lifecycle planning, safety, security and maintenance. Reliability is a property of the complete system—not of an isolated sensor specification.

Key Terms

Thing: A physical or logical entity represented in an IoT system.

Sensor: A device that detects a measurand and produces a corresponding signal.

Measurand: The physical quantity intended to be measured.

Actuator: A device that converts an electrical command into physical action.

Embedded system: A computer designed as part of a larger product or process.

Microcontroller: An integrated circuit containing a processor, memory and peripheral interfaces.

Gateway: A device that connects local IoT devices to another network or service.

Accuracy: Closeness of a measurement to an accepted true value.

Precision: Consistency among repeated measurements.

Resolution: The smallest distinguishable change in a measurement.

Sensitivity: Output change per unit input change.

Calibration: Comparison with a traceable reference to establish performance or correction.

Sampling: Taking measurements at discrete times.

Aliasing: Misrepresentation caused by insufficient sampling of signal frequency content.

ADC: Analogue-to-digital converter.

PWM: Pulse-width modulation used to control average output or power.

Duty cycle: The proportion of a period for which a periodic signal is active.

Identification: Association of a device, object or asset with an identifier.

Authentication: Verification that a device or message is genuine.

Constrained device: A device limited in energy, memory, processing, bandwidth or physical resources.

Review Questions

Short Answer Questions

  1. Distinguish accuracy from precision in sensor measurements.
  2. What is the purpose of an anti-aliasing filter?
  3. State two functions commonly performed by an IoT gateway.
  4. Why is a driver circuit often needed between a microcontroller and an actuator?
  5. Explain why an identifier alone does not authenticate an IoT device.

Long Answer Questions

  1. Explain the principal sensor characteristics that should be considered when selecting a temperature sensor for an industrial application.
  2. Compare GPIO, UART, I²C, SPI and CAN in terms of typical use and design considerations.
  3. Describe a complete calibration process for an analogue sensor, including documentation and limitations.
  4. Explain how a microcontroller-based IoT node can reduce energy consumption without compromising essential monitoring.
  5. Discuss the roles of safety, cybersecurity, privacy and lifecycle management in IoT device design.

Analytical / Application Questions

  1. An environmental node sleeps at 30 µA for 299 seconds, measures at 8 mA for 0.5 seconds and transmits at 60 mA for 0.5 seconds every 300 seconds. Calculate its average current and give an ideal operating-time estimate using a 2.0 Ah battery. State at least three reasons the practical lifetime will differ.
  2. Design a sensing and gateway architecture for a greenhouse requiring temperature, humidity and soil-moisture monitoring. Justify sensor placement, sampling intervals, interfaces, communication technology, power strategy and local failure handling.
  3. A motor-control system occasionally reports implausible sensor values and moves the actuator unexpectedly. Analyse possible causes involving calibration, sampling, grounding, interface errors, firmware and security. Propose a structured test and mitigation plan.

Multiple Choice Questions with Answers

Question 1

Which characteristic describes closeness of a measurement to an accepted true value?

A. Accuracy

B. Resolution

C. Sensitivity

D. Hysteresis

Correct Answer: A. Accuracy

Question 2

For an ideal n-bit ADC with reference voltage V_ref, the approximate quantisation step is:

A. V_ref × 2^n

B. V_ref / 2^n

C. 2^n / V_ref

D. n / V_ref

Correct Answer: B. V_ref / 2^n

Question 3

A major purpose of an anti-aliasing filter is to:

A. Increase battery voltage

B. Prevent unwanted high-frequency components entering the sampler

C. Authenticate the sensor

D. Increase actuator torque

Correct Answer: B. Prevent unwanted high-frequency components entering the sampler

Question 4

Which interface commonly uses shared clock and data lines with addressed devices?

A. UART

B. GPIO

C. I²C

D. PWM

Correct Answer: C. I²C

Question 5

A microcontroller normally requires a driver circuit for a high-current motor because:

A. The motor cannot use electricity

B. The MCU pins have limited current and voltage capability

C. Digital data cannot be stored in flash

D. The motor always operates at zero frequency

Correct Answer: B. The MCU pins have limited current and voltage capability

Question 6

A node uses 1 mA for 90% of its time and 101 mA for 10% of its time. Assuming constant current in each state, its average current is:

A. 1.1 mA

B. 10.0 mA

C. 11.0 mA

D. 101.0 mA

Correct Answer: C. 11.0 mA

Question 7

Which statement about an identifier is correct?

A. Every identifier automatically provides encryption

B. An identifier establishes identity or association but does not by itself prove message authenticity

C. An identifier eliminates the need for calibration

D. An identifier always requires a battery

Correct Answer: B. An identifier establishes identity or association but does not by itself prove message authenticity

Question 8

At the time constant of an ideal first-order sensor response, the output has changed by approximately:

A. 10.0%

B. 37.0%

C. 63.2%

D. 100%

Correct Answer: C. 63.2%

Question 9

Which gateway function is especially useful during temporary internet loss?

A. Replacing every sensor with an actuator

B. Local buffering of device data

C. Removing all device identities

D. Disabling calibration

Correct Answer: B. Local buffering of device data

Question 10

Which design choice generally reduces energy consumption in a battery-powered IoT node?

A. Keeping the radio continuously active

B. Increasing every sampling rate regardless of the process

C. Using sleep modes and event-driven wake-up where appropriate

D. Transmitting duplicate raw data continuously

Correct Answer: C. Using sleep modes and event-driven wake-up where appropriate

IoT Architecture & Protocols
Chapter 3 of 14