24  Signal Conditioning for Sensors

Prerequisites: Sensor Circuit Fundamentals | Electronics Fundamentals

This enables: ADC and Noise Reduction | Sensor Interfacing

In 60 Seconds

Signal conditioning transforms raw, weak sensor outputs into clean, properly scaled signals for ADC conversion. The key components are: amplifiers (boost millivolt signals to fill the ADC range for maximum resolution), Wheatstone bridges (detect tiny resistance changes in strain gauges and load cells with high precision), anti-aliasing filters (remove noise before digitization), and level shifters (match voltage ranges). A properly designed signal conditioning chain can achieve 100-200x better measurement resolution than a direct sensor connection.

Key Concepts
  • Instrumentation Amplifier: A differential amplifier with high input impedance and a single gain resistor; ideal for amplifying small differential signals from Wheatstone bridges and strain gauges in the presence of common-mode noise
  • Wheatstone Bridge: Four resistors in a diamond configuration where one or more are sensing elements; the differential output voltage is proportional to the resistance change and is immune to supply voltage variations
  • Common-Mode Rejection Ratio (CMRR): The amplifier’s ability to reject identical signals on both inputs while amplifying the difference; high CMRR (>80 dB) is critical for rejecting noise on long sensor cables
  • Anti-Aliasing Filter: A low-pass filter placed before the ADC to ensure no signal components above fs/2 reach the converter, preventing aliasing from misrepresenting high-frequency noise as false low-frequency signals
  • Rail-to-Rail Op-Amp: An op-amp whose output can swing to within millivolts of both supply rails; essential for single-supply 3.3 V designs where the conditioned signal must span the full ADC input range
  • Signal Offset Removal: Subtracting a DC offset from a sensor signal to center it in the ADC’s input range, maximizing dynamic range utilization for differential or bridge sensors
  • Gain-Bandwidth Product: The product of an op-amp’s gain and its bandwidth is approximately constant; higher gain settings reduce the usable bandwidth, limiting the maximum signal frequency that can be accurately amplified
  • Input Impedance Matching: The amplifier’s input impedance must be much higher than the sensor’s source impedance to prevent loading effects that would reduce the measured voltage and introduce gain errors

24.1 Learning Objectives

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

  • Design Signal Conditioning Chains: Construct complete pipelines from raw sensor output to ADC-ready signals
  • Calculate Amplifier Gain: Derive required gain to utilize full ADC range for maximum resolution
  • Implement Wheatstone Bridges: Configure bridge circuits for precision resistance measurements
  • Evaluate Worked Examples: Trace step-by-step calculations for real thermistor and strain gauge interfaces
  • Select Appropriate Components: Compare instrumentation amplifiers and filter components for specific applications

Imagine trying to listen to a friend whispering in a noisy stadium – you would need to amplify their voice and filter out the crowd noise. Signal conditioning does exactly this for sensor signals. It boosts weak electrical signals, removes unwanted noise, and adjusts voltage levels so the microcontroller can read them clearly and accurately.

24.2 Introduction

Raw sensor outputs are rarely suitable for direct connection to microcontroller ADCs. Signals may be too weak (millivolts from thermocouples), too noisy (interference from motors), or at the wrong voltage level (5V sensors on 3.3V MCUs). Signal conditioning transforms these problematic signals into clean, properly scaled inputs for accurate digital conversion.

How It Works: Complete Signal Conditioning Chain

Within the larger sensor pipeline, the signal conditioning block transforms weak, noisy sensor signals through four sequential stages:

Step 1: Amplification (Boosting Weak Signals)

  • Instrumentation amplifier with adjustable gain (1-1000x)
  • Formula: Gain = (Vref_ADC_max - Vref_ADC_min) / (Vsensor_max - Vsensor_min)
  • Example: 10mV sensor signal amplified 330x to fill 0-3.3V ADC range
  • Result: Maximizes ADC resolution, converts millivolts to measurable voltage

Step 2: Filtering (Removing Noise)

  • Low-pass RC filter or active filter removes frequencies above signal bandwidth
  • Cutoff frequency: fc = 1/(2πRC) set below noise, above signal
  • Example: 10Hz cutoff passes slow temperature changes, blocks 60Hz mains hum
  • Result: Clean signal with interference removed

Step 3: Level Shifting (Voltage Matching)

  • Voltage divider or op-amp circuit adjusts signal to MCU ADC input range
  • Converts bipolar (-5V to +5V) to unipolar (0 to 3.3V) if needed
  • Protects MCU from overvoltage damage
  • Result: Signal safely matches ADC specifications

Step 4: ADC Conversion (Digitization)

  • Sample-and-hold circuit captures instantaneous voltage
  • Successive approximation converts to N-bit digital value
  • Resolution: Vstep = Vref / 2^N determines precision
  • Result: Binary number representing calibrated physical measurement

This four-stage pipeline is the foundation of all professional sensor interfaces.

24.3 Signal Processing Pipeline Overview

Before designing individual circuits, understand the complete signal path:

Complete sensor signal processing pipeline showing six stages: (1) Physical domain capturing phenomena like temperature and light, (2) Sensor transduction converting to electrical signals (0-3.3V or 4-20mA current loops), (3) Signal conditioning with op-amp amplification, RC low-pass filtering, and voltage divider level shifting, (4) Analog-to-digital conversion using 12-bit ADC (0-4095 counts) with calibration correction factors, (5) Digital processing including software averaging for noise reduction, scaling to real-world units, and thresholding for decision logic, (6) Output stage distributing data to display, actuator control (relay/motor/LED), and network transmission via MQTT/HTTP protocols. Each stage flows sequentially from physical measurement to IoT action.
Figure 24.1: Complete Sensor Signal Processing Pipeline: Physical to Digital to Action

Key Pipeline Stages:

Stage Purpose Example Components Typical Issues
1. Physical Measure real-world phenomenon Temperature, light, pressure Environmental interference
2. Transduction Convert to electrical signal Thermistor, LDR, piezo sensor Sensor drift, non-linearity
3. Conditioning Prepare signal for ADC Op-amps, RC filters, dividers Insufficient gain, wrong cutoff
4. ADC Conversion Digitize analog signal ESP32 12-bit ADC, ADS1115 Noise, quantization error
5. Digital Processing Extract meaningful data Averaging, Kalman filter Algorithm complexity, latency
6. Output/Action Use the data Display, relay, MQTT Communication failures, delays

Design Considerations:

Design trade-offs flowchart showing four common sensor circuit design decisions and their practical solutions: Cost versus Performance solved with inexpensive hardware filtering using $0.50 resistor-capacitor components, Power versus Accuracy addressed through low-power duty cycling operating modes, Speed versus Noise managed with 64-sample software averaging to reduce signal variance, Simplicity versus Features balanced using modular reusable design blocks. Each trade-off decision links directly to its engineering solution approach.
Figure 24.2: Sensor Circuit Design Trade-offs: Cost, Power, Speed, and Complexity

24.4 Wheatstone Bridge

The Wheatstone bridge is a precision measurement circuit used with strain gauges, load cells, and other resistive sensors requiring high accuracy. It detects small resistance changes by comparing two voltage dividers.

Artistic illustration of a Wheatstone bridge circuit showing: four resistors (R1, R2, R3, and Rx as the unknown/sensor) arranged in a diamond configuration, excitation voltage applied across the top and bottom vertices, differential output voltage measured between left and right vertices, with the bridge balanced when R1/R2 = R3/Rx resulting in zero output voltage.

Wheatstone Bridge Circuit
Figure 24.3: Wheatstone Bridge: Four-resistor configuration for detecting small resistance changes with high precision.

Key Properties:

  • Balanced condition: When R1/R2 = R3/Rx, output voltage = 0V
  • Sensitivity: Small changes in Rx produce measurable differential voltage
  • Applications: Strain gauges (weight scales), pressure sensors, temperature measurement
  • Advantage: Common-mode rejection eliminates temperature drift and supply noise

24.4.1 Wheatstone Bridge Sensitivity Calculator

Calculate the output voltage of a Wheatstone bridge for a given resistance change in the sensor element.

24.5 Signal Conditioning Chain

Complete signal conditioning transforms raw sensor signals into clean, properly scaled inputs for ADC conversion.

Geometric illustration of a complete signal conditioning chain showing sequential processing stages: raw sensor output with millivolt-level signal, instrumentation amplifier for gain and common-mode rejection, low-pass anti-aliasing filter removing high-frequency noise, level shifter adjusting voltage range, sample-and-hold circuit for ADC timing, and final ADC conversion to digital value.

Signal Conditioning Chain
Figure 24.4: Signal Conditioning Pipeline: From millivolt sensor output to calibrated digital measurement.

Each stage addresses specific signal quality issues:

Stage Function Typical Components
Amplification Boost weak signals to full ADC range Instrumentation amplifier (INA128, AD620)
Filtering Remove noise above Nyquist frequency RC low-pass, active filters
Level Shifting Match sensor output to ADC input range Voltage divider, op-amp buffer
Buffering Provide high-impedance input isolation Unity-gain op-amp

24.5.1 Amplifier Gain and ADC Resolution Calculator

Use this interactive tool to calculate the optimal amplifier gain for your sensor-to-ADC interface and see the resulting measurement resolution.

24.5.2 RC Low-Pass Filter Designer

Calculate component values for an anti-aliasing RC low-pass filter given your desired cutoff frequency.

24.6 Worked Example: Thermistor Signal Conditioning

Worked Example: Thermistor Signal Conditioning for HVAC Monitoring

Scenario: You need to measure room temperature (15-35C) using an NTC thermistor for a smart HVAC system. The thermistor output is only 20mV at 25C, but your ESP32 ADC needs 0-3.3V input.

Given:

  • NTC thermistor output: 10mV at 35C, 30mV at 15C (20mV range)
  • ESP32 ADC: 12-bit, 0-3.3V input range
  • Target: Use full ADC range for maximum resolution
  • Noise environment: Office with fluorescent lights (60Hz interference)

Steps:

  1. Calculate required gain: To map 20mV range to 3.3V range: \[\text{Gain} = \frac{V_{ADC\_range}}{V_{sensor\_range}} = \frac{3.3V}{0.020V} = 165\] Use standard gain of 150 (close match with common resistor values)

  2. Design instrumentation amplifier: Using INA128 with gain set by single resistor: \[R_G = \frac{50k\Omega}{G - 1} = \frac{50k\Omega}{149} = 335\Omega\] Use 332 ohm standard resistor (gives G = 151.6)

  3. Design anti-aliasing filter: For 60Hz noise rejection and 1Hz temperature sampling: \[f_c = 10 \text{Hz (well below 60Hz noise)}\] \[RC = \frac{1}{2\pi f_c} = \frac{1}{2\pi \times 10} = 15.9 \text{ms}\] Use R = 16k ohm, C = 1uF (gives fc = 10Hz)

  4. Level shift for offset: Since thermistor outputs 10-30mV, after 150x gain we get 1.5-4.5V. Add voltage divider to shift into 0-3V range.

Result:

  • Amplified signal: 1.5V (at 35C) to 4.5V (at 15C)
  • After level shifting: 0V to 3.0V (fits ADC range)
  • 12-bit ADC resolution: 3.0V / 4096 = 0.73mV per step
  • Temperature resolution: 0.73mV / (150 x 1mV/C) = 0.005C per ADC step

Key Insight: By using full ADC range through proper amplification, we achieve over 150x better resolution than connecting the thermistor directly (which would use only 20mV of the 3.3V range).

Amplifier Gain Calculation for Maximum ADC Resolution: A thermocouple outputs 40μV/°C with 10mV output at 250°C. You need to measure 0-500°C range with ESP32’s 12-bit ADC (0-3.3V). What gain maximizes resolution without clipping?

Sensor output range (0-500°C): \[ V_{sensor} = 40\mu V/°C \times 500°C = 20{,}000\mu V = 20\text{ mV (full scale)} \]

Required gain to fill 3.3V ADC range: \[ \text{Gain} = \frac{V_{ADC\_{max}}}{V_{sensor\_{max}}} = \frac{3.3V}{0.020V} = 165 \]

Instrumentation amplifier (INA128) gain formula: \[ G = 1 + \frac{50k\Omega}{R_G} \]

Solving for \(R_G\): \[ R_G = \frac{50k\Omega}{G - 1} = \frac{50{,}000\Omega}{164} = 305\Omega \]

Use standard 301Ω resistor (1% tolerance) → actual gain = 167

ADC resolution after amplification: \[ \text{ADC step size} = \frac{3.3V}{2^{12}} = \frac{3.3V}{4096} = 0.806\text{ mV/count} \]

Temperature resolution: \[ \Delta T = \frac{0.806\text{ mV}}{167 \times 40\mu V/°C} = \frac{0.806\text{ mV}}{6.68\text{ mV/°C}} = 0.12°C\text{/count} \]

Comparison to direct connection (no amplification): - Signal span without amplification: 20mV → uses only 25 ADC counts (20mV / 0.806mV) - Temperature resolution: 500°C / 25 counts = 20°C per count (167x worse!)

With proper amplification, we achieve 0.12°C resolution instead of 20°C. The 167x gain improvement (from the INA128 with 301 ohm resistor) translates directly to 167x better measurement precision.

24.7 Worked Example: Strain Gauge Bridge Amplification

Worked Example: Strain Gauge Bridge Amplification for Load Cell

Scenario: A load cell for a beehive monitoring system uses a Wheatstone bridge with strain gauges. The bridge outputs only 2mV/V at full scale (50kg). You need to interface this with an Arduino Uno’s 10-bit ADC.

Given:

  • Load cell sensitivity: 2mV/V (with 5V excitation = 10mV full scale at 50kg)
  • Bridge output at 0kg: 0mV (ideally balanced)
  • Arduino ADC: 10-bit, 5V reference
  • Required accuracy: Better than 100g resolution

Steps:

  1. Calculate signal range:
    • At 50kg: 2mV/V x 5V = 10mV
    • At 0kg: 0mV
    • Signal range: 0-10mV
  2. Determine minimum required gain:
    • Arduino LSB: 5V / 1024 = 4.88mV
    • To detect 100g (0.2% of 50kg): need 0.002 x 10mV = 0.02mV resolution
    • Required gain to make 0.02mV visible: 4.88mV / 0.02mV = 244x minimum
    • Use gain of 500x for safety margin
  3. Select instrumentation amplifier: HX711 (dedicated load cell amplifier)
    • Built-in 128x gain option
    • 24-bit ADC (much better than Arduino’s 10-bit)
    • Includes filtering and offset compensation
  4. Calculate expected resolution with HX711:
    • Full scale output: 10mV x 128 = 1.28V (within 0-2.5V input range)
    • 24-bit ADC: 2^24 = 16,777,216 levels
    • Weight per LSB: 50kg / 16,777,216 = 0.003g per step

Result: Using HX711 provides 0.003g resolution, far exceeding the 100g requirement. Practical accuracy limited by load cell drift and noise, typically achieving 1-5g repeatability.

Key Insight: For precision measurements like load cells, dedicated signal conditioning ICs (HX711, ADS1231) outperform general-purpose solutions. They combine optimized gain, filtering, and high-resolution ADC in a single chip designed for the specific application.

24.8 Signal Conditioning Circuit Detail

Detailed signal conditioning circuit showing amplifier stage with instrumentation amplifier for gain and common-mode rejection, low-pass filter stage with RC components for noise removal, and level shifting stage for voltage range matching before ADC input.

Signal conditioning circuit detail for IoT sensors
Figure 24.5: Signal conditioning circuit showing amplification, filtering, and level shifting stages.

The generic sensing application flow below illustrates the complete signal path from physical measurement to usable data. Each stage introduces potential signal degradation, making proper signal conditioning essential for accurate IoT sensor readings.

Geometric block diagram of complete sensing system showing physical phenomenon input, sensing element transduction, signal conditioning with amplification and filtering, and output to data processing unit for IoT sensor integration
Figure 24.6: Generic sensing application flow from physical measurement to data processing

24.9 Noise Sources and Mitigation

Understanding where noise enters the signal path helps design effective mitigation strategies.

Noise sources and mitigation strategies diagram showing EMI high-frequency interference mitigated with shielding, ground loops causing 50/60Hz hum mitigated with star grounding, and thermal noise mitigated with sample averaging.
Figure 24.7: Noise diagnosis guide: EMI from motors and Wi-Fi adds high-frequency noise (mitigate with shielding). Ground loops cause 50/60Hz hum (use single-point ground). Thermal noise is always present (average samples). Combining hardware filtering with software averaging achieves clean readings even in noisy environments.
Minimum Viable Understanding: Noise Sources in Sensor Circuits

Core Concept: Sensor signals are corrupted by three main noise sources - EMI (high-frequency interference from motors/radios), ground loops (50/60Hz hum from multiple ground connections), and thermal noise (random fluctuations inherent to all electronic components). Why It Matters: In industrial IoT deployments, unmitigated noise can produce ADC reading variations of 5-15% of full scale, causing false alarms, missed events, and unreliable control loops that waste energy or create safety hazards. Key Takeaway: Apply a two-stage defense - use hardware filtering (RC low-pass with cutoff above your signal frequency but below noise) to remove high-frequency EMI, then apply software median filtering to reject impulse spikes before averaging for thermal noise reduction.

24.10 Analog vs Digital Sensor Tradeoff

Tradeoff: Analog Signal Chain vs Digital Sensor

Decision context: When selecting sensors for a new IoT design, choosing between raw analog sensors with custom signal conditioning versus integrated digital sensors with built-in ADC.

Factor Analog Signal Chain Digital Sensor (I2C/SPI)
Power Lower sensor power; conditioning circuit adds 1-10mA Higher sensor power (built-in ADC, processor); 0.1-5mA typical
Cost Lower sensor cost ($0.10-$5); conditioning adds $1-$10 Higher sensor cost ($2-$30); minimal external components
Accuracy Customizable; can optimize for specific application Fixed by manufacturer; often excellent out-of-box
Flexibility Full control over gain, filtering, sampling rate Limited to manufacturer’s configuration options
Development Time Longer (circuit design, PCB layout, calibration) Shorter (library exists, drop-in replacement)
Noise Immunity Susceptible to EMI on analog traces Digital signals resistant to noise; shielded internal ADC
Board Space Larger (op-amps, capacitors, resistors) Smaller (single IC, minimal passives)

Choose Analog Signal Chain when:

  • You need maximum flexibility in signal conditioning (custom filters, gains)
  • Lowest component cost is critical at high volumes (10,000+ units)
  • You require non-standard sampling rates or resolutions
  • The sensor type is only available as analog output (legacy, specialized)

Choose Digital Sensor when:

  • Development speed is prioritized over ultimate optimization
  • You need reliable, calibrated measurements without sensor expertise
  • PCB space is limited (wearables, miniaturized designs)
  • EMI/noise environment is challenging (industrial, motor-heavy)
  • Multiple sensors needed (I2C bus simplifies wiring)

Default recommendation: Digital sensors (I2C/SPI) for most IoT projects unless you have specific signal conditioning requirements that cannot be met by available digital sensors, or you are optimizing BOM cost at scale.

24.11 Ground Loop Pitfall

Pitfall: Ground Loop Noise in Multi-Sensor Systems

The Mistake: Running separate ground wires from each sensor back to the microcontroller, creating ground loops that inject 50/60Hz mains hum and motor noise into sensor readings.

Why It Happens: It seems logical to connect each sensor’s ground directly to the MCU ground pin. In reality, small voltage differences between ground points create circulating currents that couple noise into sensitive analog measurements.

The Fix: Implement star-ground topology:

  • Single ground point: All sensor grounds connect to ONE central point near the ADC
  • Ground plane: Use a copper pour on PCB as low-impedance ground reference
  • Twisted pairs: Run signal and ground wires twisted together (3-4 twists per inch)
  • Differential measurement: Use instrumentation amplifiers (INA128, AD620) for long cable runs

Specific values:

  • Ground loop voltage can reach 10-100mV in industrial environments
  • On 12-bit ADC (0.8mV/step), this adds +/-125 counts of noise
  • Twisted pair reduces magnetic pickup by 20-40dB
  • Adding 100nF ceramic capacitor from signal to ground at ADC input provides additional filtering

24.12 Voltage Divider and Bridge Circuits

The Wheatstone bridge (covered above) and simple voltage dividers are the two fundamental resistive sensor interface circuits. The voltage divider provides a simple output proportional to resistance ratio, while the bridge offers differential measurement with superior noise rejection.

Diagram showing voltage divider circuit with two resistors in series and output tap, and Wheatstone bridge with four resistors in diamond configuration and differential output. Illustrates how resistance changes in sensors create measurable voltage changes with formulas for output voltage calculation.
Figure 24.8: Voltage divider and Wheatstone bridge circuits for resistive sensors
Key Takeaway

Signal conditioning is the difference between garbage data and precision measurement. Raw sensor signals are almost never suitable for direct ADC connection – they need amplification (to use the full ADC range), filtering (to remove electrical noise), and level shifting (to match voltage requirements). For precision applications like load cells and strain gauges, dedicated signal conditioning ICs (HX711, INA128) outperform general-purpose circuits by combining optimized amplification, filtering, and high-resolution ADC in a single chip.

Sammy the Sensor was working in a factory, trying to measure the weight of honey jars on a conveyor belt. But there was a problem…

“My strain gauge signal is only 1.25 millivolts!” Sammy cried. “That’s like trying to hear a mouse whisper in a thunderstorm!”

Max the Microcontroller couldn’t read it. “Sorry Sammy, my ADC needs at least a few hundred millivolts to see anything useful. Your signal is just lost in the noise.”

Lila the LED had an idea. “What if we use a WHEATSTONE BRIDGE? It’s like a perfectly balanced seesaw. When no weight is on the scale, everything is balanced and the output is zero. But when a honey jar sits on it, the tiny change in the strain gauge tips the seesaw just a little bit!”

“But 1.25 millivolts is still too quiet!” Max protested.

“That’s where the AMPLIFIER comes in!” said Bella the Battery. “Think of it like this: the Wheatstone bridge whispers the weight reading, the amplifier is a super-powered hearing aid that makes the whisper 500 times louder! Now that 1.25 millivolt whisper becomes a nice, clear 625 millivolt shout!”

“And before the signal reaches me,” Max added, “it passes through a FILTER that removes all the buzzing from the factory motors. It’s like noise-canceling headphones for electrical signals!”

Sammy was amazed. “So the signal conditioning chain is: Bridge detects tiny change, Amplifier makes it louder, Filter cleans up the noise, then Max can read it perfectly?”

“Exactly! And with a special chip called the HX711, all of this happens in one tiny package. It can measure weights down to 0.003 grams – that’s lighter than a single grain of rice!”

“Signal conditioning really is a superpower!” Sammy beamed.

Common Mistake: Forgetting Anti-Aliasing Filters Before ADC Sampling

The Mistake: An industrial vibration monitoring system samples an accelerometer at 1 kHz (1000 samples/second) without any anti-aliasing filter between the sensor output and the ADC input. The system is supposed to detect bearing faults by analyzing vibration frequencies up to 400 Hz. During testing, engineers observe mysterious “ghost frequencies” around 150 Hz that don’t correspond to any actual mechanical vibration.

Why It Happens: The Nyquist-Shannon theorem states that you can only accurately represent frequencies up to half your sampling rate (called the Nyquist frequency). For 1 kHz sampling, the Nyquist frequency is 500 Hz. Any frequency components above 500 Hz in the input signal will “alias” — appear as false lower frequencies in the digitized data.

Real Example:

  • Sampling rate: 1000 Hz → Nyquist frequency: 500 Hz
  • Actual vibration at 650 Hz (above Nyquist)
  • Aliased frequency: |650 - 1000| = 350 Hz (false signal!)
  • This 350 Hz “ghost” corrupts your analysis

The Math Behind Aliasing:

If input frequency f_in > f_sampling / 2:
    f_alias = |f_in - n × f_sampling|
    where n is chosen to make f_alias < f_sampling/2

Example with 1 kHz sampling:
- 650 Hz input → appears as 350 Hz (650 - 1×1000 = -350, absolute = 350)
- 1200 Hz input → appears as 200 Hz (1200 - 1×1000 = 200)
- 2800 Hz input → appears as 200 Hz (2800 - 3×1000 = -200, absolute = 200)

Why It’s Dangerous:

  1. You can’t distinguish real from aliased signals in the digital data
  2. Multiple high frequencies can alias to the same low frequency (collision)
  3. Filtering after ADC doesn’t help — damage is already done

The Fix: Add an anti-aliasing filter (analog low-pass filter) BEFORE the ADC:

Design Steps:

  1. Determine maximum frequency of interest: 400 Hz (bearing fault signatures)

  2. Choose sampling rate: 1000 Hz (2.5× maximum frequency, provides margin)

  3. Calculate filter cutoff frequency:

    • Nyquist frequency: 500 Hz
    • Anti-aliasing filter cutoff: 450 Hz (between max interest and Nyquist)
    • Filter type: 2nd-order Butterworth for flat passband
  4. Implement RC filter:

    For 2nd-order (Sallen-Key):
    f_c = 450 Hz
    Using equal R and C: R = 10kΩ
    C = 1 / (2π × R × f_c) = 1 / (2π × 10k × 450) = 35 nF
    Use standard 33nF capacitors (close enough)

Filter Performance (2nd-order Butterworth, fc = 450 Hz): - At 400 Hz (max interest): -2.1 dB (78% of signal passes) - At 450 Hz (cutoff): -3.0 dB (71% of signal) - At 650 Hz (alias example): -7.3 dB (43% of signal) - At 1000 Hz: -14 dB (20% of signal)

Note: The -2.1 dB attenuation at 400 Hz is a tradeoff inherent to placing the cutoff close to the maximum frequency of interest. If signal preservation near 400 Hz is critical, increase the cutoff to 480 Hz (at the cost of less alias rejection), or use a higher-order filter (4th-order Butterworth gives only -0.5 dB at 400 Hz with the same 450 Hz cutoff).

Key Specifications: | Parameter | Value | Purpose | |:———-|:——|:——–| | Passband | 0-400 Hz | Preserve vibration signals of interest | | Transition band | 400-500 Hz | Gradual rolloff (steeper = more complex filter) | | Stopband | 500+ Hz | Attenuate frequencies above Nyquist | | Stopband attenuation | >12 dB/octave | 2nd-order rolloff; use 4th-order for >40 dB at Nyquist |

Real-World Impact:

Scenario Without Anti-Aliasing With Anti-Aliasing Filter
True 350 Hz fault Reads 350 Hz ✓ Reads 350 Hz ✓
650 Hz harmonic Aliases to 350 Hz ❌ (false positive) Attenuated -7 dB with 2nd-order filter; use 4th-order for better rejection ✓
EMI at 50 kHz Aliases to multiple low freqs ❌ (noise) Attenuated >60 dB ✓

Industry Best Practices:

  1. Sample at 2.5-5× your highest frequency of interest (not just 2×)
  2. Anti-aliasing filter cutoff at 0.4-0.45× sampling rate
  3. Use at least 2nd-order filter (4th-order for critical applications)
  4. Verify with spectrum analyzer before deployment
  5. Document filter specs in technical documentation

Quick Test: To verify your anti-aliasing filter is working, inject a known high-frequency signal (e.g., 800 Hz sine wave) into your system. If it correctly shows up as highly attenuated (or doesn’t appear at all) in your ADC data, your filter is working. If you see it aliased to a low frequency with significant amplitude, your filter is inadequate.

Cost-Benefit: A $0.25 RC filter (two resistors, two capacitors) prevents false alarms that could cost thousands in unnecessary maintenance or missed real faults. Anti-aliasing is mandatory for any system that processes signals with unknown high-frequency content.

24.13 Concept Relationships

This Concept Relates To Relationship Type
Instrumentation Amplifier Wheatstone Bridge Amplifies differential voltage from bridge output
Gain Calculation ADC Range Formula maps sensor output to full ADC span
Anti-Aliasing Filter Nyquist Theorem Removes frequencies above fs/2 before sampling
Common-Mode Rejection Noise Immunity CMRR rejects interference present on both inputs
Ground Loops Noise Source Single-point grounding prevents circulating currents

24.14 Summary

This chapter covered signal conditioning essentials:

  • Signal Processing Pipeline: Six stages from physical phenomenon to digital output
  • Wheatstone Bridge: Precision measurement of small resistance changes using differential voltage
  • Gain Calculation: Match sensor output range to ADC input range for maximum resolution
  • Instrumentation Amplifiers: High CMRR, adjustable gain, designed for bridge circuits
  • Noise Mitigation: Hardware filtering, grounding practices, and software averaging
  • Design Tradeoffs: Analog flexibility vs digital simplicity based on project requirements

24.15 See Also

Common Pitfalls

Most standard op-amps cannot swing their output all the way to the supply voltage — they saturate 1-2 V below the rail. For 3.3 V single-supply designs, use a rail-to-rail op-amp (e.g., MCP6001) to avoid clipping the conditioned signal before it reaches the ADC.

Setting excessive amplifier gain causes the ADC to clip when the sensor produces large outputs. Calculate the maximum sensor output, multiply by the gain, and confirm the result fits within 90% of the ADC reference voltage to leave headroom for noise and signal peaks.

Long unguarded analog traces running next to digital clock lines pick up switching noise through capacitive coupling. Keep analog signal traces short, route them away from high-frequency digital lines, and add a ground guard trace alongside sensitive analog paths.

Bridge sensitivity scales with excitation voltage, but higher voltage increases self-heating in the sensing resistor, changing its resistance and introducing error. Use the manufacturer’s recommended excitation voltage and avoid increasing it to improve sensitivity.

24.16 What’s Next

Chapter Description
ADC and Noise Reduction Analog-to-digital conversion challenges, resolution vs noise tradeoffs, and advanced filtering techniques
Sensor Interfacing and Processing I2C, SPI, and UART protocols for connecting conditioned signals to microcontrollers
Sensor Circuit Fundamentals Review voltage dividers, RC filters, and basic building blocks covered before this chapter
Analog and Digital Electronics Deeper ADC/DAC conversion theory and op-amp circuit analysis
Signal Processing Essentials DSP algorithms for further digital-domain filtering and analysis