Sensors, Actuators and Hardware InterfacingIntroductionAn Internet of Things (IoT) system connects the physical world to computational, communication and service platforms. Sensors observe physical phenomena, embedded processors interpret measurements, actuators produce physical effects, and communication interfaces transport information between local devices and remote systems. Hardware interfacing is the engineering discipline that makes these elements electrically, temporally and logically compatible. In a simple IoT node, a sensor may measure temperature, a microcontroller may filter and analyse the measurement, a wireless transceiver may transmit it, and an actuator may control a valve or motor in response. The apparent simplicity of this chain conceals important design questions: What physical quantity is actually being measured? How accurate and fast must the measurement be? Is the sensor output analog, digital, frequency-based or event-driven? Can the processor safely drive the actuator? How should noise, isolation, power consumption, calibration and failure be managed? This chapter develops these questions at postgraduate level. It treats sensors and actuators not merely as components, but as parts of a measurement-and-control architecture subject to uncertainty, constraints and safety requirements. Learning ObjectivesAfter studying this chapter, the reader should be able to: - distinguish sensor, transducer, actuator and interface functions;
- analyse sensor performance using sensitivity, resolution, accuracy, linearity, hysteresis, repeatability and response time;
- design analog, digital and mixed-signal interfaces, including signal conditioning and analog-to-digital conversion;
- select suitable drivers and protection circuits for relays, motors, solenoids, LEDs and other actuators;
- evaluate grounding, isolation, electromagnetic compatibility, timing and power-integrity problems;
- apply calibration, filtering, diagnostics and fail-safe design to an IoT node; and
- critically assess a complete sensing-and-actuation application.
1. Measurement Chain and TerminologyA sensor responds to a physical quantity such as temperature, pressure, acceleration, light or chemical concentration. A transducer converts energy or information from one form to another; a sensor is therefore a measurement transducer, while a loudspeaker and motor are output transducers. An actuator receives an electrical, pneumatic or hydraulic command and produces a physical action. A signal conditioner modifies a sensor signal so that it can be sampled or processed reliably. It may amplify, attenuate, filter, linearise, isolate or shift the signal level. A useful model is: physical variable → sensing element → transduction → signal conditioning → sampling and conversion → computation → driver → actuator → physical process The chain is closed-loop when a sensor measures the consequence of actuation and the controller updates the command. In an open-loop system, actuation occurs without feedback. Open-loop control is simpler but cannot automatically correct disturbances or component ageing. Important distinctions include: | Concept | Meaning | Example |
|---|
| Measurand | Quantity intended to be measured | Room temperature | | Sensor | Device that responds to the measurand | Resistance temperature detector | | Transducer | Device converting one energy/information form to another | Piezoelectric element | | Actuator | Device producing controlled physical action | Servo motor | | Node | Embedded device containing processing, interfaces and often communication | Battery-powered environmental monitor | | Interface | Electrical and logical connection between subsystems | I²C bus or ADC input |
The measurement chain should be specified from the application requirement backwards. A requirement such as “monitor temperature” is insufficient. A proper specification states range, permissible error, update rate, operating environment, power budget, physical mounting, communications protocol, calibration interval and consequences of failure. 2. Sensor Characteristics2.1 Static characteristicsThe ideal sensor output is a known function of the measurand. For a linear sensor: y = y₀ + Sx Here, x is the measurand, y is the output, y₀ is the output at zero input, and S is sensitivity. Sensitivity has units of output per unit input, such as mV/°C. Real sensors may require a nonlinear model: y = f(x) + b + n where f(x) is the ideal response, b is systematic bias and n represents random error. This model is useful because calibration can address bias and model error, whereas averaging can reduce some random noise but cannot remove a persistent bias. Range is the interval over which the sensor operates acceptably. Span is the difference between upper and lower range values. Resolution is the smallest distinguishable change. Accuracy expresses closeness to the true value; precision expresses repeatability. A sensor may be precise but inaccurate if it has a stable calibration offset. Linearity error is the deviation from a specified reference line. Hysteresis occurs when the output depends on whether the measurand is increasing or decreasing. Repeatability concerns variation under the same conditions, while reproducibility includes changes in operators, instruments or environments. Drift is change in output over time or with environmental conditions. For a measured value xₘ and reference value xᵣ, absolute error is: e = xₘ − xᵣ and percentage error, when xᵣ ≠ 0, is: percentage error = (|e| / |xᵣ|) × 100% These expressions quantify error but do not by themselves identify its cause. 2.2 Dynamic characteristicsA sensor does not respond instantaneously. A commonly used first-order model is: τ(dy/dt) + y = Kx where τ is the time constant, K is the static gain, x is the input and y is the output. For a step input x = X applied at t = 0, with zero initial output: y(t) = KX(1 − e^(−t/τ)) After one time constant, the output reaches approximately 63.2% of its final value; after approximately five time constants, it reaches more than 99%. This model is applicable when the sensor behaves approximately as a linear first-order system over the operating range. Sensors with mechanical resonance, thermal lag or internal digital filtering may require higher-order models. The sampling rate must be related to the signal bandwidth. For a band-limited signal with highest significant frequency fₘₐₓ, the ideal sampling condition is: fₛ > 2fₘₐₓ This is the Nyquist condition. In practice, the sampling rate is chosen with margin, and an analog anti-aliasing filter is placed before the ADC. Sampling faster does not recover information already lost through poor bandwidth or excessive noise. 2.3 Noise and uncertaintyNoise may originate in the sensor, resistor network, amplifier, power supply, electromagnetic environment or ADC. Thermal noise, shot noise, quantisation noise, interference and mechanical vibration have different statistical and spectral properties. A low-pass filter can reduce high-frequency noise but introduces delay and may suppress legitimate rapid changes. For independent uncertainties u₁, u₂, …, uₙ, a first-order root-sum-square estimate is: uc = √(u₁² + u₂² + … + uₙ²) This approximation assumes independent, small uncertainties and linear sensitivity coefficients. If an output q depends on variables pᵢ, the more general expression is: uq² = ∑[(∂q/∂pᵢ)²uᵢ²] for independent inputs. Correlated uncertainties require covariance terms and should not be treated by simple root-sum-square addition. 3. Sensor Technologies and Output FormsResistive sensors change resistance with temperature, strain, force or position. An RTD is relatively linear and stable; a thermistor provides high sensitivity but is strongly nonlinear. A strain gauge is commonly used in a Wheatstone bridge because the bridge converts small resistance changes into a differential voltage and helps reject common-mode disturbances. Capacitive sensors respond to changes in capacitance caused by displacement, proximity, humidity or dielectric properties. They require careful attention to parasitic capacitance, shielding and excitation frequency. Inductive sensors are suitable for metallic targets and robust industrial proximity detection. Photodiodes produce current related to incident optical power, whereas phototransistors provide gain but may have slower response. Hall-effect sensors detect magnetic fields and are widely used for position and current measurement. Piezoelectric sensors are useful for vibration and dynamic force but are generally unsuitable for static force measurement because charge leakage causes signal decay. Sensors may provide: - Analog voltage or current: for example, 0–3.3 V or 4–20 mA;
- resistive or capacitive change: requiring an excitation and measurement circuit;
- frequency or pulse output: useful for rotational speed and flow;
- digital serial data: commonly through I²C, SPI, UART, CAN or one-wire protocols;
- event output: such as an interrupt when motion or a threshold is detected.
The interface choice affects wiring, noise immunity, addressability, timing and software complexity. A 4–20 mA loop is relatively robust over long industrial cables and can often indicate a fault when current falls below the normal operating range. A short-range I²C bus is convenient on a circuit board but is more sensitive to capacitance and wiring length. 4. Analog Hardware Interfacing4.1 Voltage range and loadingAn ADC input has a finite input structure, leakage and sampling capacitor. A sensor must be able to drive it within the acquisition time. If a source resistance is too high, the sampling capacitor may not settle, producing gain error. The interface must also ensure that the input remains within the permitted common-mode and absolute voltage limits. For a voltage divider containing R₁ and R₂, with the output measured across R₂: Vₒ = Vᵢ × R₂/(R₁ + R₂) where Vᵢ is the supply voltage. The formula assumes ideal resistors and negligible load. If a load Rᴸ is connected, the effective lower resistance becomes R₂ ∥ Rᴸ, where: R₂ ∥ Rᴸ = (R₂Rᴸ)/(R₂ + Rᴸ) Ignoring the load can cause substantial error when Rᴸ is not much larger than R₂. 4.2 Amplification and level shiftingAn instrumentation amplifier is appropriate for small differential signals in the presence of common-mode voltage. Its design priorities include gain accuracy, input bias current, offset voltage, common-mode rejection ratio, bandwidth and input protection. A signal may require level shifting when a bipolar sensor output must be connected to a unipolar ADC. For a non-inverting ideal op-amp: Vₒ = Vᵢ(1 + Rf/Rg) where R_f is the feedback resistor and R_g connects the inverting input to the reference node. The ideal relationship assumes operation within supply rails, adequate bandwidth and negligible input currents. Real circuits require output swing and stability checks. 4.3 ADC resolution and quantisationFor an ideal N-bit ADC with input range 0 to Vᵣₑf, the nominal code width is approximately: q = Vᵣₑf/2ᴺ The actual conversion error also includes offset, gain, integral nonlinearity, differential nonlinearity, reference error and noise. The ADC should not be selected solely by bit count; effective number of bits and reference stability may be more important. Worked example. A 12-bit ADC uses a 3.3 V reference. Its nominal code width is: q = 3.3/4096 ≈ 0.000806 V = 0.806 mV. If a sensor produces 10 mV/°C, one ideal code corresponds to approximately 0.0806 °C. This does not mean the temperature accuracy is 0.0806 °C: sensor tolerance, reference error, noise and calibration may dominate. 4.4 Filtering and samplingAn RC low-pass filter has cutoff frequency: fc = 1/(2πRC) R is resistance in ohms, C is capacitance in farads and f_c is in hertz. The filter is useful for suppressing frequencies above the measurement band, but its phase delay must be considered in control systems. The filter should be designed together with the sampling interval and software filter. 5. Digital Interfaces and Protocol EngineeringI²C uses two open-drain lines, SDA and SCL, with pull-up resistors. Multiple devices can share the bus, but address conflicts, bus capacitance, rise time and clock stretching must be managed. SPI generally offers higher throughput and simpler timing but uses separate chip-select signals and does not inherently provide addressing. UART is asynchronous and point-to-point in its basic form; baud rate, framing and voltage levels must match. CAN provides arbitration, error detection and robust multi-node operation, making it valuable in vehicles and industrial systems. A reliable interface design specifies electrical levels, timing, reset state, packet format, error detection, retries, timeout behaviour and firmware ownership of the bus. Digital does not mean error-free. A corrupted measurement can pass through a perfect serial protocol if the sensor itself is saturated or disconnected. Plausibility checks and status registers are therefore essential. A typical transaction should include: - device discovery or configuration;
- command or register-address transmission;
- data acquisition;
- integrity checking, such as CRC where supported;
- range and plausibility validation;
- timestamping and storage or transmission;
- defined response to timeout or invalid data.
6. Actuators and Driver CircuitsActuators can be classified by output energy and motion: electrical heaters, LEDs, relays, solenoids, DC motors, stepper motors, servo motors, valves and piezoelectric elements. Selection depends on force or torque, speed, travel, duty cycle, efficiency, controllability, environment and failure consequence. A microcontroller pin is generally a logic signal source, not a power driver. Motors and solenoids draw current well above the safe GPIO rating and generate transients. A low-side MOSFET driver is commonly used for a DC load: the load connects to the positive supply, the MOSFET switches its return path, and a gate resistor and pull-down establish controlled switching. An inductive load requires a flyback path. When current is interrupted, stored magnetic energy produces a voltage that must be safely dissipated through a diode, TVS device or suitable snubber. A relay provides galvanic separation between control and load circuits when correctly implemented, but its coil still requires a driver and suppression. Contact ratings, inrush current, creepage, clearance and switching category must be checked. For AC mains, appropriate isolation, fusing, enclosure and regulatory practice are mandatory. PWM controlPulse-width modulation controls average power by varying duty ratio D: D = ton/T where t_on is on-time and T is the PWM period. For an ideal resistive load supplied by V, the average voltage is approximately: Vavg = DV This approximation is useful for slow loads and filtered systems; motor current, inductance, back electromotive force and switching losses mean that mechanical speed is not generally proportional directly to D. A servo motor often interprets pulse width as a position command, while a stepper motor translates pulse frequency and sequence into motion. Closed-loop actuators use feedback to correct position, speed or force; open-loop actuators are cheaper but can lose synchronisation or fail silently. 7. Power, Grounding, Isolation and EMCMany interface failures are power-integrity failures. A sensor may require a clean supply while a radio or motor produces rapid current changes. Decoupling capacitors should be placed near device supply pins, power domains should be planned, and voltage regulators should be selected for transient response, thermal dissipation and quiescent current. Ground is not an ideal zero-impedance reference. Shared return currents can create ground offsets, especially when actuator currents flow through sensor returns. Star connections, separate power paths, differential measurement and controlled return routing can reduce this problem. Shielding must be connected according to the frequency and grounding strategy; an improperly connected shield can increase interference. Galvanic isolation is appropriate when there are dangerous voltages, large ground-potential differences, long external cables or safety requirements. Digital isolators, optocouplers, isolated ADCs and isolated DC–DC converters are possible solutions. Isolation must be evaluated as a system: signal isolation without isolated power does not necessarily provide safety. Electromagnetic compatibility requires both emissions and immunity analysis. Cable length, edge rate, loop area, enclosure, filtering and PCB layout influence performance. Slower edges may reduce radiated emissions, but excessive slowing can violate protocol timing. Compliance testing should occur before production rather than being treated as a final administrative step. 8. Calibration, Diagnostics and ReliabilityCalibration establishes the relationship between instrument output and reference values. A two-point linear calibration may be written as: x = a y + b where y is the measured sensor output, x is the estimated measurand, a is the scale factor and b is the offset. If reference pairs (y₁, x₁) and (y₂, x₂) are known and y₁ ≠ y₂: a = (x₂ − x₁)/(y₂ − y₁), b = x₁ − ay₁ Two-point calibration assumes linearity over the operating interval. Polynomial or lookup-table calibration may be necessary for nonlinear sensors, but it increases memory, computation and validation requirements. Diagnostics should detect open circuits, short circuits, saturation, implausible rates of change, stale timestamps, communication timeouts and inconsistent redundant measurements. A safety-oriented actuator should have a defined de-energised state. Watchdog timers, brownout detection, boot-time self-tests and event logs improve resilience. A useful reliability principle is that a fault should produce a detectable and safe outcome rather than an apparently valid but dangerous measurement. For example, a disconnected thermistor should not be interpreted as a normal temperature without a range check. 9. Case Study: IoT Cold-Chain Monitoring and ControlBackgroundThe following is an illustrative case. A pharmaceutical distribution cabinet must maintain a temperature between 2 °C and 8 °C, report conditions through a wireless IoT gateway and activate a cooling mechanism when temperature rises. ProblemA first prototype used a low-cost analog temperature sensor connected directly to a microcontroller ADC. The cooling relay was driven from a GPIO pin. Field tests showed intermittent false alarms, ADC readings that changed when the wireless transmitter operated, and a damaged microcontroller after repeated compressor switching. AnalysisThe prototype had several architectural faults. The sensor output was vulnerable to supply and ground noise, with no defined analog bandwidth. The ADC reference was not adequately decoupled. The relay coil exceeded the GPIO current capability and generated inductive transients. Compressor switching introduced electrical and thermal disturbances. Finally, the control logic used a single threshold, causing rapid relay cycling near the limit. Approach and solutionThe redesigned node used a calibrated digital temperature sensor mounted away from the compressor and airflow outlet. Measurements were timestamped and checked for range, communication timeout and implausible rate of change. A local alarm was retained so that network failure did not disable safety notification. The actuator path used an isolated relay driver rated for the compressor’s inrush current, with coil suppression and a fuse. The controller implemented hysteresis: cooling began above 8 °C and stopped below 4 °C. This creates a dead band that limits switching frequency. A minimum compressor off-time was also imposed to protect the compressor. The radio, sensor and actuator power paths were separated, with local decoupling and controlled return currents. Data packets included temperature, battery or supply status, sensor-health state, relay state and a sequence number. The gateway rejected stale or duplicated packets. If the sensor failed, the controller entered a conservative alarm state rather than assuming that the cabinet was safe. OutcomeThe redesigned system reduced false alarms and prevented GPIO damage. More importantly, it converted an informal prototype into a traceable control system with explicit sensing accuracy, actuator ratings, failure responses and maintenance procedures. The case demonstrates that correct interfacing is not merely a wiring concern; it is a system-safety and reliability concern. Learning points- Sensor selection must consider installation and interference, not only nominal accuracy.
- GPIO outputs require drivers for power loads.
- Hysteresis and minimum timing constraints are essential for actuator longevity.
- Communication availability must not be confused with local safety.
- Diagnostics should distinguish a valid extreme measurement from a failed sensor.
10. Design Workflow and Best PracticesA disciplined design workflow is: - define measurands, ranges, accuracy, bandwidth and environmental conditions;
- identify hazards, failure consequences and required safe states;
- select sensor and actuator technologies;
- specify electrical levels, current, timing and connector requirements;
- design signal conditioning, conversion, drivers and protection;
- analyse power, grounding, isolation and EMC;
- implement firmware validation, calibration and diagnostics;
- test normal, boundary, fault and recovery cases;
- document calibration, maintenance and cybersecurity interfaces; and
- validate the complete system under realistic environmental conditions.
Hardware security is increasingly relevant. Physical access may permit sensor substitution, debug-port abuse or actuator manipulation. Secure boot, authenticated firmware, protected debug interfaces, signed configuration and audit logs can reduce these risks. However, cybersecurity controls must not prevent essential local safety functions during network outage. Contemporary systems increasingly combine edge AI with conventional sensing. Machine-learning models can detect vibration anomalies, classify acoustic events or compensate for nonlinear sensor behaviour. They should not replace basic range checks, calibration and deterministic safety interlocks. A model may identify an unusual pattern without proving that an actuator command is safe. Explainability, dataset shift, computational load and update governance must be considered. Challenges and LimitationsSensor specifications are often measured under laboratory conditions and may not predict field performance. Temperature, humidity, vibration, contamination, ageing and mounting can dominate the error budget. More resolution can increase data volume and power consumption without improving useful information. Wireless connectivity may introduce latency and packet loss, while cloud dependence can compromise availability. Actuator performance is similarly context-dependent. A motor rated for a certain torque may overheat under continuous duty; a relay’s nominal current rating may not cover inductive or inrush loads. Isolation improves safety but introduces cost, propagation delay and power constraints. Filtering improves noise performance but can hide rapid faults. Every engineering improvement therefore involves trade-offs that should be evaluated against the application’s risk and performance requirements. Chapter SummarySensors convert physical phenomena into usable information, while actuators convert commands into physical action. Their engineering quality depends on the complete chain: sensing element, conditioning, sampling, computation, driver and physical process. Important sensor properties include range, sensitivity, resolution, accuracy, precision, linearity, hysteresis, drift and dynamic response. ADC resolution, sampling theory, anti-aliasing and uncertainty analysis are essential for analog interfaces. Digital buses require attention to electrical levels, timing, integrity and fault handling. Actuators require properly rated drivers, transient suppression, power control and, where necessary, isolation. Grounding, decoupling and EMC are system-level concerns. Calibration establishes measurement validity, while diagnostics and fail-safe design address uncertainty and failure. Modern IoT nodes should combine local deterministic protection with networked monitoring, and AI should supplement rather than replace sound instrumentation and safety practice. Key TermsSensor: Device that responds to a physical measurand. Transducer: Device that converts energy or information from one form to another. Actuator: Device that produces physical action from a command. Measurand: Quantity intended to be measured. Sensitivity: Change in output per unit change in input. Accuracy: Closeness of a measurement to the reference value. Precision: Degree of repeatability of measurements. Resolution: Smallest distinguishable change. Hysteresis: Dependence of output on the direction of input change. Drift: Change in output over time or environmental conditions. Signal conditioning: Amplification, filtering, isolation or other preparation of a signal. ADC: Analog-to-digital converter. Aliasing: Misrepresentation caused by insufficient sampling. PWM: Pulse-width modulation used to control average power or encode commands. Flyback suppression: Circuitry that limits voltage generated by an interrupted inductive current. Galvanic isolation: Electrical separation preventing direct conductive current flow. Calibration: Establishing the relationship between an instrument output and a reference. Hysteresis control: Control using separate activation and deactivation thresholds. EMC: Electromagnetic compatibility involving emissions and immunity. Fail-safe state: Defined condition intended to minimise hazard after failure. Review QuestionsShort Answer Questions- Distinguish accuracy from precision in sensor measurements.
- Why is an anti-aliasing filter placed before an ADC?
- State two reasons why a microcontroller GPIO should not directly drive a motor.
- What is the purpose of hysteresis in actuator control?
- Name two conditions that can justify galvanic isolation.
Long Answer Questions- Explain the complete measurement-and-control chain of an IoT node, including the roles of sensing, conditioning, conversion, computation and actuation.
- Discuss static and dynamic sensor characteristics and explain why both are needed in sensor selection.
- Compare I²C, SPI, UART and CAN with respect to topology, speed, robustness and design complexity.
- Explain the design of an analog interface from a resistive sensor to an ADC, including loading, amplification, filtering and calibration.
- Discuss power integrity, grounding, EMC and protection requirements in a mixed sensor–actuator embedded system.
Analytical / Application Questions- A 12-bit ADC has a 3.3 V reference and is connected to a sensor with sensitivity of 10 mV/°C. Calculate the nominal ADC code width in volts and its ideal temperature equivalent. Explain why this is not the complete temperature accuracy.
- Design a control strategy for a refrigeration actuator that avoids rapid switching near its temperature limit. Specify thresholds, timing constraints, sensor-failure behaviour and required diagnostics.
- Analyse the likely causes and corrective actions when a wireless IoT node shows sensor disturbances only during motor operation and occasionally resets when a relay opens.
Multiple Choice Questions with AnswersQuestion 1Which characteristic describes closeness of a measurement to the reference value? A. Accuracy B. Resolution C. Sensitivity D. Bandwidth Correct Answer: A. Accuracy Question 2For a first-order sensor, the output reaches approximately what fraction of its final step value after one time constant? A. 25.0% B. 50.0% C. 63.2% D. 99.9% Correct Answer: C. 63.2% Question 3A 12-bit ADC with a 3.3 V reference has an approximate code width of: A. 0.0806 mV B. 0.806 mV C. 8.06 mV D. 80.6 mV Correct Answer: B. 0.806 mV Question 4What is the primary purpose of a flyback diode across a DC solenoid coil? A. Increase the coil resistance B. Limit the voltage transient when current is interrupted C. Convert DC into AC D. Measure coil temperature Correct Answer: B. Limit the voltage transient when current is interrupted Question 5Which interface commonly uses open-drain SDA and SCL lines with pull-up resistors? A. SPI B. UART C. I²C D. PWM Correct Answer: C. I²C Question 6If a sensor output is y = 0.02x + 0.1, what is y when x = 50? A. 0.5 B. 1.0 C. 1.1 D. 2.5 Correct Answer: C. 1.1 Question 7Why is hysteresis used in a temperature-controlled relay system? A. To increase ADC resolution B. To prevent rapid switching near a threshold C. To eliminate all sensor noise D. To increase the relay coil voltage Correct Answer: B. To prevent rapid switching near a threshold Question 8Which actuator-control quantity is defined as t_on/T? A. Sensitivity B. Duty ratio C. Common-mode rejection D. Quantisation error Correct Answer: B. Duty ratio Question 9Which statement about a 4–20 mA industrial loop is generally correct? A. It is intended only for short PCB traces B. It is relatively robust for transmitting measurements over long cables C. It cannot indicate wiring faults D. It is always a wireless protocol Correct Answer: B. It is relatively robust for transmitting measurements over long cables Question 10Which action best addresses a sensor reading disturbed when a motor starts? A. Remove all signal validation B. Increase GPIO output current beyond its rating C. Improve power separation, decoupling, grounding and filtering D. Disable the motor’s protective circuitry Correct Answer: C. Improve power separation, decoupling, grounding and filtering
|