Chapters

12 Sensor Circuits: Conditioning and Filters

sensors
sensor
circuits
signal

Prerequisites: Sensor Circuit Fundamentals | Electronics Fundamentals

This enables: ADC and Noise Reduction | Sensor Interfacing

12.1 Overview

This first route shapes small sensor signals with amplification, filtering, protection, and calculated interfaces.

This is part 1 of 2. Continue with Sensor Circuits: Bridges and Noise for the second focused route.

Start With the Measurement Story

Protect the Meaning of a Weak Signal

An analog-to-digital converter is a part that turns a voltage into a number. It is often called an ADC. Picture a strain sensor on a water tank. Its useful change is tiny, while motors, long wires, heat, and the power supply can add much larger unwanted changes.

Begin with the real range the sensor must measure. Record its smallest useful change, safe voltage limits, noise sources, and how fast the physical value can move. Then choose gain to use the converter range without clipping. Add a filter only when its time response still fits the job.

Test zero, mid-range, and full-range inputs. Switch nearby loads, change cable position, and apply a value just beyond the safe limit. Compare the raw voltage, the conditioned voltage, the final number, and a trusted reference. A clean number is not proof if the chain hid a fault.

One bench result cannot cover every part, temperature, or installation. The deeper sections explain bridges, amplifiers, filters, and conversion maths so each stage keeps a stated limit and test.

A raw sensor output is rarely ready for a dashboard or control loop. The first design move is to identify what must be amplified, filtered, level-shifted, isolated, or protected before the reading can be trusted.

12.2 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.

Chapter Roadmap
  1. First identify why raw sensor outputs need conditioning.
  2. Then inspect bridge circuits and millivolt signals.
  3. Next size gain and low-pass filtering for a 0-3.3V ADC.
  4. Finally apply the chain to thermistors, load cells, noise, grounding, and anti-aliasing.

Checkpoints recap each design decision; deeper circuit details support a first read.

Key Concepts

Start with 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. Then 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. Next 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. After that 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. Continue by 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. Continue by 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. Continue by 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. Finally 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.

12.3 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.

12.4 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.

Start with the whole chain before choosing parts: gain, noise, safe voltage range, then ADC conversion.

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)

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

Step 2: Filtering (Removing Noise)

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

Step 3: Level Shifting (Voltage Matching)

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

Step 4: ADC Conversion (Digitization)

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

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

The mathematical gist. A 20.0 mV sensor span multiplied by the chapter’s practical 150× gain fills 3.00 V of a 12-bit ADC, giving 0.732 mV/count and about 0.00488 C/count for a 1 mV/C sensor. Its 16 kohm, 1 uF low-pass has fc=9.95f_c=9.95 Hz and attenuates 60 Hz by 15.7 dB; gain, filtering, and buffering therefore protect different parts of the same measurement chain.

Math Bridge · guided foundationsHow does 20 mV become useful ADC resolution?Let Phoebe connect bridge voltage, gain, converter bins, and the chapter's 10 Hz filter.

12.5 Signal Processing Pipeline Overview

Before designing individual circuits, locate each source of measurement quality in the complete signal path. Use Figure 12.1 to follow one physical quantity all the way to an IoT action, noting where the signal is still analogue and where it has become data.

Physical quantity passes through sensor transduction, signal conditioning, ADC conversion, digital processing and output or action. Gain, filtering and voltage matching happen before conversion.
Figure 12.1: Complete Sensor Signal Processing Pipeline: Physical to Digital to Action

Read Figure 12.1 from left to right. The physical quantity is transduced into an electrical signal; conditioning scales and filters it before conversion; the ADC produces codes; digital processing turns codes into evidence; and the output stage uses or transports the result. An error introduced before conversion can be labelled downstream but not reconstructed, which is why the bridge, thermistor, and gain circuits in this chapter belong inside an end-to-end chain.

Key Pipeline Stages:

StagePurposeExample ComponentsTypical Issues
1. PhysicalMeasure real-world phenomenonTemperature, light, pressureEnvironmental interference
2. TransductionConvert to electrical signalThermistor, LDR, piezo sensorSensor drift, non-linearity
3. ConditioningPrepare signal for ADCOp-amps, RC filters, dividersInsufficient gain, wrong cutoff
4. ADC ConversionDigitize analog signalESP32 12-bit ADC, ADS1115Noise, quantization error
5. Digital ProcessingExtract meaningful dataAveraging, Kalman filterAlgorithm complexity, latency
6. Output/ActionUse the dataDisplay, relay, MQTTCommunication failures, delays

The stage map explains where work happens, but a practical design must also decide what to trade. Use Figure 12.2 as a review route: inspect cost, power, speed, and complexity from top to bottom, then test whether each proposed response changes another constraint.

Sensor circuit trade-offs compare hardware filtering, duty cycling, sample averaging and modular blocks. Cost, power, speed/noise and simplicity/features require different compromises.
Figure 12.2: Sensor Circuit Design Trade-offs: Cost, Power, Speed, and Complexity

Read Figure 12.2 as paired starting strategies rather than universal answers. An RC network can cheaply limit bandwidth; duty cycling changes when measurements are available; averaging reduces uncorrelated noise while adding latency; and modular blocks contain complexity without removing it. Carry those consequences into the component calculations below so that conditioning is justified by a measurement requirement, not added as decoration.

12.6 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.

The bridge makes the problem visible: a real physical change may only move the output by millivolts.

To understand why a Wheatstone bridge can reveal tiny resistance changes, inspect Figure 12.3 before reading its balance rule. The visual exposes the two divider branches whose midpoint voltages are compared.

A Wheatstone bridge pairs three fixed resistors with a variable sensor and amplifier. The balance equation gives zero output when the bridge is balanced.
Figure 12.3: Wheatstone Bridge: Four-resistor configuration for detecting small resistance changes with high precision.

Read Figure 12.3, trace each supply-to-ground branch separately, then compare the two centre nodes that form the differential output. Equal resistor ratios balance the bridge; a change in the sensing arm unbalances it, linking mechanical or thermal change to the small voltage that requires amplification. 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

12.6.1 Wheatstone Bridge Sensitivity Calculator

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

Set the excitation voltage and nominal arm resistance to match the proposed bridge, then vary the resistance change over the sensor’s credible full-scale range. Compare Output voltage (approximate) with Output voltage (exact): close agreement shows that the small-change approximation is safe around balance, while divergence warns that the sensing arm has moved too far into the divider’s curved response. Next compare the millivolt output with the chosen ADC input range. The calculator’s result is not yet a measurement resolution; it is the differential signal available to an instrumentation amplifier. Use the displayed magnitude to select gain with headroom for offset and overload, and retain the exact result as the check against the linear approximation used in firmware or design notes.

Physics PhoebeCheckpoint: Bridge Signals
  • A balanced Wheatstone bridge starts at zero output voltage.
  • A 350ohm bridge with a 0.1% change and 5V excitation produces about 1.25mV.
  • High input impedance and common-mode rejection protect that tiny differential signal.

12.7 Signal Conditioning Chain

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

After the bridge, the chain prepares the signal for conversion: amplify, filter, shift, buffer, sample.

Before sizing individual components, inspect Figure 12.4 to see how each conditioning stage prepares the signal for the next boundary.

Read Figure 12.4 from the weak sensor output through gain, filtering, level shifting, sampling, and conversion. That order connects noise and range decisions to the final digital measurement instead of treating each circuit as an isolated recipe.

Sensor conditioning runs through amplification, noise filtering, galvanic isolation and A/D conversion to digital output. A component table links each stage to functions and applications.
Figure 12.4: Signal conditioning prepares a small sensor signal for ADC conversion through gain, filtering, level shifting, and sampling.

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

Each stage addresses specific signal quality issues:

StageFunctionTypical Components
AmplificationBoost weak signals to full ADC rangeInstrumentation amplifier (INA128, AD620)
FilteringRemove noise above Nyquist frequencyRC low-pass, active filters
Level ShiftingMatch sensor output to ADC input rangeVoltage divider, op-amp buffer
BufferingProvide high-impedance input isolationUnity-gain op-amp

12.7.1 Gain and ADC Resolution

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

12.7.2 RC Low-Pass Filter Designer

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

Start with the highest signal frequency the application must preserve, then choose a cutoff above that band but below frequencies that would alias at the ADC’s sample rate. Enter a practical resistor and inspect the calculated ideal capacitance alongside its nearest E12 value; the standard component changes the realised cutoff, so use that realised value for the sampling check. The resistor cannot be chosen from filter maths alone: a very large value can raise thermal noise and may prevent the ADC sampling capacitor from settling, whereas a very small value increases loading and requires a larger capacitor. After selecting the pair, verify attenuation at the first unwanted frequency and confirm that the ADC sample rate still satisfies Nyquist for the filtered bandwidth. This connects the component choice to the acquisition boundary rather than treating the calculator as a parts lookup.

The photographs below make load cell (wheatstone-bridge weight sensor) a physical comparison: look for changes in package, exposed interfaces, mounting, scale, and service access before treating the forms as interchangeable.

Real photograph of load cell (wheatstone-bridge weight sensor)
This real example (DTB miniature load cell) shows a physical form of load cell (wheatstone-bridge weight sensor). Use the visible package, interfaces, scale, mounting, and surrounding context as evidence; a catalogue label alone does not establish deployment fit. Photo: Daraceleste; CC BY-SA 4.0
Real photograph of load cell (wheatstone-bridge weight sensor)
This real example (HTC load cell) shows a physical form of load cell (wheatstone-bridge weight sensor). Use the visible package, interfaces, scale, mounting, and surrounding context as evidence; a catalogue label alone does not establish deployment fit. Photo: Daraceleste; CC BY-SA 4.0
Real photograph of load cell (wheatstone-bridge weight sensor)
This real example (RELC load cell) shows a physical form of load cell (wheatstone-bridge weight sensor). Use the visible package, interfaces, scale, mounting, and surrounding context as evidence; a catalogue label alone does not establish deployment fit. Photo: Daraceleste; CC BY-SA 4.0

Read across the forms as engineering evidence. They share a capability name, but packaging and installation change the electrical, mechanical, environmental, and maintenance constraints.

Physics PhoebeCheckpoint: Gain and Filtering
  • A 10mV to 30mV sensor span is only 20mV, so a 3.3V ADC can need gain near 165x.
  • A 12-bit converter has 4096 levels; amplification decides how many counts the sensor actually uses.
  • A 10Hz RC cutoff can pass slow temperature changes while reducing 50Hz or 60Hz interference.

12.8 Thermistor Signal Conditioning

HVAC Thermistor Conditioning

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.

Before sizing gain for the HVAC example, inspect Figure to anchor the calculation in the differential amplifier that must handle the thermistor’s millivolt signal. Package pins and circuit limits remain part of the design even when the arithmetic is correct.

A gold metal-can AD520J instrumentation amplifier integrated circuit with two rows of pins
The INA128 selected in this exercise is a modern instrumentation amplifier; the photographed AD520J is an earlier member of the same single-chip component class, built to amplify small differential sensor signals before conversion. Photo: Mister rf, CC BY-SA 4.0

Read Figure, begin with the paired input pins that receive the small differential signal, then relate the gain-setting and output connections to the ADC range. The photographed component represents the amplifier class; the specified INA128 and its datasheet values govern the actual circuit below.

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: Gain=VADC_rangeVsensor_range=3.3V0.020V=165\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: RG=50kΩG1=50kΩ149=335Ω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: fc=10Hz (well below 60Hz noise)f_c = 10 \text{Hz (well below 60Hz noise)} RC=12πfc=12π×10=15.9msRC = \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):

Vsensor=40μV/°C×500°C=20,000μV=20 mV (full scale)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:

Gain=VADC_maxVsensor_max=3.3V0.020V=165\text{Gain} = \frac{V_{ADC\_{max}}}{V_{sensor\_{max}}} = \frac{3.3V}{0.020V} = 165

Instrumentation amplifier (INA128) gain formula:

G=1+50kΩRGG = 1 + \frac{50k\Omega}{R_G}

Solving for RGR_G:

RG=50kΩG1=50,000Ω164=305Ω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:

ADC step size=3.3V212=3.3V4096=0.806 mV/count\text{ADC step size} = \frac{3.3V}{2^{12}} = \frac{3.3V}{4096} = 0.806\text{ mV/count}

Temperature resolution:

ΔT=0.806 mV167×40μV/°C=0.806 mV6.68 mV/°C=0.12°C/count\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.

The thermistor example is voltage-range sizing. The load-cell example is the bridge version: full scale can still mean millivolts.

12.9 Strain Gauge Bridge Gain

12.10 Continue to Part 2

Continue with Sensor Circuits: Bridges and Noise.