Simple project with a servo motor

Hi all..

I need a little help, with a small project, only including an Arduino NANO Every and a small servo motor.
What I want it to do is: When the Arduino powers up, the servo motor should go to a certain position, and when the Arduino is powered down, the servo should go back to the first position. That's all, only those 2 positions. Is it possible capacitors or a small battery, and how?
I know the easiest would be to have power to the Arduino all the time, and then detect if a power signal is there or not, to do the different positions, but what will happen, when it overflows after 50 days?

I don't have any programming or circuit drawings yet, because I'm still in the planning phase. :slight_smile:

Thanks in advance.

I don't see how 50 day overflow is relevant to your project but even if it were, there are ways to handle it without issue.

tlin:
and when the Arduino is powered down, the servo should go back to the first position.

What causes the power-down? Are you referring to an organised power-down or an unexpected power-down, or both?

The Arduino will need to move the servo to the required position BEFORE it is powered down. How will it know how to do that?

As @widlbill has said I can't understand why you think 50 days might be an obstacle.

All of these issues might be obvious if you provide a full description of the project you want to create.

...R

tlin:
I know the easiest would be to have power to the Arduino all the time, and then detect if a power signal is there or not, to do the different positions, but what will happen, when it overflows after 50 days?

I guess you are going to use millis() function for timing. If so, read the Note and Warning part on millis() function reference. It mentions how to write rollover-safe code.