28  ::: {style=“overflow-x: auto;”}

title: “Signal Processing Practice and Lab” difficulty: intermediate —

In 60 Seconds

Many IoT sensors (thermistors, photoresistors, Hall effect) have non-linear responses requiring linearization. Four methods ranked by practicality: piecewise linear approximation (best balance of accuracy, speed, and memory for most IoT), lookup tables (fastest but memory-heavy), polynomial fits like Steinhart-Hart (highest accuracy for full range), and Taylor series (fastest computation but only accurate near one operating point). Start with piecewise linear using 3-5 segments; upgrade to polynomial only if accuracy demands it.

28.1 Learning Objectives

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

  • Apply linearization techniques: Select and implement Taylor series, piecewise linear, lookup table, and Steinhart-Hart methods for non-linear sensors
  • Evaluate trade-offs: Compare linearization methods by memory footprint, computation speed, and accuracy for specific IoT applications
  • Diagnose aliasing artifacts: Calculate aliased frequencies from undersampled signals and design appropriate anti-aliasing filters
  • Implement digital filters on ESP32: Configure moving average, median, and exponential smoothing filters in embedded C/C++ code
  • Interpret FFT frequency spectra: Identify signal components, interference sources, and noise floor in sensor data using frequency domain analysis
  • Design multi-stage filter pipelines: Combine complementary filter types (median for spikes, low-pass for noise, EMA for smoothing) to achieve robust signal conditioning

Many sensors do not give you a simple, straight-line relationship between what they measure and what they output. A thermistor, for example, changes its resistance in a curved (non-linear) way as temperature changes. Linearization is the process of straightening out that curve so you can convert the sensor’s raw reading into an accurate measurement. Think of it like a ruler that has uneven markings – linearization gives you a correction table so you can still read the right distances.

28.2 Linearization: Handling Non-Linear Sensors

Time: ~10 min | Level: Intermediate | Unit: P02.C05.U08

Key Concepts

  • Operating Point: Taylor linearization only stays trustworthy near the chosen reference temperature, so always define the valid range before you commit to a simple line.
  • Method Trade-off: Piecewise linear is the normal default for IoT because it keeps memory, compute time, and accuracy in balance.
  • Calibration Data Quality: Lookup tables and polynomial fits are only as good as the calibration points used to build them.
  • Filter Sequencing: Median filters handle spikes, moving averages smooth random noise, and EMA filters trade responsiveness for cleaner trends.
  • Sampling Discipline: Aliasing cannot be repaired after sampling, so anti-aliasing and sample-rate choices still matter even in a “linearization” chapter.
  • FFT as a Diagnostic Tool: Frequency-domain inspection helps you choose the right filter instead of guessing from time-domain noise alone.
  • Lab Mindset: Measure the sensor, quantify the error, and then choose the simplest correction method that actually meets the requirement.

The Problem: Many sensors have non-linear responses. A thermistor’s resistance doesn’t change linearly with temperature - it follows an exponential curve.

Why Non-Linearity Matters:

  • Simple linear math (y = mx + b) doesn’t work
  • Errors compound across the measurement range
  • Real-time processing becomes complex

28.2.1 Linearization Using Taylor Series

The Solution: For small changes around an operating point, we can approximate non-linear functions as linear using Taylor series expansion.

Taylor Series (first-order approximation):

\[f(x) \approx f(x_0) + \frac{df}{dx}\bigg|_{x_0} \cdot (x - x_0)\]

In plain English: “Near any point, a curve looks like a straight line.”

Four-panel diagram of thermistor linearization. Panel one shows a curved thermistor resistance-versus-temperature response. Panel two marks a 25 degree Celsius operating point and the local tangent slope. Panel three shows the first-order Taylor linear approximation using offset plus sensitivity times delta temperature. Panel four highlights a narrow valid band around the operating point, with small error inside the band and large error outside it.

Sensor linearization workflow showing the original thermistor curve, the chosen operating point, the tangent-line approximation, and the narrow temperature band where the local linear model remains accurate
Figure 28.1

Linearization Process: Convert non-linear sensor response to linear approximation using Taylor series. Choose an operating point (e.g., 25C for temperature sensing), calculate the slope (sensitivity) at that point, and use linear model valid for small deviations. This enables simple signal processing with standard linear techniques.

28.2.2 Practical Linearization Example: Thermistor

Given: 10K NTC thermistor with B = 3950K, R0 = 10k ohm at T0 = 298K (25C)

Step 1: Write the non-linear equation \[R(T) = 10000 \cdot e^{3950 \left(\frac{1}{T} - \frac{1}{298}\right)}\]

Step 2: Choose operating point (T0 = 298K = 25C) \[R(298) = 10000 \, \Omega\]

Step 3: Calculate sensitivity (derivative) \[\frac{dR}{dT}\bigg|_{T_0} = R_0 \cdot \beta \cdot \left(-\frac{1}{T_0^2}\right) = 10000 \cdot 3950 \cdot \left(-\frac{1}{298^2}\right) \approx -445 \, \Omega/\text{K}\]

Step 4: Write linear approximation \[R(T) \approx 10000 - 445 \cdot (T - 298) \quad \text{(valid near 25C)}\]

Accuracy Check:

Temperature Actual R (ohm) Linear Approx Error
20C 12,488 12,225 2.1%
25C 10,000 10,000 0%
30C 8,057 7,775 3.5%
40C 5,326 3,325 37.6%

Key Insight: Linearization works well for ±5°C from the operating point, but fails dramatically for larger deviations (37.6% error at 15°C away). For wider ranges, use: - Multiple linearization zones (piecewise linear) - Lookup tables with interpolation - Full non-linear correction in software

Interactive Calculator: Thermistor Linearization Error

Explore how Taylor series linearization accuracy degrades as you move away from the operating point.

Thermistor linearization trade-off analysis for 0-50°C soil moisture sensor:

Full Steinhart-Hart equation (gold standard, highest accuracy): \(\frac{1}{T} = A + B \ln(R) + C (\ln(R))^3\) \(\text{Coefficients: } A = 0.001129, B = 0.000234, C = 8.76 \times 10^{-8}\) \(\text{Accuracy: } \pm 0.1°C \text{ over full 0-50°C range}\) \(\text{Computation: } 3 \text{ multiplies, } 1 \text{ natural log, } 2 \text{ divisions} = 120\mu\text{s on ESP32}\)

Piecewise linear (3 segments, our recommendation): Segment 1: 0-15°C, \(T = 0.00008R + 2.5\) Segment 2: 15-30°C, \(T = 0.00015R + 12.1\) Segment 3: 30-50°C, \(T = 0.00025R + 25.8\) \(\text{Accuracy: } \pm 1.5°C \text{ max error}\) \(\text{Computation: } 1 \text{ multiply, } 1 \text{ add, } 2 \text{ compares} = 15\mu\text{s on ESP32}\)

Taylor series (1st order, around 25°C): \(R(T) \approx 10000 - 445(T - 298)\) \(\text{Accuracy: } \pm 0.5°C \text{ for 22-28°C, } \pm 2°C \text{ for 20-30°C, } > 10°C \text{ error outside}\) \(\text{Computation: } 1 \text{ multiply, } 2 \text{ adds} = 8\mu\text{s on ESP32}\)

Lookup table (51 entries, 1°C steps): \(\text{Memory: } 51 \times 2 \text{ bytes} = 102 \text{ bytes}\) \(\text{Accuracy: } \pm 0.5°C \text{ (with linear interpolation)}\) \(\text{Computation: } 1 \text{ array lookup, } 1 \text{ interpolation} = 60\mu\text{s}\)

Decision matrix for soil moisture IoT:

  • Required accuracy: ±2°C (soil thermal inertia makes 0.1°C meaningless)
  • Battery-powered: Yes → favor low computation
  • Temperature range: 0-50°C → wide, Taylor series unsuitable
  • Memory: 256KB flash → lookup table acceptable, but unnecessary
  • Winner: Piecewise linear (±1.5°C accuracy, 8× faster than Steinhart-Hart, 51× less memory than lookup table)

Key insight: Don’t over-engineer. Steinhart-Hart is 8× slower to compute the same soil temperature that has ±2°C natural variation. Save the battery for more samples, not pointless precision.

28.2.3 Alternative Linearization Methods

1. Piecewise Linear Approximation

Divide the range into segments, linearize each:

float linearize_thermistor(float resistance) {
    if (resistance > 8000) {
        // 20-28C range: y = mx + b
        return 0.00008 * resistance + 14.5;
    } else if (resistance > 4000) {
        // 28-40C range
        return 0.00015 * resistance + 22.1;
    } else {
        // 40-60C range
        return 0.00025 * resistance + 35.2;
    }
}

2. Lookup Table with Interpolation

Store pre-calculated values and interpolate:

// Lookup table: [resistance, temperature]
const float lut[11][2] = {
    {32650, 0}, {19900, 10}, {12490, 20},
    {10000, 25}, {8057, 30}, {5327, 40},
    {3603, 50}, {2488, 60}, {1752, 70},
    {1258, 80}, {919, 90}
};

float lookup_temperature(float resistance) {
    // Find bracketing entries and linearly interpolate
    for (int i = 0; i < 10; i++) {
        if (resistance >= lut[i+1][0] && resistance <= lut[i][0]) {
            float ratio = (resistance - lut[i+1][0]) / (lut[i][0] - lut[i+1][0]);
            return lut[i+1][1] + ratio * (lut[i][1] - lut[i+1][1]);
        }
    }
    return -999; // Out of range
}

3. Polynomial Fit

Use higher-order polynomial for better accuracy:

\[T = a_0 + a_1 R + a_2 R^2 + a_3 R^3\]

Coefficients determined by curve fitting to calibration data.


28.3 Choosing Linearization Method by Application

  • Piecewise Linear: 50 B, 15 µs, ±1.5°C. Start here for most IoT sensors because it balances speed, memory, and full-range usability.
  • Lookup Table: 122 B, 60 µs, ±0.5°C. Use when timing must be predictable and you can afford the memory.
  • Steinhart-Hart: 40 B, 120 µs, ±0.1°C. Use when precision matters more than CPU time, such as medical or laboratory thermometry.
  • Taylor Series: 20 B, 8 µs, ±0.5°C near the operating point only. Use when the sensor stays inside a narrow temperature window.

Real Application Examples:

  • Smart Thermostat (18-24°C range): Taylor series around 21°C is fast and accurate enough because the device lives in a narrow comfort band.
  • Agricultural Soil Sensor (-10°C to 50°C): Piecewise linear with 3 segments handles the wider range without paying the full polynomial cost.
  • Medical Thermometer (35-42°C, ±0.1°C required): Steinhart-Hart earns its extra compute time when the requirement is strict clinical accuracy.

Quick Decision Tree: 1. If the temperature range is under 10°C and ±0.5°C is acceptable, use Taylor Series. 2. If you need ±0.2°C or better, use Steinhart-Hart. 3. If memory is extremely tight, use Taylor Series or a 2-segment piecewise fit. 4. For everything else, default to Piecewise Linear.

Key Insight: Don’t over-optimize. Piecewise linear is “good enough” for most IoT, and you can always upgrade to Steinhart-Hart later if field testing reveals accuracy issues.

Check your understanding – match each linearization method to its best-fit application:

Place these linearization steps in the correct order for a thermistor-based temperature sensor:


28.4 Knowledge Check

Test your understanding of signal processing concepts with these practical scenarios.

You’re designing a predictive maintenance system for an industrial pump. The pump operates at 1800 RPM (30 Hz shaft rotation). Bearing defects typically show up as vibrations at 3-5x the shaft frequency.

Question: What is the minimum acceptable sampling rate for your accelerometer, and what rate would you recommend in practice?

Minimum: 300 Hz | Recommended: 750-1500 Hz

Step-by-step analysis:

  1. Identify signal frequencies:
    • Shaft rotation: 1800 RPM = 30 Hz
    • Bearing defect harmonics: 3-5x = 90-150 Hz
    • Maximum frequency of interest: 150 Hz
  2. Apply Nyquist theorem:
    • Nyquist minimum: fs > 2 x fmax
    • fs > 2 x 150 Hz = 300 Hz minimum
  3. Add practical safety margin:
    • Anti-aliasing filter rolloff isn’t perfect
    • Want 5-10x headroom for reliable detection
    • Recommended: 750-1500 Hz
  4. Consider available options:
    • Most MEMS accelerometers offer: 100, 200, 400, 800, 1600, 3200 Hz
    • Choose 800 Hz or 1600 Hz (5.3x or 10.7x Nyquist margin)

Why NOT higher?

  • 3200 Hz provides no additional information (signal only goes to 150 Hz)
  • Doubles power consumption vs 1600 Hz
  • Doubles data storage/transmission
  • No benefit for this application

You’re selecting an ADC for a precision temperature monitoring system. Your thermistor circuit outputs 0-3.3V corresponding to 0-100C. You need +/-0.5C accuracy.

Available ADCs:

  • 8-bit: $0.50, 10 uA
  • 10-bit: $0.80, 15 uA
  • 12-bit: $1.50, 50 uA
  • 16-bit: $5.00, 200 uA

Question: Which ADC provides sufficient resolution at minimum cost and power?

Recommendation: 10-bit ADC ($0.80, 15 uA)

Resolution calculation for each option:

ADC Levels Voltage Step Temp Resolution Meets +/-0.5C?
8-bit 256 12.9 mV 0.39C Barely
10-bit 1024 3.2 mV 0.098C Comfortable
12-bit 4096 0.8 mV 0.024C Overkill
16-bit 65536 0.05 mV 0.0015C Extreme

Analysis:

10-bit (0.098C resolution):

  • Quantization error: +/-0.05C
  • Leaves +/-0.45C margin for thermistor tolerance (1%), noise, drift
  • 5x better than 8-bit at 1.6x price
  • Power increase acceptable (15 uA vs 10 uA)

Key insight: Match ADC resolution to sensor accuracy. Your thermistor is +/-1% (+/-1C) at best, so any ADC finer than ~0.1C is measuring noise, not real temperature differences.

:::

Your accelerometer-based door sensor samples at 100 Hz to detect door open/close events (< 5 Hz motion). During testing, you notice the sensor sometimes detects “phantom” door events even when the door is stationary.

Investigation reveals: - Building HVAC system creates 60 Hz vibration - This 60 Hz signal is being aliased to appear as 40 Hz

Question:

  1. Explain why 60 Hz appears as 40 Hz with 100 Hz sampling
  2. What anti-aliasing filter cutoff frequency would you recommend?

1. Aliasing explanation:

When you sample a 60 Hz signal at 100 Hz (below the Nyquist rate of 120 Hz), the signal “folds” to a false frequency:

Aliased frequency = |fs - fsignal| = |100 - 60| = 40 Hz

The 60 Hz HVAC vibration appears as a 40 Hz signal in your sampled data, which looks like rapid door motion (8x faster than your 5 Hz door events).

2. Anti-aliasing filter recommendation:

Required specifications:

  • Passband: 0-5 Hz (door motion you want to detect)
  • Stopband: > 50 Hz (Nyquist frequency)
  • Stopband attenuation: At least 40 dB at 60 Hz (100x reduction)

Recommended: 4th-order Bessel filter with 20 Hz cutoff

Why Bessel?

  • Linear phase response (doesn’t distort door motion waveform)
  • 20 Hz cutoff gives 4x margin above 5 Hz door events
  • -36 dB at 60 Hz = 63x attenuation (HVAC vibration reduced from detectable to negligible)

Your outdoor air quality sensor measures PM2.5 particulate concentration. The sensor has significant noise due to airflow turbulence. You’ve collected sample data:

Readings (ug/m3): 23, 25, 24, 98, 26, 24, 25, 23, 27, 24

The 98 ug/m3 reading is clearly an outlier (perhaps a bug flew past the sensor).

Question: Compare using a 5-sample moving average vs. a 5-sample median filter. Which would you recommend and why?

Recommendation: Median filter for this application

Moving Average Analysis:

Window: [23, 25, 24, 98, 26]
Average: (23 + 25 + 24 + 98 + 26) / 5 = 196 / 5 = 39.2 ug/m3

The spike of 98 significantly pulls up the average, reporting 39.2 when the true value is ~24-25.

Median Filter Analysis:

Window: [23, 25, 24, 98, 26]
Sorted: [23, 24, 25, 26, 98]
Median: 25 ug/m3

The median completely ignores the outlier, reporting 25 ug/m3 (the correct value).

Key insight: Choose the filter that matches your noise characteristics. Impulsive noise (spikes, dropouts) -> median. Gaussian noise (thermal, quantization) -> moving average.


28.5 Additional Knowledge Check

Knowledge Check: Signal Processing Concepts Quick Check

Concept: Core signal processing principles for IoT applications.


28.6 Signal Processing Lab: ESP32 Wokwi Simulation

Interactive Lab Overview

This hands-on lab demonstrates key signal processing concepts using an ESP32 microcontroller simulation. You will explore:

  • Analog-to-Digital Conversion (ADC): Reading analog signals and understanding resolution
  • Low-Pass and High-Pass Filtering: Removing noise and isolating signal components
  • Moving Average and Exponential Smoothing: Practical noise reduction techniques
  • FFT Basics: Frequency domain analysis using the ESP32
  • Noise Reduction Techniques: Combining multiple methods for clean signals

Prerequisites: Basic understanding of analog signals, sampling, and digital filtering concepts from earlier sections of this chapter.

Time Required: 30-45 minutes

28.6.1 What You Will Learn

By completing this lab, you will:

  1. Configure ESP32 ADC parameters (resolution, attenuation, sampling rate)
  2. Implement digital filters in C/C++ for real-time signal processing
  3. Compare filter performance on noisy signals with different characteristics
  4. Understand trade-offs between filtering strength and response time
  5. Apply FFT analysis to identify frequency components in sensor data
  6. Design multi-stage filter pipelines for robust noise rejection

28.6.2 Lab Setup

Getting Started with Wokwi
  1. Click the simulator below to open the ESP32 environment
  2. Replace the default code with the complete signal processing code provided
  3. Click the green “Play” button to start the simulation
  4. Open the Serial Monitor (click the terminal icon) to see output
  5. Experiment by modifying parameters and observing the results

Static preview of the signal processing lab layout in Wokwi. It shows an ESP32 board wired to a potentiometer on GPIO 34, a compact control strip for ADC and filter experiments, and a serial monitor panel with raw and filtered sample values.

Preview of the ESP32 Wokwi lab showing an ESP32 board, a potentiometer feeding the ADC input, filter mode controls, and a serial monitor with sampled values

Open Wokwi ESP32 Workspace Open Wokwi Home

Use the preview as a visual reference while reviewing this chapter. Launch the live simulator in a separate tab for the actual hands-on steps and Serial Monitor interaction.

Simulator Tips
  • Click on the ESP32 to see available pins and their functions
  • Use the Serial Monitor to view processed signal data and statistics
  • The built-in potentiometer (GPIO 34) simulates an analog sensor input
  • Add components using the + button (search for “Potentiometer”, “LED”, etc.)
  • Adjust simulation speed using the clock icon if needed

28.6.3 Lab Exercises

Exercise 1: Understanding ADC Resolution

Objective: Observe how ADC resolution affects measurement precision.

Steps:

  1. Run the simulation and observe the raw ADC values
  2. Note the step size in the “ADC Configuration” output (~0.8 mV for 12-bit)
  3. Calculate the quantization noise: V_rms = LSB / sqrt(12)

Questions:

  1. What is the theoretical quantization noise for a 12-bit ADC with 3.3V reference?
  2. If you only need 0.1C temperature resolution with a 10mV/C sensor, how many bits are truly needed?

Expected Results:

  • Step size = 3.3V / 4096 = 0.8 mV
  • Quantization noise = 0.8 mV / sqrt(12) = 0.23 mV rms
  • For 0.1C with 10mV/C sensor: need 1mV resolution = 12 bits is adequate

Quick check – test your ADC resolution understanding before moving on:

Exercise 2: Comparing Filter Types

Objective: Understand the trade-offs between different filter approaches.

Steps:

  1. Start the simulation and let it run for 30 seconds to collect data
  2. Press ‘s’ to see detailed statistics
  3. Switch between filter modes (press 0-6) and observe the output
  4. Compare the noise reduction percentages for each filter

Questions:

  1. Which filter provides the best noise reduction?
  2. Which filter responds fastest to signal changes?
  3. When would you choose median filter over moving average?

Expected Results:

  • Moving average: ~65% noise reduction (8-point window)
  • EMA (alpha=0.1): ~70% noise reduction but slower response
  • Median: Excellent spike rejection, minimal smoothing
  • Pipeline: Best overall ~80% noise reduction
Exercise 3: FFT Frequency Analysis

Objective: Identify frequency components in a noisy signal.

Steps:

  1. Let the simulation run for at least 10 seconds
  2. Press ‘f’ to perform FFT analysis
  3. Identify the peaks in the frequency spectrum
  4. Relate the peaks to the synthetic signal components

Questions:

  1. What are the main frequency components in the test signal?
  2. How does the Nyquist frequency limit what you can detect?
  3. Why is the DC component (0 Hz) typically excluded from analysis?

Expected Results:

  • 5 Hz: Main signal component (largest peak)
  • 50 Hz: Power line interference
  • 120 Hz: Second harmonic
  • Broadband: Random noise floor

28.6.4 Expected Outcomes

After completing this lab, you should be able to:

Learning Outcomes Checklist

28.6.5 Real-World Applications

The techniques demonstrated in this lab apply directly to many IoT applications:

  • Temperature Monitoring: Slow changes with occasional spikes. Use Median + EMA so you reject outliers without making the trend look noisy.
  • Vibration Analysis: High-frequency components matter. Use Band-pass + FFT to isolate bearing or shaft signatures.
  • Heart Rate Monitoring: Useful signal at 0.5-3 Hz with 50/60 Hz interference. Use Band-pass + Notch.
  • Air Quality Sensors: Gradual trends plus turbulence spikes. Use Median + Low-pass.
  • Accelerometer Data: Motion detection and gravity removal. Use High-pass + Low-pass as a simple pipeline.
  • Power Monitoring: Strong line frequency and harmonics. Use Notch + Moving Average.
Key Takeaways from the Lab
  1. No single filter is best - Match your filter to your noise characteristics
  2. Pipeline multiple stages - Median for spikes, low-pass for high-frequency, EMA for smoothing
  3. Trade-offs matter - More smoothing = slower response to real changes
  4. FFT reveals hidden signals - Frequency analysis helps identify interference sources
  5. Resolution vs. noise - High ADC resolution is pointless if noise exceeds quantization

Common Pitfalls

A Taylor approximation around 25°C looks excellent near room temperature and then collapses when the sensor moves far away from that operating point. Always state the valid range on the same page as the equation, and switch to piecewise linear or polynomial correction when the operating window is wide.

Bad reference measurements produce beautifully wrong lookup tables and polynomials. Before curve fitting, verify the calibration points, units, ADC scaling, and reference thermometer or fixture you used to collect them.

If spikes come from EMI, a median filter helps. If the noise is broadband, a moving average or EMA helps. If the sensor is already aliasing, no digital filter can recover the missing information. Match the filter to the noise source instead of applying “more smoothing” by habit.

28.7 Summary

This chapter tied linearization, filtering, and lab practice into one workflow:

  • Non-linear sensors need translation: Thermistors and similar sensors do not map cleanly with a single y = mx + b equation.
  • Taylor series is local: It works near the operating point, not across the whole temperature range.
  • Piecewise linear is the practical default: It usually gives the best balance of compute cost, memory, and usable full-range accuracy.
  • Calibration quality sets the ceiling: Lookup tables and polynomial fits only help if the reference data is trustworthy.
  • Filtering is still contextual: Median, low-pass, EMA, and notch filters solve different noise problems and should be chosen from measured behavior.
  • The lab closes the loop: ADC setup, filtering, FFT inspection, and runtime trade-offs turn the math into an embedded workflow.

Five-stage diagram showing the chapter workflow. A non-linear thermistor curve feeds calibration data points, which become a runtime correction method such as piecewise linear or polynomial fit. The corrected stream then passes through digital filtering and produces a validated engineering output such as calibrated temperature for the application.

Linearization practice summary showing raw sensor curve, calibration data, selected runtime correction method, digital filtering, and validated engineering output
Figure 28.2

Complete Linearization Workflow: Start with the raw non-linear sensor curve, collect trustworthy calibration points, select the least-complex correction method that meets the accuracy target, and then filter the corrected samples only after the sampling and calibration steps are sound.

Key Takeaway

The most important signal processing decisions are about matching parameters to actual requirements: sample rate to signal bandwidth (not ADC maximum), ADC resolution to sensor precision (not maximum available), and linearization method to accuracy needs (piecewise linear for most IoT, polynomial for precision applications). Over-specifying any parameter wastes power, memory, and cost without improving data quality.

Sammy the Sensor had a problem – his thermistor friend was speaking in curves!

“When it’s cold, my resistance is HUGE. When it’s hot, it drops really fast. The relationship isn’t a straight line – it’s a curve!” explained the thermistor.

Max the Microcontroller had solutions: “I can translate your curved language into straight-line numbers using linearization!”

“Method 1: Lookup table – I memorize every possible reading and its temperature. Like a dictionary!” Max held up a huge book. Bella the Battery frowned: “That uses a lot of my memory space!”

“Method 2: Piecewise linear – I break the curve into a few straight-line segments. Like connecting dots!” Max drew 4 straight lines that closely followed the curve. “Much less memory!”

Lila the LED asked: “Which is best?” Max answered: “For most IoT work, piecewise linear with 3-5 segments gives you great accuracy with barely any memory or computation. Start simple!”

The lesson: Non-linear sensors speak in curves, but microcontrollers think in straight lines. Linearization is the translator between them!


28.8 What’s Next

You have completed the Signal Processing Essentials series. Use these next links to extend what you practiced here:

Concept Relationships: Linearization
  • Taylor Series -> Operating Point: Valid only close to one chosen temperature.
  • Piecewise Linear -> Memory/Speed: Best default balance for most IoT sensor ranges.
  • Lookup Table -> Deterministic Runtime: Fast lookup at the cost of extra memory.
  • Steinhart-Hart -> Accuracy: Better precision when the application can afford the math.

Cross-module connection: Sensor Circuits covers signal conditioning for non-linear sensors.