Strange ADC Drift on My STM32 Board Whenever Relay Turns On

Thread Starter

eva_402

Joined Mar 13, 2026
4
Hi everyone,
I’m testing a custom STM32-based control board that reads a pressure sensor through the ADC. The readings are stable until a relay energizes, then the ADC value shifts noticeably for a few milliseconds before settling again.

The relay coil is powered from the same 12V input, and the MCU uses a 3.3V regulator. I already added software averaging, but it only hides the symptom.

My questions:

  1. Would this be caused by supply dip, ground bounce, or EMI from the relay coil?
  2. Is adding more local decoupling near the MCU ADC pins usually enough?
  3. On the PCB side, should relay current return paths be completely isolated from analog ground areas?
 
1. Supply dip, ground bounce, or EMI?

Most likely a combination, but ground bounce + supply disturbance is the main suspect.

When the relay energizes:
  • Coil current creates a sudden surge on the 12V rail
  • Return current can flow through shared ground impedance .... ground bounce
  • That shifts the ADC reference (or MCU ground) ..... readings jump temporarily
  • EMI from the relay is usually secondary unless routing is very close
So the ADC shift is often not “noise in the signal”, but movement of your reference/ground level.

2. Is adding local decoupling near ADC pins enough?

Helpful, but not sufficient alone. Decoupling near MCU/VDDA helps:
  • Smooth fast transients
  • Stabilize ADC reference locally

But if the issue is ground movement or 3.3V rail dip ..... capacitors at the MCU won’t fully fix it. You also need:

3. PCB: should relay return paths be isolated from analog ground?

Short answer is Yes ..... but with correct structure. Best practice:

You don’t need separate ground planes necessarily ...... you need separation of high-current return paths, not fragmentation of ground. This will help: https://www.pcbway.com/blog/Enginee...CB_signal_return_and_cross__segmentation.html

Your symptoms strongly point to shared ground impedance + transient supply disturbance .... not ADC noise itself. Fixing return paths and supply integrity will be far more effective than software filtering or local decoupling alone.
 
Top