Sleep Mode and SENSOR

Here is the thing. I have a hall sensor connected (thorugh pin2) in an Arduino NANO. I would like to make the device to sleep mode 3 min after the sesnor stopped reciving data. Then as soon as the sesnor recives data the board must be powered up.

Yes, just go on. What stops You?

But how it would be the code?

If You have a code shop in town, visit it. Or search for Arduino Nano + sleep, as a beginning. Also search for waking up Arduino from sleep.