Overview

3 Sensing the real world

Digital twins depend on continuous sensing to stay synchronized with the physical world, transforming real-world changes into timely data that enables monitoring, optimization, and ultimately autonomous control. The chapter explains how sensors bridge this gap by converting physical phenomena into digital signals through a signal chain—physical change, transduction, conditioning, conversion, processing, and communication—and frames the sensing challenge around building a pragmatic, end‑to‑end architecture. Using a home deployment as a relatable example, it illustrates how clear objectives drive what to measure, how frequently to measure it, and how to ensure the twin remains an accurate reflection of reality.

Designing an effective sensing system starts by working backward from decisions: define the parameters that best indicate desired outcomes or failure modes, establish operating ranges and rates of change, and then select sensors with appropriate temporal resolution, range and sensitivity, accuracy and precision, environmental tolerance, and power profile. Practical constraints—power availability, installation and maintenance access, integration compatibility, data formats, and calibration needs—often dominate choices. Communication technologies are matched to range, data rate, and power trade-offs, from short‑range WiFi, BLE, and Zigbee/Thread to long‑range LoRaWAN, cellular, and satellite; hybrid networks are common. MQTT serves as a universal, decoupled transport with topic hierarchies that simplify integration across heterogeneous devices. Beyond electronic sensors, the chapter advocates blending edge processing, manual collection, file-based imports, and third‑party data to cover cost, bandwidth, and feasibility gaps.

Turning raw readings into useful information requires decoding heterogeneous payloads, standardizing structures, preserving metadata, and handling IoT’s characteristic volume, velocity, variety, veracity, and value variability—often with event‑driven, serverless processing. Techniques such as sensor fusion (for example, Kalman filtering) improve accuracy under noise and uncertainty, while edge AI can extract compact insights on-device to save bandwidth and power. Operating at scale introduces fleet management challenges: battery health, firmware updates, physical and logical asset tracking, calibration drift, and security posture, mitigated by automated monitoring, standardization, and bulk operations. The chapter closes with a layered blueprint—collect, connect, transport, and process—and guiding principles: embrace diverse collection methods, converge on open standards, design for evolution, balance automation with pragmatism, and build for resilience in the face of inevitable real‑world failures.

The sensor signal chain by which a change in the physical environment makes its way to the digital twin representation via an electronic sensor.
ch03 f01 biegel
Using a floor plan to select the optimal placement of sensors based on what parameters need to be measured, as well as the location of power outlets and taps. The local coordinates of each sensor relative to the origin point (close to the compass symbol at the top right of the image) in meters are also shown.
ch03 f03 biegel
An environmental sensor that measures nine different parameters, displaying some on an E Ink display, as well as transmitting them over LoRaWAN.
ch03 f04 biegel
Wireless communication technology exists on a spectrum of data rate, transmission range, and cost. Higher data rates work over shorter distances and require more power, whereas longer range communication typically means accepting lower data rates.
ch03 f05 biegel
A battery powered LoRaWAN flow meter installed on a garden tap and sending data to my home digital twin.
ch03 f06 biegel
A hybrid sensor network that uses LoRaWAN and WiFi to send electronic sensor readings to a common message broker.
ch03 f07 biegel
mqtt topic
An edge AI camera installed on my main water meter and sending data to my home digital twin
ch03 f08 biegel
The electricity consumption data that I currently have available from my provider on the left, compared with the fine grained data I will obtain with an optical sensor, right.
ch03 f09 biegel
The sensor data collection hub architecture where messages from multiple types of sensor are collected, decoded, and routed for storage.
ch03 f10 biegel
Output of the simple Kalman filter running against five noisy temperature sensors as shown in listing 3.5.
kalman
Complete sensing system architecture showing collect, connect, and transport layers.
ch03 f11 biegel
The route travelled by a reading from the LoRaWAN flowmeter attached to my garden tap.
ch03 f12 biegel

Summary

  • Sensors are the bridge between the physical and digital worlds, and update a digital twin with changes detected in the real world.
  • There are many types of sensors with different characteristics of resolution, sensitivity and accuracy and precision.
  • Consider carefully what you need to measure, the performance you require and practical constraints such as where you must measure and what infrastructure you need when selecting sensors for your digital twin.
  • Not every measurement that you need to take can be economically or practically captured by electronic sensors and manual sensing or integrating data that has been sensed by third parties is a critical aspect of capturing changes in the real world.
  • Sensors need to communicate their readings at differing rates and distances and there are a variety of communication technologies to choose from.
  • Sometimes you may not find the sensor that you require available off the shelf and will need to build your own.
  • Operating sensors reliably at scale brings challenges related to battery management, firmware updates, calibration and physical asset tracking that can be addressed by automated health monitoring, standardization and documentation.

FAQ

Why are sensors essential for a digital twin? Sensors continuously bridge the physical and digital worlds so the twin stays synchronized with reality. They capture changing conditions (for example temperature, vibration, flow, occupancy) and provide the dense, timely, and contextual data needed for a twin to evolve from descriptive monitoring to predictive analytics and ultimately autonomous control.
How does a physical change become digital data in a sensor signal chain? The common path is: - Physical change: the environment changes (temperature, motion, pressure, etc.). - Transduction: the sensing element converts it to an electrical signal. - Signal conditioning: amplification and filtering reduce noise. - Analog-to-digital conversion (ADC): samples and quantizes the signal. - Processing: calibration, linearization, and digital filtering. - Communication: formatted data is transmitted to the platform. Example: a thermistor’s tiny voltage change is amplified, digitized by an ADC, calibrated, then published.
What do sampling rate and quantization mean, and why do they matter? - Sampling rate (temporal resolution) is how often you read a signal; it must match how fast the parameter changes and how quickly decisions are needed. - Quantization (ADC resolution) maps a continuous signal to discrete steps; too few bits or long sampling intervals can miss important changes (for example a brief temperature drop between samples). Choose sampling and resolution to capture events your twin must detect.
Which sensor characteristics should I evaluate before selecting a device? - Temporal resolution: how frequently data is needed. - Measurement range and sensitivity: expected operating bounds and smallest detectable change. - Accuracy vs precision: closeness to true value vs repeatability; calibrate where possible. - Environmental tolerance: temperature, vibration, dust, moisture, safety ratings (for example IP65). - Power consumption: battery life vs wired power trade-offs that shape the whole sensing strategy.
How do I decide what to measure, where, and how often? Work backwards from objectives and decisions: - What outcome or failure mode are you targeting? - Which parameters change first (early indicators)? - How quickly does it change during normal operation (drives sampling rate)? - How much history is needed to establish baselines? - What’s the normal operating range (guides thresholds)? - What latency is acceptable from change to twin update (drives architecture and placement)?
How should I choose a communication technology (WiFi, BLE, Zigbee/Thread, LoRaWAN, cellular, satellite)? All technologies trade range, data rate, and power: - Short range: WiFi (high data, high power), BLE (very low power, short range), Zigbee/Thread (mesh, low power). - Long range: LoRaWAN (km-scale, very low power, low data), cellular (higher data, fees), satellite (global, expensive). Decide based on: coverage requirements, power constraints, data volume/rate, existing infrastructure, and total cost. Hybrid networks are common (for example LoRaWAN for battery sensors, WiFi for mains-powered devices).
Why use MQTT, and how should I structure topics? MQTT’s publish/subscribe model decouples producers and consumers, enabling easy scaling and evolution. Good practice: - Protocol translation to MQTT at the edge or cloud (for example LoRaWAN LNS). - Payload standardization to consistent JSON. - Preserve metadata (device ID, timestamps, quality). - Design a hierarchical topic scheme that reflects the asset structure (for example home/water/garden/flow_meter_1) and leverage wildcards (home/water/#).
When should I use edge processing, manual collection, or third‑party data? - Edge processing: when bandwidth/power are scarce or low latency is needed (for example OCR on a water meter image to send just the digits). - Manual collection: when automation is costly or impractical (for example pool chemistry). Make it sustainable with simple entry, immediate feedback, and reminders. - Third‑party data: use external sources (for example weather forecasts, utility data) instead of duplicating infrastructure.
How do I process and decode heterogeneous IoT payloads reliably? Account for IoT data characteristics (volume, velocity, variety, veracity, value): - Build serverless decoders that scale with bursts, handle JSON and compact binary/Base64 formats, and convert to a standard schema with units. - Add context and quality checks (range validation, anomaly handling). - Use sensor fusion (for example a Kalman filter) to improve estimates from noisy, overlapping measurements.
What are the key challenges in managing sensors at scale, and how can I address them? Challenges: - Battery management: monitor voltage and predict replacement. - Firmware updates: plan safe, chunked OTA with rollback (especially on LPWAN). - Physical asset tracking: maintain logical/physical locations and mounting records. - Calibration drift: schedule and track recalibration. - Security: rotate keys/certs, isolate compromised devices. Practical strategies: automated health monitoring, standardize device models, and support batch operations for updates and configuration.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Digital Twins in Action ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Digital Twins in Action ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Digital Twins in Action ebook for free