Analog for Firmware Engineers: Why Your ADC Readings are Noisy (and How to Fix It)
- Srihari Maddula
- 5 hours ago
- 4 min read
Author: Srihari Maddula • Technical Lead, EurthTech
Reading Time: 25 mins
Topic: Analog Design & Signal Integrity

The bridge between bits and volts is forged in the hardware layout. Photo via Unsplash.
You’ve spent weeks writing a sophisticated control algorithm. Your logic is sound, your PID loops are tuned, and your code is clean. But when you look at the raw data from your 12-bit Analog-to-Digital Converter (ADC), the numbers are all over the place. A stable 1.5V input is reading anywhere from 1850 to 1920.
Your first instinct is to blame the code. You add a moving average filter. It helps, but now your system is slow to respond. You increase the sample rate, but the noise gets worse.
But here is the industry reality: Noise is a physical phenomenon, and you cannot "code away" a poor hardware layout. In professional embedded engineering, an ADC is not just a function call; it is a sensitive bridge between the noisy digital world of the CPU and the quiet analog world of sensors. If you aren't thinking about Return Paths, Impedance Matching, and Nyquist Limits, your firmware is just calculating high-precision junk.
Senior Secret A professional analog designer doesn't just look at the schematic; they look at the PCB copper. Current doesn't "go to Ground"—it returns to its source.
1. Technical Pillar 1: The "Return Path"
The most common mistake junior engineers make is assuming that "Ground is Ground." You see a ground symbol on a schematic and assume all those points are at 0V. In the digital world, current flows through a wire and "disappears" into Ground. In the analog world, current must flow back to its source.
The Professional Reality: Impedance Matters
DC vs. AC: At DC, current follows the path of least resistance. But at high frequencies (24MHz+), return current follows the path of least impedance—which is directly underneath the signal trace.
The Problem: If your high-speed digital traces (SPI, I2C) cross the area where your sensor signals live, their return currents will flow through your analog ground. This creates voltage spikes that the ADC sees as noise.
Production Rule Use a Solid Ground Plane. Do not split it into "Analog" and "Digital." Instead, keep digital components on one side of the board and analog components on the other.
2. Technical Pillar 2: Power Supply Decoupling (Bulk vs. Bypass)
Your ADC is only as accurate as its reference voltage ($V_{ref}$). If your 3.3V rail has 100mV of switching noise from a radio or motor, your ADC readings will bounce with that traffic.
Capacitor Type | Typical Value | Purpose |
Bulk (Tantalum) | 10µF - 100µF | Handles low-frequency current surges. |
Bypass (Ceramic) | 100nF | Filters mid-frequency digital noise. |
RF Bypass (Ceramic) | 100pF | Filters high-frequency clock harmonics. |
Precision Logic Use a Ferrite Bead between the digital 3.3V rail and the $V_{DDA}$ (Analog Power) pin. This acts as a frequency gate, letting DC through but blocking high-frequency digital noise from the CPU core.
3. Technical Pillar 3: Input Impedance & The RC Filter
The ADC inside an MCU works by charging a tiny internal capacitor. If your sensor has a high output impedance (like a $100k\Omega$ resistor), it cannot charge that internal capacitor fast enough during the sampling window.
The Anti-Aliasing Defense
Before the signal reaches the ADC, it must pass through an RC Low-Pass Filter (LPF). According to the Nyquist-Shannon theorem, any noise frequency higher than half your sample rate will be "aliased" into your data as low-frequency noise. This aliased noise is permanent—it is mathematically impossible to remove in software later.

Signal conditioning is the difference between a glitch and a measurement. Photo via Unsplash.
4. Technical Pillar 4: Firmware-Level DSP (The Smart Way)
Once the hardware is optimized, you can apply software filtering. But don't just use a simple average.
EMA (Exponential Moving Average): Requires only one variable in RAM. output = (alpha sample) + ((1 - alpha) last_output). It provides smooth data with very low CPU overhead.
Median Filtering: Perfect for rejecting "impulsive" noise or spikes. If a motor turns on and creates a single huge spike, a Median filter ignores it entirely, while an Average filter would smear it into your result.
Oversampling: Sample 16 times, sum the result, and shift. This reveals bits of resolution hidden beneath the thermal noise floor, effectively turning a 12-bit ADC into a 14-bit measurement.
Summary: The Analog Quality Roadmap
Layout First: Return paths are everything. Keep the "Aggressors" (Digital) away from the "Victims" (Analog).
Power Filter: Use a hierarchy of decoupling capacitors and a Ferrite Bead for $V_{DDA}$.
Watch the Impedance: If your sensor is weak, use an Op-Amp Buffer.
Hardware LPF: Always use an RC filter to prevent aliasing. Software cannot fix aliasing.
DSP Strategy: Use EMA for smoothness and Median filters for spike rejection.
Engineering at EurthTech
At EurthTech, we build products that see the world clearly. We understand that in the messy reality of industrial environments, the difference between a "glitch" and a "measurement" is the quality of the engineering between the sensor and the bit.
Ready to scale your next production-grade embedded project? Let’s get deep.




Comments