Sleep induced by External Interrupt (D2 or D3)

Most of the examples I’ve seen around are opposite of what I’m doing.

I would like to use the external internal pin interrupt to put the Uno to sleep.
Let’s say I have a switch that’s Normally Close that’s connected to Pin2. This is the normal mode.
When the switch flicks to and changes state to Open, I want to use the interrupt to put the Uno to sleep. And when the switch goes back to Close, wake up and back to normal mode.

I scribbled the sketch below and I would like to know if it makes sense.

#include <avr/sleep.h>

// interrupt service routine in sleep mode

void gotosleep ()
set_sleep_mode (SLEEP_MODE_PWR_DOWN);
noInterrupts (); // make sure we don’t get interrupted before we sleep
sleep_enable (); // enables the sleep bit in the mcucr register
interrupts (); // interrupts allowed now, next instruction WILL be executed
sleep_cpu (); // here the device is put to sleep

} // end of sleep

void loop ()
//Normal code///

attachInterrupt (0, gotosleep, LOW); // sleep on low level
sleep_disable (); // first thing after waking from sleep:
detachInterrupt (0); // stop LOW interrupt

} //

My main goal is to save power by using an external switch. My project is using both an Uno and a RF24L01. One approach is just to power off (kill supply voltage) on both the Uno and the NRF24L01 with the switch. The problem I think with this is when I switch back on, it will take sometime for the Uno and NRF24L01 to warm up and settle. I need them to be in "ready state" asap. So I'm considering using the interrupt pins to trigger sleep for saving power. But i havent seen an example for that, I'm not sure if its possible.

As so often happens, you refer to using an interrupt for something for which an interrupt is not suitable.

An interrupt is for dealing with - very quickly - something which must be dealt with without delay, and can be dealt with without affecting the general operation of the system.

Your requirement is entirely different - you wish to arrange an orderly shutdown of the system - into a sleep mode - and have it recover in an orderly fashion.

For this, you simply poll the "shutdown" switch in your main loop which is continuously cycling - if it is not, you have not written the program correctly. Inherently then, this polling occurs when all other matters involved in that main loop have been settled, so that if the shutdown request is found, you shut down your NRF24L01 and anything else necessary (such as DACs) enable the "wake on interrupt" system, and then sleep. It is of course the case that to wake again, it has to use a (level triggered) interrupt, but that is not relevant to going to sleep in the first place. Note also the need to debounce a button so that the contact bounce of the button or switch which initiates the sleep does not immediately cause it to wake again.

Good idea. Based on the shutdown swich, I can sleep the radio with powerdown command. How do I sleep the Arduino? On wake up, how do I use the level triggered interrupt?

Or I can power down the whole circuit. Is there a way to power down the arduino circuit on standby? I think the NRF24L01 has the CE pin and I can set to disable.