Embedded Systems and IoT ConnectivityIntroductionMechanical systems increasingly depend on distributed measurement, computation, communication, and control. A machine tool may measure spindle vibration, a pump may report pressure and temperature, and a production line may coordinate drives, robots, safety devices, and supervisory software. These functions are enabled by embedded systems and industrial Internet of Things (IIoT) connectivity. An embedded system is a computer integrated into a larger product or process to perform a defined function. It normally combines a processor, memory, input/output interfaces, firmware, power conditioning, and sensors or actuators. An IoT system extends this local capability by connecting devices so that data can be monitored, analyzed, and used across machines, production cells, plants, and enterprise systems. For mechanical engineers, the central design problem is not simply selecting a communication protocol. It is deciding what must be measured, where computation should occur, how quickly information must arrive, how failures will be handled, and how the system will remain safe, maintainable, and secure. Learning ObjectivesAfter studying this chapter, the student should be able to: - Explain the architecture and operation of embedded sensor nodes.
- Select appropriate sensors, microcontrollers, PLCs, and industrial devices for mechanical applications.
- Distinguish signal conditioning, sampling, quantization, and real-time control requirements.
- Compare fieldbus, Industrial Ethernet, MQTT, OPC UA, Wi-Fi, Bluetooth, LoRaWAN, and 5G.
- Evaluate protocols using reliability, latency, power consumption, scalability, and interoperability.
- Design a basic sensor-node solution and identify its safety, cybersecurity, and maintenance requirements.
1. Embedded Systems in Mechanical EngineeringA typical embedded monitoring or control system contains five functional layers: - Physical process: machine, motor, pump, bearing, robot, or production line.
- Sensing and actuation: transducers measure variables and actuators influence the process.
- Embedded computation: a microcontroller, PLC, industrial PC, or smart device processes signals.
- Communication: a network transfers measurements, commands, alarms, and diagnostic information.
- Application and information systems: human–machine interfaces, historians, maintenance platforms, and analytics use the data.
The distinction between a sensor node and a controller is important. A sensor node primarily measures and communicates. A controller closes a control loop and must make decisions within a defined time. A connected sensor must never be allowed to compromise a safety function merely because its network connection is unavailable. Microcontrollers, PLCs, and industrial computersA microcontroller unit (MCU) integrates a processor core, memory, timers, analog-to-digital converters, communication peripherals, and digital input/output on one chip. MCUs are economical and energy efficient, making them suitable for wireless vibration, temperature, position, and condition-monitoring nodes. A programmable logic controller (PLC) is an industrial controller designed for deterministic operation, electrical noise immunity, modular input/output, diagnostics, and maintainability by plant personnel. PLC programming commonly uses ladder diagrams, function-block diagrams, structured text, and sequential function charts. PLCs are generally preferred for machine sequencing, interlocking, and industrial control. An industrial PC (IPC) provides greater computational capacity and supports databases, visualization, containerized applications, and advanced analytics. It usually requires more power and stronger environmental protection than an MCU or PLC. Selection should consider computation, timing, environmental conditions, input/output type, certification, lifecycle support, programming skills, cybersecurity, and total cost of ownership—not processor speed alone. 2. Sensor-Node DesignA sensor node converts a physical variable into a trustworthy digital observation. Its principal elements are: - Transducer: converts temperature, force, pressure, displacement, acceleration, or another quantity into an electrical signal.
- Signal conditioning: provides excitation, amplification, filtering, isolation, linearization, and protection.
- Data conversion: an analog-to-digital converter (ADC) samples and quantizes the signal.
- Processing: firmware validates, scales, timestamps, stores, and possibly compresses data.
- Communication: wired or wireless interfaces transmit data.
- Power subsystem: supplies stable voltage and manages energy use.
- Enclosure and installation: protects the node from vibration, dust, moisture, heat, and electromagnetic interference.
Measurement chainA measurement should be specified by range, accuracy, resolution, repeatability, response time, bandwidth, drift, installation method, and calibration requirements. A high-resolution ADC does not automatically produce an accurate measurement: sensor error, reference-voltage error, noise, grounding, and calibration may dominate. For an ideal unipolar ADC with input range 0 to Vref and N bits, the nominal quantization step is: q = Vref/2N Here, q is the voltage represented by one code, Vref is the ADC reference voltage in volts, and N is the number of bits. This is an ideal resolution expression; it excludes offset, gain error, integral nonlinearity, noise, and effective-number-of-bits effects. If a 12-bit ADC uses a 3.3 V reference, q = 3.3/4096 ≈ 0.806 mV. If a pressure transmitter maps 0–10 bar to 0–3.3 V, the nominal pressure increment is approximately 10/4096 = 0.00244 bar, before considering transmitter and ADC errors. Sampling must also represent the physical signal adequately. For a band-limited signal with highest frequency fmax, the sampling frequency should satisfy: fs > 2fmax This is the Nyquist condition. It is necessary but not sufficient in a practical system; an anti-aliasing filter, suitable sensor bandwidth, timing stability, and additional engineering margin are required. Vibration monitoring often requires substantially higher sampling rates than slow temperature monitoring. Digital representation and data qualityFirmware should attach a timestamp, engineering unit, sensor identifier, quality flag, and calibration version to each measurement. A value without context can be misleading. A pressure reading of 6 bar, for example, is incomplete unless the engineer knows whether it is gauge or absolute pressure, where it was measured, and whether the sensor was within calibration. Useful local processing includes range checks, rate-of-change checks, moving averages, root-mean-square vibration calculations, event detection, and buffering during communication outages. Local processing reduces bandwidth and allows rapid alarms, but algorithms must not conceal raw data needed for diagnosis. 3. Real-Time Control and ReliabilityA control loop consists of measurement, computation, communication where applicable, and actuation. Its performance depends on sampling period, computation time, communication delay, jitter, actuator response, and plant dynamics. A networked control system should distinguish: - Hard real time: missing a deadline can cause unsafe or unacceptable behavior.
- Firm real time: late data has little or no value, although occasional loss may be tolerated.
- Soft real time: delay reduces quality but does not immediately invalidate the function.
Motor protection, emergency stopping, and safety interlocks should normally be implemented through dedicated safety-rated hardware or certified safety functions, rather than ordinary cloud or general-purpose messaging. Reliability is broader than successful packet delivery. It includes connector integrity, electromagnetic compatibility, power continuity, device diagnostics, time synchronization, fault detection, recovery, and maintainability. A robust design specifies what happens when a sensor fails, a cable breaks, a wireless link disappears, or a gateway restarts. Important mechanisms include watchdog timers, brownout detection, nonvolatile event logs, redundant measurements where justified, heartbeat messages, sequence numbers, acknowledgements, retries, and defined fail-safe states. Retries can improve delivery but may increase latency; therefore, they must be bounded in time-critical applications. 4. Communication ArchitectureIndustrial connectivity is commonly organized into levels: - Device level: sensors, valves, drives, and actuators.
- Control level: PLCs, remote I/O, and machine controllers.
- Supervisory level: SCADA, HMIs, historians, and plant servers.
- Enterprise and cloud level: maintenance, production planning, digital twins, and analytics.
Gateways are often required because one protocol rarely satisfies all requirements. A gateway may translate fieldbus data into OPC UA or MQTT, buffer data during outages, enforce security policies, and normalize units. Translation can also introduce semantic loss, timing delays, and a new point of failure. The original data model and quality status should therefore be preserved. Wired industrial protocolsFieldbus refers to families of industrial digital networks such as Modbus RTU, PROFIBUS, CAN-based networks, and DeviceNet. Fieldbus systems typically use structured addressing, defined frames, and electrical media suited to industrial environments. Their strengths include mature products, predictable behavior in established installations, and low-cost device-level communication. Limitations include vendor-specific profiles, constrained bandwidth in some systems, configuration complexity, and less native integration with modern IT systems. Modbus RTU over serial links is simple and widely supported. It commonly uses a master–slave or client–server style in which a client requests registers from a server. It is easy to troubleshoot but has limited semantic description, and its basic protocol does not provide strong security. CAN and CANopen use message identifiers and arbitration mechanisms suitable for distributed machine devices. CAN is robust and efficient for short control messages, but bus loading and message priority must be engineered carefully. Industrial Ethernet uses Ethernet physical and data-link technology with industrial protocols and managed infrastructure. Examples include EtherNet/IP, PROFINET, EtherCAT, and Modbus TCP. Industrial Ethernet offers higher bandwidth, integration with standard networks, and sophisticated diagnostics. Deterministic variants use scheduling, prioritization, synchronized clocks, or specialized processing to reduce jitter. Ordinary office Ethernet should not automatically be assumed to meet industrial real-time requirements. Application and interoperability protocolsOPC UA is a platform-independent framework for secure industrial information exchange. It supports structured information models, discovery, browsing, data types, historical access, events, alarms, and multiple communication patterns. Its major advantage is semantic interoperability: a client can understand that a value represents, for example, motor temperature rather than merely receiving an unexplained numeric register. OPC UA can require more configuration and computational resources than a minimal field protocol. MQTT is a lightweight publish–subscribe messaging protocol. A publisher sends messages to a broker under topics; subscribers receive messages for selected topics. MQTT is effective for telemetry, distributed monitoring, and intermittent connections. Quality-of-Service levels provide different delivery behavior: at-most-once, at-least-once, and exactly-once protocol semantics. “Exactly once” does not mean that the physical action occurred exactly once, so industrial commands require application-level safeguards, idempotency, authorization, and state verification. MQTT normally transports payloads but does not inherently define industrial meaning. A disciplined topic hierarchy, payload schema, units, timestamps, quality flags, retained-message policy, access control, and versioning are necessary for maintainability. MQTT should not replace a safety protocol or a deterministic motion network merely because it is easy to connect to the cloud. 5. Wireless ConnectivityWireless communication reduces cabling and can enable rotating, mobile, or difficult-to-access assets. It also introduces radio interference, changing propagation conditions, battery constraints, shared-medium contention, and cybersecurity exposure. Wi-Fi provides high throughput and broad equipment availability. It is appropriate for operator interfaces, video, engineering access, and many monitoring applications. Its latency and availability can vary with congestion, roaming, interference, and access-point design; it therefore requires a site survey and should not be used casually for safety-critical control. Bluetooth Low Energy (BLE) is designed for short-range, low-power communication. It is useful for commissioning, wearable devices, portable instruments, and nearby sensors. Range and reliability depend on antenna placement, metal structures, interference, connection intervals, and gateway location. LoRaWAN uses low-power wide-area radio and is suited to small, infrequent messages over large areas. It supports battery-powered environmental and condition-monitoring nodes. Its low data rate, duty-cycle constraints in some regions, and variable latency make it unsuitable for fast closed-loop control. Regional frequency regulations and network-server architecture must be considered. 5G can provide high capacity, mobility, and potentially low-latency, highly reliable services through features such as private networks and quality-of-service mechanisms. Actual performance depends on spectrum, deployment, coverage, network configuration, subscription or private infrastructure, and application design. 5G is not automatically deterministic simply because it is newer than Wi-Fi. 6. Comparative Evaluation of ProtocolsThe following comparison is qualitative because actual performance depends on topology, implementation, traffic, electromagnetic conditions, and configuration. | Technology | Typical role | Reliability and latency | Power and range | Interoperability |
|---|
| Fieldbus | Device and machine control | Predictable in engineered networks; low to moderate latency | Usually mains-powered; short to medium range | Mature but profiles may be vendor-specific | | Industrial Ethernet | PLCs, drives, distributed I/O | High bandwidth; deterministic variants available | Mains-powered; plant-scale with switches | Strong industrial ecosystem | | OPC UA | Information integration | Usually not the lowest-latency control protocol | Mains-powered servers and gateways | Strong semantic interoperability | | MQTT | Telemetry and enterprise/cloud messaging | Depends on broker, network, QoS, and buffering | Often gateway or mains-powered; wide-area capable | Payload semantics must be designed | | Wi-Fi | Local wireless monitoring and access | Variable under interference and congestion | Moderate power; building or plant coverage | Very broad IT support | | BLE | Short-range sensors and commissioning | Suitable for local, noncritical data | Low power; short range | Broad consumer and industrial support | | LoRaWAN | Sparse, wide-area sensing | Low data rate and potentially variable latency | Very low node power; long range | Requires network and regional compliance | | 5G | Mobile machines and high-capacity wireless | Potentially low latency and high reliability with engineered service | Higher infrastructure and device complexity | Broadening industrial ecosystem |
Protocol choice should begin with requirements. A useful decision sequence is: - Is the function safety-related or part of a hard real-time control loop?
- What are the maximum acceptable latency and jitter?
- What data volume, update rate, and outage duration must be supported?
- Is the device battery powered, mobile, or permanently powered?
- What environmental, distance, and electromagnetic constraints exist?
- What interoperability, cybersecurity, and lifecycle requirements apply?
7. Worked Design Example: Pump Condition-Monitoring NodeConsider a centrifugal pump in a factory. The engineering objective is to detect overheating and abnormal vibration while retaining local protection through the existing PLC. The proposed node contains a temperature sensor, a three-axis accelerometer, an MCU, local flash memory, a BLE commissioning interface, and a wired or low-power wireless backhaul to an industrial gateway. The PLC retains the trip function for dangerous temperature or pressure conditions. The temperature channel requires 0–120 °C measurement. A conditioned 0–3.3 V signal is connected to a 12-bit ADC. The ideal ADC step is 0.806 mV. Assuming a linear mapping, the nominal temperature increment is: ΔT = 120/4096 ≈ 0.0293 °C This is only quantization resolution. If the sensor accuracy is ±0.5 °C, the reference has gain error, and the installation has thermal lag, reporting temperature to three decimal places would create false precision. The accelerometer is sampled locally at 4 kHz for a selected vibration band. Because the highest analyzed frequency is limited to 1 kHz by analog and digital filtering, the sampling condition fs > 2fmax is satisfied. The node calculates a short-time RMS value, stores event windows before and after an alarm, and transmits summary statistics during normal operation. Raw waveforms are uploaded only when a threshold or diagnostic request occurs. The design uses the MCU for signal processing and buffering, the gateway for protocol conversion and secure store-and-forward, and the PLC for deterministic shutdown. Messages contain asset identifier, timestamp, temperature, vibration RMS, operating state, units, quality code, firmware version, and sequence number. If the wireless link fails, the node continues local sampling and stores data in a circular buffer. If storage becomes full, the oldest non-event data is overwritten while event records are protected. If the sensor exceeds its valid range, the node reports a diagnostic state rather than transmitting a plausible but false value. The PLC is not dependent on the wireless node for emergency protection. This arrangement illustrates a general principle: use local computation for immediate decisions and data reduction, while using network connectivity for supervision, coordination, and historical analysis. 8. Illustrative Case: Retrofitting a Compressed-Air SystemBackground. A medium-sized plant experiences unexplained compressor energy consumption and intermittent pressure complaints. The existing compressors are controlled by a PLC, but the older distribution network has few measurement points. Problem. Engineers need pressure, temperature, flow, and compressor-state data at multiple locations. Installing new Ethernet cabling throughout the plant would interrupt production and impose substantial installation cost. Analysis. Pressure and temperature change relatively slowly, while compressor trips and control commands require more dependable local handling. The plant contains metal structures and electrical equipment that may attenuate radio signals. Data must be associated with assets and units, not merely delivered as anonymous numbers. Approach. Battery-powered LoRaWAN nodes measure remote pressure and temperature at a low update rate. A gateway collects the measurements and forwards them through MQTT using encrypted connections to a plant server. The compressor PLC retains control and protection. At the server, an OPC UA interface exposes structured data to the SCADA and maintenance systems. Wired Industrial Ethernet is used inside the compressor control panel for devices requiring deterministic communication. Outcome. The hybrid architecture limits new cabling, provides plant-wide visibility, and preserves local control if the gateway or external network fails. The project team must still validate radio coverage, battery life, gateway redundancy, time synchronization, cybersecurity, and calibration. Energy savings cannot be claimed merely because data is available; they must be demonstrated by comparing normalized consumption before and after corrective actions. Learning points. Protocols should be assigned according to function. LoRaWAN is appropriate for sparse remote measurements, MQTT for flexible telemetry transport, OPC UA for structured integration, and Industrial Ethernet for local control. A layered design prevents a cloud service from becoming an unsafe single point of control. 9. Cybersecurity, Safety, and GovernanceConnected machines expand the attack surface. Threats include unauthorized access, altered firmware, credential theft, denial of service, malicious commands, ransomware, and manipulation of sensor values. Security controls should include asset inventories, network segmentation, least-privilege accounts, strong device identity, certificate or key management, encrypted communication where appropriate, secure boot, signed firmware, patch management, backups, logging, and incident-response procedures. Security must be balanced with availability and maintainability. A forgotten password policy or unsupported certificate process can cause operators to bypass controls. Engineers should define who can read data, change configurations, issue commands, update firmware, and approve remote access. Safety and cybersecurity are related but not identical. A secure system may still be unsafe if its control logic is wrong; a safety-rated system may still be vulnerable to unauthorized access. Risk assessment should consider functional safety, machinery regulations, electrical requirements, radio regulations, data protection, and applicable industrial cybersecurity standards. Where personal data, worker location, or video is collected, purpose limitation, retention, access control, and privacy obligations also apply. 10. Contemporary Developments and Best PracticesCurrent industrial systems increasingly combine edge computing, digital twins, time-sensitive networking, private wireless networks, and machine-learning analytics. Edge computing reduces latency and bandwidth requirements by processing data near the machine. A digital twin can combine geometry, operating state, maintenance history, and sensor data, but its predictions are only as reliable as the model, data quality, and assumptions. Machine learning can detect unusual vibration or energy patterns, but it should supplement—not obscure—physical reasoning and established protection limits. Training data must represent normal operating modes, load changes, sensor faults, and maintenance conditions. Operators need explanations, confidence indicators, and a means to challenge an automated recommendation. Best practices include: - define the engineering requirement before selecting a protocol;
- separate safety, control, monitoring, and enterprise functions;
- use standard units, timestamps, data-quality codes, and asset identifiers;
- design for communication loss and power interruption;
- validate sensor installation and calibration, not only software;
- document network topology, addressing, firmware, and configuration;
- test latency, jitter, coverage, battery life, and recovery under realistic load;
- protect credentials and update mechanisms throughout the asset lifecycle;
- preserve raw or diagnostic data needed for fault investigation; and
- plan obsolescence, spare parts, training, and decommissioning.
Chapter SummaryEmbedded systems connect mechanical processes to computation and communication. A practical sensor node requires a suitable transducer, signal conditioning, ADC, firmware, power system, communications interface, and protected installation. Sampling and quantization determine how physical signals become digital data, but resolution alone does not establish measurement accuracy. Microcontrollers suit compact sensing and edge processing; PLCs provide maintainable, deterministic industrial control; and industrial PCs support demanding visualization and analytics. Fieldbus and Industrial Ethernet are primarily used for device and control communication. OPC UA provides structured, semantically rich interoperability, while MQTT provides flexible publish–subscribe telemetry. Wi-Fi, BLE, LoRaWAN, and 5G serve different ranges, power budgets, data rates, and reliability needs. Protocol selection must consider latency, jitter, reliability, power, environmental conditions, interoperability, security, and lifecycle support. Local safety and control functions should remain operational during network or cloud failures. Successful IIoT design is therefore a systems-engineering activity involving measurement science, control, networking, cybersecurity, maintenance, and organizational responsibility. Key TermsEmbedded system: A computer integrated into a larger product or process for a defined function. Sensor node: A device that measures physical variables, processes data, and communicates observations. Microcontroller unit: A compact integrated processor with memory and peripheral interfaces. PLC: An industrial controller designed for reliable, maintainable automation. Industrial PC: A rugged computer used for advanced processing, visualization, or industrial applications. Transducer: A device that converts a physical quantity into an electrical signal or vice versa. Signal conditioning: Amplification, filtering, isolation, excitation, and protection applied to a sensor signal. ADC: An analog-to-digital converter that represents an analog signal numerically. Quantization: Mapping a continuous amplitude to discrete digital codes. Aliasing: Misrepresentation of signal frequency caused by insufficient sampling and inadequate filtering. Fieldbus: An industrial digital network for communication among field devices and controllers. Industrial Ethernet: Ethernet-based industrial networking with specialized protocols and performance mechanisms. OPC UA: A secure, platform-independent framework for structured industrial information exchange. MQTT: A lightweight publish–subscribe messaging protocol using brokers and topics. Latency: Time between an event or transmission and the corresponding reception or response. Jitter: Variation in communication or task timing. LoRaWAN: A low-power wide-area networking technology for sparse, long-range telemetry. Edge computing: Processing data near the physical source rather than exclusively in a remote cloud. Interoperability: The ability of different systems to exchange and correctly use information. Fail-safe state: A defined condition intended to limit harm when a fault occurs. Review QuestionsShort Answer Questions- What are the principal functional elements of an embedded sensor node?
- Why does ADC resolution not equal total measurement accuracy?
- Distinguish a microcontroller, PLC, and industrial PC.
- What is the difference between MQTT and OPC UA?
- Why should safety functions not depend solely on a wireless or cloud connection?
Long Answer Questions- Explain the complete measurement chain from a mechanical variable to an industrial application, including signal conditioning and data quality.
- Compare fieldbus and Industrial Ethernet with respect to determinism, bandwidth, diagnostics, and interoperability.
- Discuss the design trade-offs among Wi-Fi, BLE, LoRaWAN, and 5G for mechanical-engineering applications.
- Explain how gateways support IIoT architectures and identify the risks introduced by protocol translation.
- Develop a cybersecurity and lifecycle-management plan for a connected machine.
Analytical / Application Questions- Design a sensor node for monitoring bearing temperature and vibration on a rotating machine. Specify sensors, sampling strategy, local processing, communications, failure behavior, and data fields.
- A factory needs slow pressure measurements from remote tanks and deterministic control of a nearby pump. Select suitable technologies for each function and justify the architecture using latency, power, reliability, and interoperability.
- A wireless monitoring system reports plausible but intermittent temperature values. Develop a fault-investigation plan covering sensor installation, sampling, radio performance, timestamps, gateway buffering, calibration, and cybersecurity.
Multiple Choice Questions with AnswersQuestion 1For an ideal 12-bit ADC with a 3.3 V reference, what is the nominal quantization step? A. 0.806 mV B. 3.3 mV C. 12.0 mV D. 806 mV Correct Answer: A. 0.806 mV Question 2Which device is generally most appropriate for deterministic machine sequencing and industrial interlocking? A. Consumer smartphone B. PLC C. LoRaWAN gateway only D. Cloud database Correct Answer: B. PLC Question 3What is the principal communication model used by MQTT? A. Token-ring polling only B. Direct analog signaling C. Publish–subscribe through a broker D. Point-to-point optical switching only Correct Answer: C. Publish–subscribe through a broker Question 4Which technology is best suited to sparse, low-power measurements over a large area? A. LoRaWAN B. Industrial Ethernet C. High-speed fieldbus drive control D. HDMI Correct Answer: A. LoRaWAN Question 5What is a major advantage of OPC UA in industrial integration? A. It eliminates the need for sensors B. It provides structured and semantically rich information models C. It guarantees every wireless packet arrives instantly D. It is exclusively an analog protocol Correct Answer: B. It provides structured and semantically rich information models Question 6A signal has a highest relevant frequency of 1 kHz. Which sampling frequency satisfies the basic Nyquist condition? A. 500 Hz B. 1 kHz C. 1.5 kHz D. 2.5 kHz Correct Answer: D. 2.5 kHz Question 7What should normally retain emergency shutdown authority in the pump case? A. A remote cloud dashboard B. The wireless sensor battery C. The existing PLC or dedicated safety system D. An MQTT subscriber without authorization Correct Answer: C. The existing PLC or dedicated safety system Question 8Which factor can cause Wi-Fi latency and availability to vary in a factory? A. Radio interference and network congestion B. The color of the machine paint only C. ADC bit depth alone D. The use of engineering units Correct Answer: A. Radio interference and network congestion Question 9What is the principal purpose of a watchdog timer in an embedded device? A. To increase sensor accuracy automatically B. To restart or place a device in a defined state after software failure C. To replace network encryption D. To convert pressure into temperature Correct Answer: B. To restart or place a device in a defined state after software failure Question 10Why should a connected node transmit quality flags with measurements? A. To make all values appear more precise B. To indicate validity or diagnostic status of the data C. To remove the need for calibration D. To guarantee zero latency Correct Answer: B. To indicate validity or diagnostic status of the data
|