Useless Box Power Management

Daz1712:
Why put a sense on the switch?

Does using the switch multiple times mean the machine does multiple things?

Why not put your FET across the switch and,

Arduino powers up, first task, turn on FET to retain power.

Task complete, shut down Arduino, last thing turn off FET.

Indeed, there is a kind of sequence:

On the first use of the switch, the Arduino does something. On the second use of the switch, it does something else, etc...

I count the number of successive cycles using a variable. I want this variable to be kept in memory (I don't want the Arduino to be turned off immediately after the arm's retraction, to be ready in case the switch is used again).

I could maybe store the variable in the EEPROM memory before shutting down the Arduino, but in this case it would always start from where it was left, which is not what I want. (I want the sequence to begin from the start after a prolonged inactivity = after the Arduino has been powered down following a "long" inactivity).