29  Sensor Dynamics and Linearization

In 60 Seconds

Every sensor has dynamics – it takes time to respond to changes, modeled as a mass-spring-damper system with natural frequency and damping ratio. The critical design rule: sample at 2-5x the sensor’s bandwidth, not faster. A thermistor with 10-second time constant has 0.016 Hz bandwidth, so sampling at 0.1 Hz (every 10s) is sufficient – sampling at 1 kHz wastes power capturing only noise. For non-linear sensors, use piecewise linear approximation (3-5 segments) as the best balance of accuracy, speed, and memory for IoT applications.

29.1 Learning Objectives

By the end of this chapter, you will be able to:

  • Model Sensor Dynamics: Derive and interpret mass-spring-damper equations that describe why sensors do not respond instantly
  • Classify Damping Regimes: Distinguish between underdamped, critically damped, and overdamped sensor responses and predict their step-response behavior
  • Calculate Sampling Rates from Bandwidth: Compute sensor bandwidth from time constants and select appropriate sampling rates using the 2-5x bandwidth rule
  • Evaluate Linearization Trade-offs: Compare lookup table, piecewise linear, polynomial, and Taylor series methods for accuracy, speed, and memory usage on resource-constrained IoT devices
  • Design Efficient Sensing Pipelines: Combine sensor dynamics analysis with linearization selection to minimize power consumption while meeting accuracy requirements

Fundamentals:

Sensing:

29.2 Prerequisites

  • Signal Processing Overview: Sampling rate concepts
  • Basic physics: Understanding of mass, spring, and damping
  • Basic calculus: Understanding derivatives for linearization

29.3 Sensor Dynamics: Why Sensors Don’t Respond Instantly

⏱️ ~15 min | ⭐⭐⭐ Advanced | 📋 P02.C05.U07

Key Concepts

  • Bandwidth Comes from Physics: The useful sample rate is capped by the sensor’s own dynamics, not by the ADC datasheet.
  • Damping Ratio Shapes Response: Underdamped sensors overshoot, critically damped sensors settle fastest without ringing, and overdamped sensors feel sluggish.
  • Time Constant Drives Sampling: For first-order sensors, the time constant directly sets bandwidth and therefore the Nyquist floor.
  • Oversampling Has a Cost: Reading a slow sensor too often mostly buys extra noise, transmissions, and battery drain.
  • Linearization Is a Separate Problem: A sensor can be dynamically slow and also statically non-linear; you have to solve both.
  • Piecewise Linear Is the Practical Default: It usually offers the best balance of memory, speed, and sufficient accuracy on embedded devices.
  • Measure Before You Tune: Step-response tests, settling-time measurements, and calibration data should drive the design, not assumptions.

The Hidden Problem: You might think sensors measure instantly—apply heat to a thermistor and it reads the new temperature immediately. But in reality, every sensor takes time to respond. Understanding how sensors respond dynamically is crucial for designing accurate IoT systems.

Intuitive Explanation: Think about a bathroom scale. When you step on it:

  1. The dial doesn’t jump instantly to your weight—it bounces around first
  2. It overshoots (shows more than your weight briefly)
  3. It oscillates back and forth, getting closer each swing
  4. Finally settles at your actual weight after 1-2 seconds

This happens because the scale has mass (the platform moves), springiness (the spring stores energy), and friction (damping that slows oscillations).

Every sensor behaves similarly:

  • Temperature sensors have thermal mass—they take time to heat up or cool down
  • Pressure sensors have mechanical elements that deflect and settle
  • Accelerometers have tiny proof masses that oscillate before settling

Why This Matters for IoT:

  • If you sample too fast, you might read the sensor while it’s still bouncing
  • If you need fast response, you must choose sensors designed for it
  • Understanding sensor dynamics helps you filter data correctly

The Bottom Line: Sensors don’t give instant readings—they have dynamics governed by physical properties. Understanding these dynamics helps you design better sampling strategies and filters.

29.3.1 The Mass-Spring-Damper Model

Almost every sensor can be modeled as a second-order mechanical system consisting of three elements:

  1. Mass (m): Inertia that resists change
  2. Spring (k): Restoring force proportional to displacement
  3. Damper (c): Friction that dissipates energy

The differential equation:

\[m\frac{d^2x}{dt^2} + c\frac{dx}{dt} + kx = F(t)\]

Where: - \(x\) = displacement (sensor reading) - \(F(t)\) = input force (physical quantity being measured) - \(m, c, k\) = mass, damping, spring constant

Key Parameters:

  • Natural frequency: \(\omega_n = \sqrt{k/m}\) (how fast it oscillates)
  • Damping ratio: \(\zeta = \frac{c}{2\sqrt{mk}}\) (how quickly oscillations decay)

Damping Regimes:

  • Underdamped (ζ < 1): oscillates before settling. Common in low-cost mechanical or pressure sensors where ringing is visible after a step input.
  • Critically Damped (ζ = 1): settles as fast as possible without overshoot. This is the target behavior for many well-designed inertial sensors.
  • Overdamped (ζ > 1): slow, heavy response with no ringing. Typical of thermal sensors or assemblies with large thermal mass.

29.3.2 Step Response Characteristics

When you apply a sudden change (step input), sensors exhibit characteristic response curves:

Key Metrics:

  1. Rise Time (tr): Time to reach 90% of final value
  2. Settling Time (ts): Time to stay within ±2% of final value
  3. Overshoot: Maximum percentage above final value
  4. Bandwidth: Frequency at which response drops to 70.7% (-3dB)
Real-World Example: MEMS Accelerometer

ADXL345 Accelerometer Specifications:

  • Bandwidth: 1600 Hz (user-configurable: 25 Hz to 1600 Hz)
  • Rise time: ~0.6 ms (for 1600 Hz bandwidth)
  • Settling time: ~2 ms (for step input at 1600 Hz)
  • Damping: Near-critical (ζ ≈ 0.7)

Design Implications:

  • Sampling rate: Must be >3200 Hz to capture 1600 Hz bandwidth (Nyquist × 2)
  • Practical choice: 3200-5000 Hz sampling
  • Don’t oversample: 10 kHz wastes power without benefit—sensor can’t respond faster than 1600 Hz

Key Lesson: Sensor bandwidth limits useful sampling rate. Sampling faster than 2× sensor bandwidth captures only noise, not signal.

Sensor Bandwidth vs. Sampling Rate: Thermocouple (Type K) in stainless steel thermowell:

Physical parameters:

  • Thermocouple bead diameter: 1 mm
  • Thermowell wall thickness: 2 mm stainless steel
  • Air gap: 0.5 mm
  • Thermal time constant: \(\tau = 30\) seconds (measured in water at 1 m/s flow)

Bandwidth calculation: \[f_{3dB} = \frac{1}{2\pi\tau} = \frac{1}{2\pi \times 30} = 0.0053\text{ Hz}\]

Step response to 100°C → 200°C step: \[T(t) = 100 + 100 \times (1 - e^{-t/30})\]

At t = 30s: \(T = 100 + 100 \times (1 - e^{-1}) = 163.2°C\) (63.2% of step)

At t = 150s (5τ): \(T = 100 + 100 \times (1 - e^{-5}) = 199.3°C\) (99.3% settled)

Sampling rate selection:

  • Nyquist minimum: \(2 \times 0.0053 = 0.0106\) Hz → sample every 94 seconds
  • Practical (5× Nyquist): \(5 \times 0.0053 = 0.0265\) Hz → sample every 38 seconds
  • Wasteful: Sampling every 1 second = 38× oversampling = 38× power waste

Power calculation (LoRaWAN SF9 transmission at 120 mA, 150 ms): - Optimal (38s): \(\frac{24 \times 3600}{38} = 2274\) samples/day × 0.005 mAh = 11.4 mAh/day - Wasteful (1s): \(86400\) samples/day × 0.005 mAh = 432 mAh/day

With 2000 mAh battery: Optimal = 175 days. Wasteful = 4.6 days. 38× battery life difference.

Let’s trace how a thermistor-based temperature sensor responds to a sudden temperature change and why its dynamics determine optimal sampling strategy:

Scenario: NTC thermistor (10kΩ at 25°C, Beta = 3950) embedded in a weather station housing. Outside temperature suddenly drops from 20°C to 10°C when a cold front arrives.

Step 1: Physical Response (Sensor Dynamics)

  • Thermistor has thermal mass (glass bead, 0.5mm diameter)
  • Thermistor is inside plastic housing with air gap
  • Thermal time constant (τ): 10 seconds (time to reach 63.2% of final value)
  • Settling time (5τ): 50 seconds (time to reach 99% of final value)

Actual Temperature Response:

t=0s:   20.0°C (before cold front)
t=10s:  13.7°C (63.2% of 10°C drop = 6.3°C change)
t=20s:  11.4°C (86.5% of drop)
t=30s:  10.5°C (95.0% of drop)
t=40s:  10.2°C (98.2% of drop)
t=50s:  10.1°C (settled to final value ±0.1°C)

Step 2: Electrical Response (Resistance)

  • Thermistor resistance follows Steinhart-Hart equation (highly non-linear)
  • At 20°C: R = 12.1 kΩ
  • At 10°C: R = 19.9 kΩ
  • At t=10s (13.7°C): R = 16.8 kΩ

Step 3: Voltage Divider Circuit

  • Thermistor in series with 10kΩ fixed resistor, Vcc = 3.3V
  • Output voltage: V_out = 3.3V × R_therm / (R_therm + 10kΩ)
  • At t=0s: V_out = 3.3V × 12.1kΩ / 22.1kΩ = 1.81V
  • At t=10s: V_out = 3.3V × 16.8kΩ / 26.8kΩ = 2.07V
  • At t=50s: V_out = 3.3V × 19.9kΩ / 29.9kΩ = 2.20V

Step 4: ADC Sampling (Digital Conversion)

  • 12-bit ADC (0-4095 range), Vref = 3.3V
  • At t=0s: ADC reads 1.81V → 2248 counts
  • At t=10s: ADC reads 2.07V → 2568 counts
  • At t=50s: ADC reads 2.20V → 2730 counts

Step 5: Linearization (Firmware)

  • Apply inverse Steinhart-Hart equation: T = 1 / (A + B×ln(R) + C×ln(R)³)
  • Or use piecewise linear approximation with lookup table for faster computation
  • Output: Calibrated temperature value in °C

Step 6: Determining Optimal Sampling Rate

  • Sensor bandwidth: f = 1/(2πτ) = 1/(2π × 10s) ≈ 0.016 Hz
  • Nyquist minimum: 2 × 0.016 Hz = 0.032 Hz (sample once every 31 seconds)
  • Practical sampling: 0.1 Hz (sample once every 10 seconds = once per time constant)
  • Don’t do: Sample at 1 Hz (once per second) — captures redundant data, wastes power

Power Analysis:

  • Sampling at 0.1 Hz (optimal): 8,640 samples/day
  • Sampling at 1 Hz (10× oversampling): 86,400 samples/day
  • Transmission energy (assuming LoRaWAN): 10× more transmissions = 10× battery drain
  • Result: 1 Hz sampling reduces battery life from 5 years to 6 months (assuming transmission dominates power budget)

Key Insight: The thermistor’s 10-second thermal time constant creates a natural low-pass filter. Temperature physically cannot change faster than ~0.016 Hz, so sampling faster captures redundant data points along the same exponential curve. The ADC might read different values at 1 Hz, but they’re not independent measurements — they’re just different points on the same exponential settling curve.

Common Mistake: Engineers see a 12-bit ADC capable of 1 kHz sampling and assume “more data = better.” But the sensor’s thermal mass is the bottleneck, not the ADC. Sampling at 1 kHz captures thermal noise (±0.1°C variations from air currents, radiation) rather than true temperature trends.

Design Rule: Always check sensor bandwidth first, then set ADC sampling rate to 2-5× sensor bandwidth (not ADC max rate).

Important Design Rule: Match Sampling to Sensor Bandwidth

The Rule: Sample at 2-5× the sensor’s bandwidth, not its measurement range.

Example: Temperature Sensor (NTC Thermistor)

  • Thermal time constant: 10 seconds (τ = 10s)
  • Bandwidth: 1/(2πτ) ≈ 0.016 Hz
  • Nyquist requirement: >0.032 Hz
  • Practical sampling: 0.1 Hz (once every 10 seconds)
  • Don’t do: 1 kHz sampling—thermistor can’t respond faster than 0.016 Hz!

Why This Matters:

  • Sampling too fast wastes power and generates redundant data
  • Sampling too slow misses transient events
  • Match sample rate to sensor physics, not ADC capabilities
Knowledge Check: Sampling Rate Selection

A thermistor has a thermal time constant of 10 seconds. What is a practical sampling rate?

  1. 1000 Hz – sample as fast as possible
  2. 100 Hz – lots of safety margin
  3. 0.1 Hz (once every 10 seconds) correct
  4. 0.001 Hz (once every 1000 seconds)

C) 0.1 Hz. The sensor bandwidth = 1/(2 x pi x 10s) = 0.016 Hz. Nyquist requires >0.032 Hz; practical sampling at 0.1 Hz (once every 10 seconds) provides good margin. 1000 Hz would waste enormous energy sampling a sensor that can’t respond faster than 0.016 Hz.

29.3.3 Interactive Calculator: Sensor Bandwidth and Sampling Rate


29.4 Linearization: Handling Non-Linear Sensors

⏱️ ~12 min | ⭐⭐⭐ Advanced | 📋 P02.C05.U08

The Problem: Many sensors are non-linear—their output doesn’t scale linearly with the measured quantity.

Common Non-Linear Sensors:

  • NTC Thermistor: Resistance vs. temperature (exponential)
  • Photoresistor (LDR): Resistance vs. light (logarithmic)
  • Hall Effect: Voltage vs. magnetic field (polynomial)
  • Load Cell: Voltage vs. force (polynomial, hysteresis)

29.4.1 Method 1: Lookup Table

Simplest approach: Pre-compute a table of (ADC value → physical quantity) pairs.

Example: NTC Thermistor Lookup Table

const float tempTable[256] = {
    -40.0,  // ADC value 0
    -39.8,  // ADC value 1
    -39.6,  // ADC value 2
    // ... 253 more entries
    125.0   // ADC value 255
};

float getTemperature(uint8_t adc_reading) {
    return tempTable[adc_reading];
}

Linearization Method Comparison: NTC thermistor (10kΩ @ 25°C, Beta = 3950K) over 0-50°C:

Steinhart-Hart Equation (exact): \[\frac{1}{T} = A + B \ln(R) + C (\ln(R))^3\]

Coefficients: A = 1.129×10⁻³, B = 2.341×10⁻⁴, C = 8.775×10⁻⁸

Execution time: ~450 µs (Arduino @ 16 MHz, includes ln() and division)

Piecewise Linear (5 segments, 0-50°C): \[T = T_i + \frac{(T_{i+1} - T_i)}{(R_{i+1} - R_i)} \times (R - R_i)\]

Lookup table (6 points): [(32258Ω, 0°C), (19900Ω, 10°C), (12490Ω, 20°C), (8059Ω, 30°C), (5330Ω, 40°C), (3603Ω, 50°C)]

Example at R = 10,000Ω (between 20-30°C): \[T = 20 + \frac{30-20}{8059-12490} \times (10000-12490) = 20 + \frac{10}{-4431} \times (-2490) = 25.6°C\]

Execution time: ~25 µs (18× faster than Steinhart-Hart)

Accuracy comparison at R = 10,000Ω (actual = 25°C): - Steinhart-Hart: 25.00°C (exact) - Piecewise: 25.6°C (error = 0.6°C = 2.4%) - 3-segment piecewise: 26.2°C (error = 1.2°C = 4.8%)

Memory usage:

  • Steinhart-Hart: 12 bytes (3 float coefficients)
  • Piecewise (5 segments): 48 bytes (6 × (R, T) pairs as 4-byte floats)

Decision: For IoT with ±0.5°C sensor tolerance, piecewise with 5 segments offers 18× speed, acceptable 0.6°C error, at cost of 36 additional bytes.

Pros: Fast, simple Cons: Uses memory (256 floats = 1024 bytes), limited precision

29.4.2 Method 2: Piecewise Linear Approximation

Better approach: Divide non-linear curve into linear segments.

float getTemperature(uint16_t adc) {
    if (adc < 500) {
        // Segment 1: -40°C to 0°C
        return -40.0 + (adc / 500.0) * 40.0;
    } else if (adc < 3000) {
        // Segment 2: 0°C to 50°C
        return 0.0 + ((adc - 500) / 2500.0) * 50.0;
    } else {
        // Segment 3: 50°C to 125°C
        return 50.0 + ((adc - 3000) / 1096.0) * 75.0;
    }
}

Pros: Memory-efficient (only stores breakpoints), good accuracy Cons: Slightly more complex

29.4.3 Method 3: Polynomial Fit (Steinhart-Hart for Thermistors)

For high accuracy: Use polynomial approximation.

Steinhart-Hart Equation (for NTC thermistors):

\[\frac{1}{T} = A + B\ln(R) + C(\ln(R))^3\]

Where: - \(T\) = temperature in Kelvin - \(R\) = resistance in ohms - \(A, B, C\) = calibration constants (from datasheet)

Example Implementation:

float getTemperature(uint16_t adc) {
    // Convert ADC to resistance
    float R = 10000.0 * (4096.0 / adc - 1.0);

    // Steinhart-Hart coefficients (example)
    float A = 0.001129148;
    float B = 0.000234125;
    float C = 0.0000000876741;

    float logR = log(R);
    float T_kelvin = 1.0 / (A + B*logR + C*logR*logR*logR);

    return T_kelvin - 273.15;  // Convert to Celsius
}

Pros: High accuracy across full range Cons: Requires floating-point math, slower

29.4.4 Method 4: Taylor Series Linearization

For small deviations: Linearize around operating point.

Taylor Series Expansion:

\[f(x) \approx f(x_0) + f'(x_0)(x - x_0)\]

Example: Linearize NTC thermistor around room temperature (25°C).

// Operating point: T0 = 25°C, R0 = 10kΩ
// Sensitivity: dR/dT ≈ -400 Ω/°C at 25°C

float getTemperature(uint16_t adc) {
    float R = 10000.0 * (4096.0 / adc - 1.0);
    float dR = R - 10000.0;  // Deviation from R0
    return 25.0 + (dR / -400.0);  // Linear approximation
}

Pros: Very fast, simple Cons: Only accurate near operating point (±10°C for NTC)

29.4.5 Choosing a Linearization Method

  • Lookup Table: good accuracy, fast runtime, but memory-heavy (1-4 KB). Use when the ADC range is fixed and deterministic timing matters more than flash use.
  • Piecewise Linear: good accuracy, fast runtime, and low memory (<100 bytes). This is the default choice for general-purpose IoT sensors.
  • Polynomial: excellent accuracy with moderate runtime cost and low memory. Use when you need good full-range accuracy and can afford the math.
  • Taylor Series: very fast and tiny in memory, but only reliable for small deviations around the chosen operating point.

Recommendation: Start with piecewise linear (2-5 segments). Upgrade to polynomial if accuracy demands it.

Knowledge Check: Linearization Methods

Which linearization method is recommended as the starting point for most IoT applications?

  1. 24-bit polynomial fit
  2. Neural network approximation
  3. Piecewise linear approximation with 3-5 segments correct
  4. Exact analytical inverse function

C) Piecewise linear with 3-5 segments. It provides good accuracy with minimal memory (<100 bytes) and very fast computation (simple if-else and linear interpolation). Upgrade to polynomial (e.g., Steinhart-Hart) only if accuracy demands it.

29.4.6 Interactive Calculator: Thermistor Linearization Comparison


Scenario: You’re designing a smart HVAC system using a 10K NTC thermistor to measure room temperature. The system must detect temperature changes quickly enough to respond before occupants feel discomfort, but not waste energy by sampling too fast.


Step 1: Understand Thermistor Physical Dynamics

The thermistor is a first-order thermal system (similar to RC circuit):

\[T_{sensor}(t) = T_{initial} + (T_{final} - T_{initial}) \cdot (1 - e^{-t/\tau})\]

Where τ (tau) is the thermal time constant — the time for the sensor to reach 63.2% of the step change after a step input.

From datasheet: Your thermistor has τ = 10 seconds in still air.


Step 2: Calculate Sensor Bandwidth

Bandwidth of first-order system:

\[BW = \frac{1}{2\pi\tau} = \frac{1}{2\pi \times 10} = 0.0159 \text{ Hz}\]

This means the thermistor can only respond to temperature changes occurring slower than 0.016 Hz = once every 63 seconds.


Step 3: Apply Nyquist Theorem

Minimum sampling rate = 2 × bandwidth:

\[f_s > 2 \times 0.016 \text{ Hz} = 0.032 \text{ Hz}\]

This translates to one sample every 31 seconds (minimum).


Step 4: Add Practical Safety Margin

Engineers use 5-10× Nyquist for safety:

\[f_s = 5 \times 0.032 = 0.16 \text{ Hz} = \textbf{one sample every 6 seconds}\]

Or conservatively:

\[f_s = 10 \times 0.032 = 0.32 \text{ Hz} = \textbf{one sample every 3 seconds}\]


Step 5: Validate Against Application Requirements

HVAC comfort requirements:

  • Occupants notice ±0.5°C changes
  • Acceptable response time: detect change within 30 seconds
  • Room temperature changes: ~0.1°C/minute (very slow)

Analysis:

  • Room temp change rate: 0.1°C/min = 0.0017 Hz ✓ (well below 0.016 Hz sensor bandwidth)
  • Detection time @ 6 sec sampling: 30 sec / 6 sec = 5 samples to confirm trend
  • Thermistor settling: 3τ = 30 sec for 95% accuracy ✓

Conclusion: Sampling every 6 seconds is optimal.


Step 6: Calculate Energy Impact

Option A: Oversample at 1 Hz (once per second)

  • Samples per day: 86,400
  • ADC energy: 40 µA × 10 ms × 86,400 = 34.6 mAh/day
  • Wireless TX energy (1 reading/min): 120 mA × 50 ms × 1440 = 144 mAh/day
  • Total: 178.6 mAh/day

Option B: Optimal at 0.167 Hz (once per 6 seconds)

  • Samples per day: 14,400 (6× less)
  • ADC energy: 40 µA × 10 ms × 14,400 = 5.8 mAh/day (83% reduction!)
  • Wireless TX energy (same): 144 mAh/day
  • Total: 149.8 mAh/day (16% overall savings)

Battery Life (2000 mAh battery):

  • Option A (1 Hz): 2000 / 178.6 = 11.2 days
  • Option B (6 sec): 2000 / 149.8 = 13.4 days (+2.2 days = +19% longer life)

Step 7: What if You Ignored Sensor Dynamics?

Naive approach: “Sample as fast as possible for best data!”

Sampling at 10 Hz (every 100 ms):

  • Samples per day: 864,000
  • ADC energy: 40 µA × 10 ms × 864,000 = 346 mAh/day (10× worse!)
  • Battery life: 2000 / (346 + 144) = 4.1 days (67% shorter!)

What you get for 10× power consumption: Zero benefit

  • Thermistor bandwidth: 0.016 Hz
  • Sampling at 10 Hz captures: 0.016 Hz signal + 9.984 Hz of noise
  • All samples from 100-600 ms are essentially identical (sensor hasn’t moved)

Analogy: Photographing a glacier melting at 1000 frames/second. You get 1000 nearly-identical photos when 1 photo per hour would capture all the information.


Key Lessons:

  1. Sensor bandwidth, not ADC capability, determines useful sampling rate
    • Thermistor: 0.016 Hz bandwidth → sample at 0.16 Hz
    • MEMS accelerometer: 1000 Hz bandwidth → sample at 5000-10000 Hz
  2. Oversampling past sensor bandwidth captures only noise
    • 10 Hz sampling of 0.016 Hz signal = 99.84% wasted samples
  3. Energy savings are significant
    • Matching sampling to sensor dynamics: +19% battery life
    • Oversampling ignorantly: -67% battery life
  4. Time constant (τ) → bandwidth (1/2πτ) → sampling rate (5-10× BW)
    • This chain is fundamental to efficient IoT design

Practical Rule: Check sensor datasheet for time constant τ. If it says “10 second response time,” you should NOT sample faster than once per second (5-10× bandwidth of 1/2πτ).

Verification: Always test with real sensor — apply step input (move thermistor from room to hot water), plot response curve, measure actual time constant, adjust sampling rate accordingly.


Common Pitfalls

A fast ADC does not make a slow thermistor fast. If the sensor bandwidth is a few millihertz and you sample at hundreds of hertz, you mostly collect redundant values and extra noise while burning battery on pointless transmissions.

If a sensor seems “wrong” right after a step change, the issue may be settling time rather than bad calibration. Always separate time-domain response problems from static conversion problems before you start rewriting the transfer function.

Taylor linearization around room temperature may look excellent at 25°C and be badly wrong at 80°C. For thermistors and other curved sensors, widen the model with piecewise segments or a proper polynomial fit once the operating range grows.

29.5 Summary

This chapter covered advanced signal processing topics:

Sensor Dynamics:

  • All sensors have mass, spring, and damping—they don’t respond instantly
  • Key parameters: rise time, settling time, bandwidth
  • Critical rule: Sample at 2-5× sensor bandwidth, not faster

Linearization:

  • Many sensors are non-linear (thermistors, LDRs, Hall effect)
  • Four methods: lookup table, piecewise linear, polynomial, Taylor series
  • Best choice: Piecewise linear for most IoT applications

Design Guidelines:

  1. Check sensor datasheet for bandwidth/time constant
  2. Match sampling rate to sensor bandwidth (not ADC max rate!)
  3. For non-linear sensors, use piecewise linear approximation
  4. Don’t oversample—it wastes power without improving accuracy
Key Takeaway

Sensor bandwidth – not ADC capability – should determine your sampling rate. Every sensor has physical dynamics (mass, spring, damping) that limit how fast it can respond. Sampling faster than 2-5x the sensor’s bandwidth captures only noise, not signal, wasting power and bandwidth. For non-linear sensors (thermistors, LDRs, Hall effect), piecewise linear approximation with 3-5 segments provides the best balance of accuracy, computation speed, and memory usage for IoT applications.

Sammy the Sensor was bouncing on a bathroom scale, and the reading kept wobbling!

“Why doesn’t it show my weight instantly?” Sammy asked. Max the Microcontroller explained: “Because the scale has a spring! When you step on, it bounces up and down before settling. That’s sensor dynamics!”

“Every sensor is like that,” added Lila the LED. “Temperature sensors take time to heat up. Pressure sensors have tiny springs inside. Even accelerometers wobble before settling!”

Bella the Battery saw an opportunity: “So if Sammy’s thermistor takes 10 seconds to respond to temperature changes, there’s no point reading it 1000 times per second! I’d waste all that energy getting the same number over and over!”

Max did the math: “Exactly! The sensor’s bandwidth is 0.016 Hz, so sampling at 0.1 Hz – once every 10 seconds – is perfect. Sampling faster just captures noise, not real temperature changes.”

“And for non-linear sensors like thermistors,” Sammy added, “Max uses piecewise linearization – breaking the curve into a few straight-line segments. Simple and accurate enough for most jobs!”

The lesson: Match your sampling rate to what the sensor can actually respond to, and use simple math to straighten out curved sensor responses!

29.6 Knowledge Check

Concept Relationships: Signal Processing and Sensor Dynamics
  • Sensor Bandwidth -> Sampling Rate: sample at about 2-5× the real sensor bandwidth, not the ADC maximum.
  • Second-Order Dynamics -> Rise Time and Settling Time: mass, spring, and damping explain overshoot, ringing, and sluggish responses.
  • Non-Linear Sensors -> Linearization Methods: thermistors, LDRs, and Hall sensors often need piecewise linear, lookup-table, or polynomial correction.
  • Nyquist Theorem -> Aliasing Prevention: you still need at least the signal bandwidth, but going far beyond the sensor capability adds little value.

Cross-module connection: Signal processing feeds into data pipelines. See Sensor to Network Pipeline for ADC stage and Data Formats for encoding processed values.

29.7 See Also

29.8 What’s Next