Skip to content
RFrftools.io
SensorFebruary 27, 202613 min read

Sensor Signal Conditioning: Raw to Accurate

How to design the amplifier, filter, and ADC interface between a sensor and a microcontroller. Covers RTDs, thermocouples, load cells, current shunts, and.

Contents

What Is Signal Conditioning?

Pick up a sensor datasheet and you'll see outputs like 0.5 mV per degree, or 2 mV/V from a bridge, or maybe a few microamps from a photodiode. None of these signals can talk directly to your microcontroller's ADC. They're too small, too noisy, or sitting on the wrong voltage rail. That's where signal conditioning comes in — it's the analog front-end that takes whatever weird signal your sensor spits out and turns it into something clean and scaled that your ADC can actually use.

The typical signal chain looks like this: Sensor → Excitation → Amplification → Filtering → ADC

Here's the thing most people don't think about until it's too late: every single stage in that chain adds error. Your sensor might be spec'd at 0.1% accuracy, but by the time you've amplified it, filtered it, and digitized it, you could easily be sitting at 1% total system error if you're not careful. The Sensor Accuracy Budget calculator helps you track how all these errors stack up so you know what you're actually getting at the end of the day.


RTD Signal Conditioning (PT100 / PT1000)

RTDs (Resistance Temperature Detectors) are basically precision resistors that change value with temperature. The PT100 is the classic choice — 100 Ω at 0°C, and it follows the Callendar-Van Dusen equation pretty closely:

R(T)=R0(1+AT+BT2)for T0°CR(T) = R_0 \left(1 + AT + BT^2\right) \quad \text{for } T \geq 0°C

where A=3.9083×103A = 3.9083 \times 10^{-3}/°C and B=5.775×107B = -5.775 \times 10^{-7}/°C². If you need to know what resistance to expect at a specific temperature, the PT100 Resistance calculator will give you the answer instantly instead of doing the math by hand.

Measurement Circuit

The standard approach is to push a known constant current through the RTD and measure the voltage across it:

VRTD=Iexcitation×R(T)V_{RTD} = I_{excitation} \times R(T)

Sounds simple, right? The problem is that real wires have resistance too. If you're using a 2-wire connection, the lead resistance adds directly to your measurement and you have no way to separate it from the actual RTD resistance. This is why nobody uses 2-wire connections for anything requiring decent accuracy.

3-wire connection is the practical minimum for most applications. It uses a clever trick where you measure the voltage drop across the RTD separately from the current-carrying leads, which cancels out most of the lead resistance error. You'll still have some error from mismatched lead resistances, but it's usually good enough for industrial work. 4-wire (Kelvin) connection is what you use when you actually care about accuracy. The current flows through one pair of wires, and you measure the voltage with a completely separate pair that draws essentially zero current. No current means no voltage drop in the sense leads, which means you're measuring the RTD resistance directly. With a good constant-current source and a decent instrumentation amplifier, you can hit 0.01°C accuracy without breaking a sweat.

Key Considerations

Self-heating is the silent killer of RTD accuracy. Push too much current through that little resistor and it heats itself up, which changes its resistance, which throws off your measurement. The general rule is to keep power dissipation below 1 mW: I2R<1I^2 R < 1 mW. For a PT100, that means staying under about 1 mA of excitation current.

You'll want a low-noise instrumentation amplifier for the front end. The INA128 and AD8221 are solid choices that have been around forever. They're not exciting, but they work.

One more thing: PT1000 sensors (1000 Ω at 0°C instead of 100 Ω) are increasingly popular for battery-powered designs. Higher resistance means you can use proportionally less excitation current for the same voltage swing, which saves power. The tradeoff is slightly higher noise, but for most applications it's worth it.


Thermocouple Signal Conditioning

Thermocouples are weird. They generate a tiny voltage — we're talking microvolts to low millivolts — based on the temperature difference between two junctions of dissimilar metals. The basic relationship is:

E=S×(ThotTcold)E = S \times (T_{hot} - T_{cold})

where SS is the Seebeck coefficient. For a Type K thermocouple, that's roughly 41 μV/°C. Measuring 500°C? You're looking at maybe 20 mV of signal buried in noise and interference. The Thermocouple Voltage calculator will tell you what voltage to expect for any given temperature and thermocouple type.

Cold Junction Compensation

Here's the gotcha with thermocouples: they measure temperature difference, not absolute temperature. The "cold junction" is where your thermocouple wires connect to copper traces on your PCB. That junction has a temperature too, and it affects your reading. If you want to know the actual temperature at the hot end, you need to measure the cold junction temperature separately and add it to your thermocouple reading.

Integrated ICs like the MAX31855 (for Type K) or the LTC2986 (handles multiple thermocouple types) do all of this for you. They've got the amplification, cold junction compensation, and even the linearization lookup tables built in. Unless you have a really good reason to do it yourself — and you probably don't — just use one of these chips and save yourself the headache. Discrete design is possible if you're feeling masochistic or have some unusual requirement. You'll need a precision instrumentation amplifier with about 10 mV/°C of gain, a separate temperature sensor (usually an NTC thermistor or small RTD) right at the cold junction, and a linearization lookup table or polynomial in your firmware. It's more work, more board space, and more things that can go wrong. But sometimes you need the flexibility.

Load Cell / Strain Gauge Signal Conditioning

Load cells are Wheatstone bridges made from strain gauges. When you apply force, the resistance of the gauges changes slightly, and the bridge outputs a differential voltage. The catch? Full-scale output is typically only 1–3 mV per volt of excitation:

Vout=Vexcitation×S×FFFSV_{out} = V_{excitation} \times S \times \frac{F}{F_{FS}}

So with 5V excitation and a sensitivity of 2 mV/V, your full-scale signal is 10 mV. That's tiny. And it's sitting on a common-mode voltage that could be anywhere from 0V to 5V depending on the load. This is why load cell amplifiers exist. The Load Cell Amplifier calculator helps you figure out what gain you need to bring that signal up to something your ADC can work with.

Amplifier Selection

The INA125P and INA128 are the old workhorses for this kind of thing. The INA125 is particularly nice because it includes a precision voltage reference for bridge excitation, so you don't need to add one externally. You set the gain with a single resistor: G=4+60kΩ/RGG = 4 + 60\,\text{k}\Omega / R_G. The input-referred noise is around 8 nV/√Hz, which is adequate for feeding a 24-bit ADC without the noise floor drowning out your LSBs.

The HX711 deserves special mention. It's a purpose-built 24-bit ADC specifically for load cells and bridge sensors, and it's used in basically every cheap digital scale you've ever seen. It's not the lowest noise or the highest performance, but it's stupid easy to use and costs about a dollar. For most weighing applications, it's the obvious choice.


Current Sensing with Shunt Resistors

Current sensing is conceptually simple: stick a low-value resistor in series with your load and measure the voltage drop across it:

Vshunt=I×RshuntV_{shunt} = I \times R_{shunt}

A 10 mΩ shunt resistor with 10A flowing through it gives you 100 mV — that's a reasonable signal for a difference amplifier to work with. The Current Shunt calculator helps you verify that your shunt voltage is big enough for good resolution but not so big that you're wasting a bunch of power.

High-Side vs Low-Side Sensing

Low-side sensing puts the shunt between your load and ground. This is the easiest configuration because the shunt voltage is already referenced to ground, so you can use a simple single-ended amplifier. The downside is that your load is no longer at true ground — it's sitting at whatever voltage is dropped across the shunt. For most loads this doesn't matter, but for some circuits (especially anything with communication interfaces) it can cause problems. High-side sensing puts the shunt between your power supply and the load, so the load stays at true ground. No ground shift, no weird common-mode issues. The catch is that now your shunt voltage is sitting on top of your supply rail, which means you need a difference amplifier or a dedicated current-sense IC like the INA219 or INA240. These chips have built-in high-side current sensing and usually include the ADC, making them ridiculously easy to use.

Selecting Shunt Resistance

The shunt resistance comes from rearranging Ohm's law and accounting for your amplifier gain:

Rshunt=VfullscaleImax×GampR_{shunt} = \frac{V_{full-scale}}{I_{max} \times G_{amp}}

You're usually targeting a shunt voltage of 50–100 mV at full-scale current. Go much lower and your signal-to-noise ratio suffers. Go much higher and you're dissipating too much power: P=I2RP = I^2 R. At 10A, even a 100 mΩ shunt is burning 10 watts, which is a lot of heat to deal with.


Photodiode / Optical Sensor Signal Conditioning

Photodiodes generate current proportional to incident light. That current could be anywhere from picoamps in darkness to hundreds of microamps in bright light. A transimpedance amplifier (TIA) converts this current to a voltage you can actually measure:

Vout=Iphoto×RfV_{out} = I_{photo} \times R_f

If you've got 10 μA of photocurrent and you use a 100 kΩ feedback resistor, you get 1V output. Simple enough. The Photodiode TIA calculator helps you figure out the bandwidth and noise performance for different feedback resistor values.

Stability

Here's where TIA circuits get tricky. Without a feedback capacitor, they love to oscillate. The photodiode has capacitance, the op-amp has input capacitance, and together they form a pole that can push your circuit into instability. The fix is to add a small capacitor CfC_f in parallel with your feedback resistor RfR_f:

f3dB=12πRfCff_{-3dB} = \frac{1}{2\pi R_f C_f}

Typically you'll use something in the 1–10 pF range. This creates a dominant pole that stabilizes the circuit while still maintaining reasonable bandwidth for most applications. Start with 5 pF and adjust from there based on what you see on the scope.


4–20 mA Current Loop

Industrial sensors use 4–20 mA current loops for a good reason: they work over long cable runs (up to a kilometer or more) without caring about cable resistance. The information is encoded in the current, not the voltage, so voltage drops along the wire don't matter.

The encoding is straightforward:

  • 4 mA represents 0% of the measurement range (and also provides power to the transmitter in 2-wire systems)
  • 20 mA represents 100% of the measurement range
The 4–20 mA Transmitter calculator converts between sensor values and loop current, and helps you verify that your voltage budget works out for your cable length and supply voltage.

Receiving the Signal

At the receiving end, you convert the current back to voltage with a precision resistor. A 250Ω resistor is the standard choice because it converts 4–20 mA to 1–5V, which maps nicely to a 0–5V ADC:

Vsense=Iloop×250ΩV_{sense} = I_{loop} \times 250\,\Omega

This voltage range has a nice feature: you can detect cable breaks (0V) and sensor faults (below 1V) just by looking at the voltage. Anything between 1V and 5V is a valid reading.


Building an Accuracy Budget

Every component in your signal chain contributes error, and they add up faster than you'd think. Here's what you're typically dealing with:

SourceTypical Error
Sensor nonlinearity0.1–0.5% FS
Amplifier offset0.02–0.2% FS
ADC quantisationLSB/2
Temperature drift50–500 ppm/°C
Reference voltage0.05–0.5%
The proper way to combine these errors is root-sum-square (RSS), which assumes they're independent and uncorrelated:
etotal=e12+e22++en2e_{total} = \sqrt{e_1^2 + e_2^2 + \cdots + e_n^2}

This gives you a more realistic estimate than just adding them up linearly. The Sensor Accuracy Budget calculator lets you model your entire system's accuracy across temperature and see where your biggest error sources are. You'll often find that one or two components dominate the error budget, and that's where you should focus your effort (or money) on improvement.


Summary

Here's a quick reference for common sensor types and what to use for signal conditioning:

Sensor TypeTypical OutputRecommended IC
PT100 RTD100–400 ΩINA128 + constant-current source
Thermocouple1–50 mVMAX31855
Load cell1–10 mVHX711 or INA125
Photodiode1 nA–100 μATIA with OPA2134
Current shunt10–100 mVINA219 or INA240
4–20 mA loop1–5 V (via 250 Ω)ADC direct
The mistakes I see over and over: not using enough gain on bridge sensors (you end up with a 10 mV signal trying to drive a 16-bit ADC and wondering why it's noisy), forgetting cold junction compensation in thermocouple circuits (your readings will be off by whatever your PCB temperature is), and leaving out the feedback capacitor in transimpedance amplifier designs (enjoy your 10 MHz oscillation). Learn from other people's mistakes instead of making them yourself.

Related Articles