Ad Space — Top Banner

Interrupt Not Triggering

Arduino Microcontroller Board

Severity: Moderate

What Does This Error Mean?

Arduino interrupt not triggering is usually because the interrupt is attached to a non-interrupt pin, or the interrupt mode (RISING, FALLING, CHANGE) does not match the signal. On Arduino Uno, only pins 2 and 3 support external interrupts.

Affected Models

  • Arduino Uno
  • Arduino Mega
  • Arduino Nano
  • Arduino Leonardo
  • Arduino Micro

Common Causes

  • Non-interrupt pin used — on Uno, only pins 2 (INT0) and 3 (INT1) support external interrupts
  • Wrong interrupt mode — RISING/FALLING/CHANGE must match the signal transition being detected
  • Missing pull-up on the interrupt pin — floating pin generates spurious interrupts or none
  • Interrupt disabled globally with noInterrupts() and not re-enabled
  • ISR function too long — the interrupt fires but the ISR blocks too long and appears to not work

How to Fix It

  1. Verify you are using a valid interrupt pin.

    On Arduino Uno and Nano: only pins 2 and 3 support external interrupts. On Arduino Mega: pins 2, 3, 18, 19, 20, 21. On Arduino Leonardo/Micro: pins 0, 1, 2, 3, 7. Use attachInterrupt(digitalPinToInterrupt(pin), ISR, MODE) — not a raw interrupt number.

  2. Match the interrupt mode to your signal.

    RISING triggers when the pin goes from LOW to HIGH. FALLING triggers on HIGH to LOW. CHANGE triggers on either transition. LOW triggers continuously while the pin is LOW — use with caution as it fires repeatedly. If your button press goes LOW, use FALLING mode.

  3. Enable the internal pull-up or add an external one.

    A floating interrupt pin without a pull-up will trigger erratically or not at all. For a button to GND, enable the internal pull-up: pinMode(pin, INPUT_PULLUP). The button should connect the pin to GND when pressed, creating a FALLING edge trigger.

  4. Keep the ISR short — use a flag variable.

    The ISR must execute quickly — no Serial.print(), no delay(), no complex logic. Inside the ISR, set a volatile boolean flag: volatile bool triggered = false; In the ISR body: triggered = true; Check and act on the flag in loop().

  5. Confirm interrupts are enabled globally.

    If noInterrupts() was called anywhere in your code, all interrupts are disabled until interrupts() is called. Search your sketch for noInterrupts() calls and ensure interrupts() is called after any critical section that needed them disabled.

When to Call a Professional

Arduino interrupt hardware is reliable on genuine boards. If interrupts fail on a confirmed interrupt pin with correct mode, the interrupt controller in the ATmega chip may have been damaged by a voltage spike.