Go Down

Topic: DC motor &power cut off issue (Read 64 times) previous topic - next topic



I have  an issue i dont know if there any solution for it. I want to program a DC motor to run for 1 minute

to the right,and  then it turned off. the problem is that,for example if the power cuts off at 20 second,and
 when  I  connect the power again ,it  will be stopped in a position   when the power cuts off( 20

second),and if i want to run the motor  again ,it will  go for new 1 minute. is there a way so the motor  continue the 40 second that was not finished before?

with so much thanks for reply........


Feb 17, 2020, 10:23 pm Last Edit: Feb 17, 2020, 10:24 pm by aarg
Yes, you could put limit switches at both ends and sample them at boot time. Otherwise, you need to store the position somewhere that survives a power down, like EEPROM (but that typically frustrates beginners).
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.


Feb 18, 2020, 02:00 am Last Edit: Feb 18, 2020, 02:12 am by tatra
is it possible to  give  me a simple code for that???

i want to replace the dc motor at main time with light and push button,so i can understand it better,

so the light will turn on for i minute,and if the power cut off, at 20 seconds, when the power get back, and i press on push button the light will turn for 40 seconds and then turn off.

thanks for reply

Go Up