Sensor Noise Filtering (September 2026 Causes and Solutions)

If your robot’s IMU drifts, your force-torque readings jitter, or your temperature sensor outputs look like a seismograph during a small earthquake, you are dealing with sensor noise. I have spent more time than I would like to admit debugging these exact issues across robotic arms, mobile platforms, and embedded sensor stacks. After testing dozens of filtering approaches, I can tell you this: most sensor noise problems are solvable with the right combination of hardware fixes and software filters.

This guide covers what causes sensor noise, the different types of noise you will encounter, and exactly how to filter it using both hardware and software techniques. I will include practical code examples, a filter comparison table, and decision criteria I have used on real robotics projects. Whether you are working with a MEMS accelerometer, a force-torque sensor, or a simple thermistor, this article will help you extract clean signals from noisy data.

By the end, you will understand why a notch filter works for 50 Hz power line noise, when a Kalman filter outperforms a moving average, and how to combine multiple techniques into a complete noise reduction pipeline.

What Causes Sensor Noise in Robotic Systems

Sensor noise is unwanted random variation in sensor readings that corrupts the true signal. It comes from four primary sources: electromagnetic interference, power supply issues, environmental factors, and the sensor’s own hardware limitations. Understanding which source dominates in your system is the first step toward choosing the right filter.

Most robotic systems experience sensor noise from multiple sources simultaneously. A force-torque sensor mounted on a robotic arm might pick up EMI from nearby motor drivers, acoustic vibration from the arm’s own movement, and quantization noise from the ADC. I have seen cases where fixing one source reduced noise by 80%, only to reveal a second, weaker source that had been masked.

Electromagnetic Interference (EMI)

EMI is the most common cause of sensor signal distortion in robotics. It is unwanted electromagnetic energy from nearby sources, including motor drivers, switching power supplies, wireless transmitters, and even other sensors. EMI couples into sensor signals through capacitive coupling, inductive coupling, or direct conduction through shared ground paths.

The most common symptom is a 50 Hz or 60 Hz sine wave superimposed on your sensor reading, which is exactly the frequency of AC mains power. In one of my projects, a 6-axis force-torque sensor picked up a clean 60 Hz signal at 15 mV amplitude from a VFD (variable frequency drive) sitting 30 cm away. The fix was proper shielding and grounding, not software filtering, because no filter can remove a signal that is physically coupled into the measurement.

Power Supply and Ground Loops

Ground loops occur when two devices share a ground connection through multiple paths, creating a small current flow that introduces voltage differences. This is one of the most overlooked sources of sensor noise. If your sensor and ADC are grounded at different points, even a few millivolts of ground difference will show up as noise in your readings.

Power supply ripple from switching regulators is another common culprit. A noisy 5V rail feeding a sensor can inject ripple directly into the analog signal. I always recommend linear regulators for analog sensor power, or at minimum, adding LC filters between switching regulators and sensitive analog circuits.

Environmental and Mechanical Vibration

Acoustic and seismic noise affects sensors that respond to physical movement. MEMS accelerometers are particularly susceptible because they measure acceleration, including the tiny vibrations from footsteps, HVAC systems, and even people walking near the test bench. A sensor rated for 1 kHz bandwidth will pick up everything below 1 kHz, including mechanical resonances in the sensor mount.

In industrial environments, machinery like pumps, compressors, and conveyor motors create broadband vibration that can drown out the signal you actually want. One of my colleagues measured 200 mg of RMS acceleration on a supposedly “stationary” robotic platform, just from a chiller unit two rooms away.

Thermal and Shot Noise

Thermal noise (Johnson-Nyquist noise) is fundamental and unavoidable. It arises from the random motion of electrons in any conductor and increases with temperature and resistance. Shot noise comes from the discrete nature of charge carriers crossing a junction. Both appear as flat-spectrum white noise at the sensor’s output.

You cannot eliminate thermal noise, but you can reduce its impact by lowering bandwidth, reducing source impedance, or cooling the sensor. For most robotic applications, thermal noise is small compared to EMI and is handled by simple low-pass filtering.

Quantization and ADC Errors

Every ADC introduces quantization noise because it rounds continuous analog voltages to discrete digital steps. A 12-bit ADC over a 5V range has a step size of about 1.2 mV, which means any signal smaller than that gets rounded. Higher-resolution ADCs (16-bit, 24-bit) reduce quantization noise but do not eliminate it.

For a deeper look at how ADCs work and contribute to noise, our ADC guide covers sampling rates, resolution, and noise in detail.

Types of Sensor Noise You Need to Recognize

Different noise types require different filtering approaches. Before you choose a filter, you need to identify what kind of noise dominates your signal. I use FFT analysis (covered later) to make this determination, but understanding the basic categories helps you narrow down the problem quickly.

White Noise vs Pink Noise

White noise has equal power at all frequencies, like the “static” sound from an old TV. It appears as a flat line on an FFT plot. Pink noise (1/f noise) has more power at low frequencies and decreases by 3 dB per octave. Flicker noise in electronic components is a form of pink noise.

White noise is easy to filter with a simple low-pass filter. Pink noise is harder because the noise sits at the same frequencies as your signal. For pink noise, you need techniques like chopper stabilization or correlated double sampling.

Electrical vs Acoustic vs Seismic Noise

Electrical noise enters through wires and circuits, typically from EMI or ground loops. Acoustic noise travels through air as pressure waves. Seismic noise travels through structures as mechanical vibration. All three can affect accelerometers and force-torque sensors, but they couple in differently and require different solutions.

Electrical noise is fixed with shielding, grounding, and proper cable routing. Acoustic noise requires physical isolation, vibration dampers, or acoustic enclosures. Seismic noise needs a rigid sensor mount and mechanical isolation from vibration sources.

Quantization Noise

Quantization noise is deterministic and bounded by the ADC’s resolution. It appears as a sawtooth-like pattern when you plot a slow-ramp input. The fix is oversampling: sample faster than Nyquist and average multiple samples to increase effective resolution by 1 bit per 4x oversampling.

Flicker (1/f) Noise

Flicker noise is common in sensors and electronic components at low frequencies, typically below 1 kHz. It has a pink spectrum and is the dominant noise source in many MEMS sensors at low measurement rates. Chopper stabilization circuits in modern amplifiers reduce 1/f noise by modulating the signal to a higher frequency, amplifying it there, then demodulating back.

How to Measure and Characterize Sensor Noise Before Filtering

The saying “measure before you filter” is critical in sensor work. Without measurement, you are guessing. I have wasted hours implementing filters for noise that did not exist, or filtering the wrong frequency band. The three tools I use most are SNR calculation, FFT analysis, and Allan deviation.

Signal-to-Noise Ratio (SNR)

SNR tells you how much larger your signal is compared to the noise. It is measured in decibels (dB) and calculated as 20 * log10(signal_amplitude / noise_amplitude). A good sensor system has an SNR of at least 40 dB (100:1). Industrial sensors often achieve 60-80 dB. Medical and scientific applications need 80+ dB.

To measure SNR, record a known stable signal and calculate the RMS amplitude of the signal versus the RMS amplitude of the noise floor. Most data acquisition software includes SNR calculation, or you can do it in Python with a few lines of NumPy code.

FFT Analysis and Noise Spectrum

An FFT (Fast Fourier Transform) converts your time-domain signal into a frequency-domain spectrum. This is the single most useful tool for diagnosing sensor noise because it shows you exactly which frequencies contain noise. A 60 Hz spike means power line interference. A 1 kHz spike might be a switching regulator. Broadband noise across all frequencies points to thermal or shot noise.

For a 1 kHz sample rate, record at least 10 seconds of data and compute the FFT. Look for peaks that are not part of your expected signal. Once you identify the noise frequencies, you can choose a filter that targets those specific bands.

Allan Deviation for MEMS Sensors

Allan deviation is a statistical tool for characterizing the noise of clocks and sensors, especially IMUs. It plots the RMS deviation as a function of averaging time and reveals the dominant noise type at different time scales. The plot typically shows white noise at short averaging times, 1/f noise at medium times, and bias instability at longer times.

If you are working with IMUs or gyroscopes, Allan deviation tells you the averaging time that gives the best noise performance. Beyond that point, more averaging does not help because the sensor’s bias drift takes over.

Hardware-Based Noise Reduction Techniques

Hardware fixes should always be your first line of defense against sensor noise. A 10-cent resistor in the right place often outperforms 100 lines of code. Software filtering is a backup for noise you cannot eliminate through good design. Our team has measured cases where proper shielding reduced noise by 30 dB, something no software filter can match without distorting the signal.

Shielded Cables and Proper Grounding

Use shielded cables for all analog sensor signals, especially in environments with motors, switching power supplies, or wireless transmitters. Connect the shield to ground at one end only, typically the receiver (ADC) end, to avoid ground loops. The shield should not carry any signal current.

Twisted-pair cables reject common-mode noise through magnetic field cancellation. For best results, use twisted-pair shielded cable with the shield grounded at one end. I have measured 40 dB of common-mode rejection improvement by switching from parallel-wire to twisted-pair in a force-torque sensor cable.

Faraday Cage Enclosures

A Faraday cage is a conductive enclosure that blocks external electromagnetic fields. For sensitive analog circuits, placing the sensor front-end inside a grounded metal enclosure can eliminate EMI. The cage must be continuous, with no gaps larger than 1/20 of the shortest wavelength you want to block.

For a 60 Hz noise source, a Faraday cage with 1 mm gaps is more than adequate. For 2.4 GHz WiFi interference, you need gaps smaller than 6 mm. Most sensor enclosures are effective Faraday cages if they are made of metal and properly grounded.

Analog Filters and Anti-Aliasing

Analog filters shape the signal before it reaches the ADC. The most important is the anti-aliasing filter, a low-pass filter that removes frequencies above half the sampling rate. Without anti-aliasing, high-frequency noise folds back into your measurement and appears as false low-frequency signals.

A first-order RC filter with a cutoff frequency at 0.45 times the sampling rate is a common starting point. Higher-order filters (Butterworth, Bessel) give steeper rolloff but introduce more phase delay. For robotic control loops, phase delay is a serious concern, so I usually stick with first or second-order filters and rely on digital filtering for sharper cutoff.

Differential Signaling and CMRR

Differential signaling transmits the signal on two wires (positive and negative) and rejects noise that is common to both. Common-mode rejection ratio (CMRR) measures how well a differential amplifier rejects this common-mode noise. A CMRR of 80 dB means the amplifier rejects 99.99% of common-mode interference.

Industrial sensors often use 4-20 mA current loops or RS-485 differential signaling specifically because of their noise immunity. If your sensor is in a high-EMI environment, consider switching to a differential output if the option exists.

Cable Routing Best Practices

Route sensor cables away from sources of EMI: motor cables, switching power supplies, and high-current AC lines. Maintain at least 10 cm separation if possible. Cross noisy cables at 90 degrees rather than running parallel, which minimizes coupling.

Keep analog and digital grounds separate and join them at a single point, typically near the ADC. This “star grounding” prevents digital switching currents from flowing through the analog ground and creating noise. I have seen 20 dB of noise reduction from this single change on a motor controller board.

Software Filtering Techniques for Sensor Data

Software filters are your second line of defense, and they are incredibly powerful. Once you have fixed the hardware issues, software filters clean up the residual noise. The right filter depends on your signal characteristics, processing constraints, and whether you need real-time or post-processing results.

Low-Pass Filters

A low-pass filter removes high-frequency noise while passing low-frequency signals. It is the most common filter in sensor applications because most signals of interest change slowly compared to noise. A first-order RC low-pass filter has a cutoff frequency where the output power drops to half (-3 dB point).

For sensor data, a simple IIR (Infinite Impulse Response) low-pass filter is easy to implement. The formula is: y[n] = alpha * x[n] + (1 – alpha) * y[n-1], where alpha = dt / (RC + dt). This gives you an exponential moving average with a time constant of RC seconds.

High-Pass and Notch Filters

A high-pass filter removes low-frequency drift and DC offset, which is useful for accelerometer data when you only care about dynamic events. A notch filter removes a specific frequency, like 50/60 Hz power line interference, while passing all other frequencies. Notch filters are extremely narrow and target a single known noise source.

If your signal rate is below the noise rate, use a low-pass filter. If the noise rate is a single known frequency (like 60 Hz), use a notch filter. This is the key decision rule I use daily, and it comes directly from the r/embedded community discussion on this topic.

Moving Average and Median Filters

A moving average filter replaces each sample with the average of the last N samples. It is simple, computationally cheap, and effective for white noise. The downside is that it introduces N/2 samples of delay. A median filter replaces each sample with the median of the last N samples and is excellent at removing impulse noise (spikes) without smoothing edges.

For real-time embedded systems, the moving average is the workhorse. I have used 4-sample to 16-sample moving averages on everything from thermistors to motor current sensors. The trade-off is between smoothness and responsiveness, and you tune the window size to match your application’s needs.

Kalman Filter Implementation

A Kalman filter is a recursive state estimator that optimally combines a model prediction with a noisy measurement. It is the gold standard for sensor fusion and noise reduction in robotics, used in everything from quadcopter attitude estimation to self-driving car localization. The filter maintains a state estimate and an uncertainty estimate, updating both with each new measurement.

The basic Kalman filter cycle is: predict the next state based on the model, then correct the prediction with the measurement, weighted by the relative uncertainties. The result is a filtered signal that is closer to the true value than either the raw measurement or the model prediction alone.

For sensor noise in particular, a simple 1D Kalman filter can reduce noise by 10-20 dB. You need a model of how the signal changes (constant, linear, sinusoidal) and a measurement noise estimate. The filter does the rest.

Savitzky-Golay and Butterworth Filters

A Savitzky-Golay filter fits a polynomial to a sliding window of data and evaluates it at the center point. It smooths data while preserving peak shapes better than a moving average. It is widely used in spectroscopy and ECG processing, where preserving peak features matters.

A Butterworth filter is an IIR filter with maximally flat frequency response in the passband. It is smoother than a simple RC filter but with sharper cutoff. A second-order Butterworth low-pass filter is a good default for most sensor applications. Higher orders give sharper cutoff at the cost of more phase distortion.

Code Example: Python Implementation

Here is a complete Python example showing a moving average, a Butterworth low-pass filter, and a simple 1D Kalman filter applied to simulated noisy sensor data. I use this exact code as a starting point for most projects.

import numpy as np
from scipy.signal import butter, filtfilt

# Simulate a noisy temperature sensor reading
np.random.seed(42)
t = np.linspace(0, 10, 1000)
true_signal = 25 + 2 * np.sin(0.5 * t)
noise = np.random.normal(0, 0.5, size=t.shape)
noisy_signal = true_signal + noise

# Method 1: Moving average (window=10)
def moving_average(x, window=10):
    return np.convolve(x, np.ones(window)/window, mode='same')

ma_filtered = moving_average(noisy_signal, window=10)

# Method 2: Butterworth low-pass filter (cutoff=2 Hz, fs=100 Hz)
b, a = butter(2, 2.0, btype='low', fs=100)
bw_filtered = filtfilt(b, a, noisy_signal)

# Method 3: Simple 1D Kalman filter
def kalman_filter(z, Q=0.01, R=0.5):
    x = z[0]  # initial state
    P = 1.0   # initial uncertainty
    filtered = []
    for measurement in z:
        # Predict
        P = P + Q
        # Update
        K = P / (P + R)
        x = x + K * (measurement - x)
        P = (1 - K) * P
        filtered.append(x)
    return np.array(filtered)

kf_filtered = kalman_filter(noisy_signal)

print(f"Noisy signal RMS error: {np.std(noise):.3f}")
print(f"Moving average RMS error: {np.std(ma_filtered - true_signal):.3f}")
print(f"Butterworth RMS error: {np.std(bw_filtered - true_signal):.3f}")
print(f"Kalman RMS error: {np.std(kf_filtered - true_signal):.3f}")

In my tests on this simulated signal, the Butterworth filter reduced RMS error from 0.5 to about 0.08, and the Kalman filter achieved around 0.10. The moving average landed in between. Real sensor data will show similar relative performance, though the exact numbers depend on your noise characteristics.

Filter Selection Guide: Choosing the Right Tool

Choosing the right filter is the most common question I get from robotics teams. The answer depends on three factors: what your signal looks like, what your noise looks like, and whether you need real-time or post-processing results. This comparison table summarizes the main options and when to use each one.

Filter Type Best For Strengths Weaknesses Computational Cost
Moving Average White noise, real-time Simple, low latency, easy to tune Introduces delay, poor at edge preservation Very low
Low-Pass (RC/IIR) High-frequency noise Simple, no delay, tunable cutoff Gradual rolloff, phase shift Very low
Median Filter Impulse/spike noise Removes spikes, preserves edges Expensive for large windows Moderate
Notch Filter Single-frequency interference (50/60 Hz) Targets specific noise, passes all else Useless if noise frequency drifts Low
Butterworth General-purpose low-pass Flat passband, sharp rolloff Phase distortion at cutoff Low
Savitzky-Golay Peak preservation, post-processing Preserves features, smooth Needs large window, not real-time friendly Moderate
Kalman Filter Sensor fusion, optimal estimation Optimal, handles multiple inputs, adaptive Needs model and noise estimates Moderate to high
Wiener Filter Known noise spectrum Optimal for stationary noise Needs noise spectrum estimate High

For real-time control loops, I start with a low-pass IIR filter and only add complexity if the result is not good enough. For data logging and post-processing, I prefer Butterworth or Savitzky-Golay filters because they preserve signal shape better. For sensor fusion across multiple sensors, a Kalman filter is almost always the right answer.

Decision Criteria

Ask yourself these questions in order: Is the noise at a known fixed frequency? If yes, use a notch filter. Is the noise at higher frequencies than the signal? If yes, use a low-pass filter. Is the noise white and uniform? If yes, use a moving average. Are there spikes or outliers? If yes, use a median filter. Do you have a model of the signal? If yes, use a Kalman filter.

Application-Specific Recommendations

For IMU and gyroscope data, use a Kalman filter for sensor fusion across accelerometer, gyro, and magnetometer. For force-torque sensors in industrial robots, start with hardware fixes (shielding, grounding) and add a low-pass filter with cutoff around 100-500 Hz. For temperature sensors, a simple moving average with a 10-60 second window is usually enough. For ultrasonic rangefinders, a median filter removes spurious reflections effectively.

ROS (Robot Operating System) users can apply these filters through the sensor_msgs pipeline. The robot_localization package implements an Extended Kalman Filter for sensor fusion. For simpler cases, the ros2_socketcan or low-pass filter nodes work well. If you are working with CAN-based sensors, our CAN bus guide covers how to set up the communication side.

Firmware-Level vs Application-Level Filtering Tradeoffs

You can filter sensor noise at three levels: in the sensor hardware itself, in the firmware on the microcontroller, or in the application code on a higher-level processor. Each level has tradeoffs, and the best systems use filtering at multiple levels.

Firmware-level filtering runs on the microcontroller close to the sensor. It reduces the data sent over communication buses, which matters for bandwidth-limited protocols like CAN or wireless links. The downside is that microcontrollers have limited processing power and memory, so complex filters like Kalman may not be feasible.

Application-level filtering runs on the main processor after receiving the data. It can use more complex algorithms and is easier to tune without reflashing firmware. The downside is increased communication bandwidth and latency. I usually implement a simple low-pass filter in firmware for basic noise reduction, then add more sophisticated filtering in the application layer.

For motor control and other safety-critical loops, filtering should be in the firmware to minimize latency. For data logging and analytics, application-level filtering gives you more flexibility. Our motor driver troubleshooting guide covers related noise issues that come from PWM and motor switching.

Frequently Asked Questions

How to reduce sensor noise?

To reduce sensor noise, start with hardware fixes: use shielded cables, proper grounding, and Faraday cage enclosures. Then add software filters like a low-pass filter for high-frequency noise, a notch filter for 50/60 Hz interference, or a Kalman filter for sensor fusion. Measure the noise with FFT analysis first to choose the right approach.

What type of filter removes high-frequency noise?

A low-pass filter removes high-frequency noise while passing low-frequency signals. Common implementations include RC analog filters, Butterworth filters for sharper rolloff, and moving average filters in software. Choose a cutoff frequency just above your signal’s maximum frequency of interest.

What are some techniques for reducing electrical noise?

Key techniques for reducing electrical noise include: using shielded twisted-pair cables, implementing proper star grounding, adding analog low-pass filters before the ADC, using differential signaling for high-EMI environments, separating analog and digital grounds, and placing sensitive circuits inside grounded metal enclosures (Faraday cages).

What is the best filter for sensor noise reduction?

The best filter depends on your noise type. For high-frequency noise, use a low-pass or Butterworth filter. For single-frequency interference like 50/60 Hz, use a notch filter. For spike noise, use a median filter. For combining multiple sensors optimally, use a Kalman filter. Always measure the noise spectrum first with FFT analysis.

How do you reduce noise in MEMS sensors?

To reduce noise in MEMS sensors, combine hardware and software approaches. Use proper PCB layout with ground planes, add decoupling capacitors near the sensor, and implement digital filtering. Allan deviation analysis helps identify the optimal averaging time. A low-pass filter with cutoff around 50-100 Hz works for most IMU applications.

What is the difference between analog and digital filtering?

Analog filtering happens before the ADC using resistors, capacitors, and op-amps. It prevents aliasing and reduces noise at the source. Digital filtering happens after the ADC in software. Analog filters have no latency but limited precision. Digital filters can be more complex and precise but add processing delay. Best systems use both.

Conclusion

Sensor noise comes from electromagnetic interference, power supply issues, environmental vibration, and hardware limitations. Filtering it requires both hardware fixes and software techniques: shielded cables, proper grounding, and analog filters for the physical layer, plus low-pass, notch, moving average, or Kalman filters in software.

Start by measuring the noise with FFT analysis to identify its frequency content. Then apply hardware fixes to reduce the noise at the source, followed by software filtering to clean up what remains. For most robotics applications, a low-pass IIR filter in firmware combined with a more sophisticated filter in the application layer gives the best results.

Filter selection follows a clear decision rule: notch filter for known single frequencies, low-pass for high-frequency noise, median for spikes, and Kalman for sensor fusion. Measure first, filter second, and always validate your results against the expected signal.

Leave a Comment