Arduino Pro Mini not waking up from interrupt on pin #2

Hello. I'm creating a speedometer, using an Arduino Pro Mini and some reed switches. For maximum power efficiency, I tried putting the Arduino to sleep and waiting on an interrupt from the reed switch, connected to the digital pin #2. Yet the Arduino is being stubborn and it simply refuses to wake up when the interrupt occurs... I am posting the code below:

//PINS
const int switchPin =  2;     // the number of the reed switch pin, reed generates interrupt

<...>

unsigned long currMillis, prevMillis, T1;

<...>

//sleep function
void sleepNow()           // here we put the arduino to sleep
{
  attachInterrupt(0, turnOnDisplay, RISING);
  delay(10);
  set_sleep_mode(SLEEP_MODE_PWR_DOWN);   // sleep mode is set here
  
  sleep_enable();         // enables the sleep bit in the mcucr register
                          // so sleep is possible. just a safety pin
  
  sleep_mode();           // here the device is actually put to sleep!!
                          // THE PROGRAM CONTINUES FROM HERE AFTER WAKING UP
  
  sleep_disable();        // first thing after waking from sleep:
                          // disable sleep...
  detachInterrupt(0);     // disables interrupt 0 on pin 2 so the
                          // wakeUpNow code will not be executed
                          // during normal running time.
}

<...>

void setup() {
  init();
  Serial.begin(9600);
  // while the serial stream is not open, do nothing:
  while (!Serial) ;
  Serial.println ("Setup start");

  //initialize input pins, reed
  pinMode(switchPin, INPUT);

<...>

}

void loop() {
  //how long has it passed
  currMillis = millis();

  //sleep if current time - previous time exceeds timeout
  if ((currMillis - prevMillis) >= T1) {
  
    <...>  

    sleepNow();         //sleep and wait for interrupt from the sensor
    currMillis = 0;     //reset timekeeping variables
    prevMillis = 0;
    
  }
  //awake
  else {/* do something*/}

  <...>

}

Irellevant code is omitted for easier reading (irellevant code is declarations and printing stuff on the LCD). The rest of the program is doing exactly what it should. But when the Arduino sleeps, it never wakes up again, no matter how many times the interrupt arrives... Any suggestions on what might be going on?

I think I read the interrupt has to be set to HIGH or LOW to wake the processor.

attachInterrupt(0, turnOnDisplay, [b][color=red]RISING[/color][/b]);

When the arduino is in SLEEP_MODE_PWR_DOWN the only way to wake it is with either a watchdog timer interrupt, a level interrupt on pins 2 or 3, or a Pin Change interrupt.

A level interrupt means that the pin has to be held in that state for a certain amount of time before the interrupt is triggered.

Check the doc for actual working code and documentation

Ah, I see. So I should set the attachInterrupt to HIGH, then wait for the interrupt to happen and once the ISR (turnOnDisplay() function) is called, detach the interrupt in there. Funny enough, I read the link you provided while writing my code, though I didn't pay the required attention, thinking that a level interrupt and a pin change interrupt were done in the same way... I found this link here:

http://playground.arduino.cc/Main/PinChangeInterrupt

about interrupts whenever the state of the input changes, so I think I'll give this a try. The actual project is a speedometer though, using the reed switch to generate short pulses on full wheel rotations, so I'm not quite sure as to which should be more appropriate approach... There's the problem with debouncing the input, if I use the pin change interrupt and the problem of the input not staying in the state enough time to wake up the MCU... Any ideas for that matter as well?

Also, thank you guys for the help, you are great!

pay close attention to the critical parts of your code between attaching the interrupt and sleeping

a bad behavior can happen if you don't disable sleep mode in your Interrupt and it's fired before you complete the setup.