External Interrupt Triggers Multiple Times from One Event

eva_402
Posts: 4
Joined: Fri Mar 13, 2026 10:50 am

External Interrupt Triggers Multiple Times from One Event

Postby eva_402 » Tue Apr 28, 2026 8:12 am

Hello everyone,
I connected a comparator output to an MCU external interrupt pin. One threshold crossing should generate a single interrupt, but sometimes multiple interrupts occur from one event.
The input signal has some noise near the threshold.
Questions:
Would comparator hysteresis be the correct hardware fix?
Should I also debounce the interrupt in firmware?
On the PCB side, should comparator reference traces be isolated from noisy digital return currents?

Sprite
Espressif staff
Espressif staff
Posts: 10593
Joined: Thu Nov 26, 2015 4:08 am

Re: External Interrupt Triggers Multiple Times from One Event

Postby Sprite » Wed Apr 29, 2026 1:48 am

Any of those can be a solution, yes.

lichurbagan
Posts: 59
Joined: Thu Nov 13, 2025 3:20 pm

Re: External Interrupt Triggers Multiple Times from One Event

Postby lichurbagan » Thu Apr 30, 2026 10:42 pm

Would comparator hysteresis be the correct hardware fix?
Yes, it will fix thigns ... what’s happening here is:

Input hovers around the threshold
Noise causes the comparator to toggle rapidly
MCU sees multiple edges .... so multiple interrupts

Adding hysteresis (positive feedback) creates two thresholds .... One for rising .... One for falling .... This prevents chatter and ensures one clean transition per event.
Should I also debounce the interrupt in firmware?
Yes ... its recommended but dont rely on it ocmpletely .... Firmware debounce (time filtering or ignore window) helps catch any residual glitches .... But it should not be the only solution .... check this discussion, you will get it: https://www.reddit.com/r/AskElectronics ... ebouncing/

So, Fix in hardware (hysteresis) first .... Then add firmware filtering for robustness
On the PCB side, should comparator reference traces be isolated from noisy digital return currents?
Yes .... very important .... Comparator reference and input nodes are sensitive .... so keep them away from digital switching currents and return paths

Use a clean ground reference (analog ground region if possible) .... I normally prefer seperate gnd and power planes .... depends on the complexity of yoru pcb but if its multilayer .... sepearte clean planes saves from a lot of trouble .... check these guides: https://www.aivon.com/blog/pcb-design/t ... -circuits/ https://www.pcbway.com/blog/Engineering ... lanes.html

Avoid sharing return paths with high-current or fast-switching signals
Keep traces short and shielded by ground where possible

Who is online

Users browsing this forum: Applebot and 5 guests