Arduino + Stepper Motor Power Cut problem


I’m trying to use a stepper motor to control a curtain position. Basically the motor turns in 2 positions, to left and right.
My issue is that after a power cut the motor won’t remember where it was (let’s say the curtains was closed) and if I press the close button again, it will break them, moving into the wrong direction.
Is this only possible with EEPROM memory?



You should be able to keep track of what position it was in by saving some variable to EEPROM like you mentioned. Another option might be to add a physical limit switch to detect what position it is in (e.g. placing something like one of our snap-action switches where it will be triggered when in one position but not the other).


1 Like