Moving servo 180 over 1 hour...

Move servo arm 180 degrees over 1 hour, basically 3 degrees per minute for 60 minutes, then back again the same speed. This is for an automated incubator I'm designing. This is my first Arduino project ever. I'm looking forward to doing more. Thanks.

Have you looked at the servo sweep example? It would be a great step, confirming that you have the servo hooked up properly and that you can push a sketch to the arduino.

But it is pretty much exactly what you are asking for, if you adjust the delays.

You might even change it to use servo.Writemicroseconds() instead of servo.Write(), since the microseconds give finer steps. Just a little math here will be needed.

Be aware that not all hobby servos can rotate a full 180 degrees.

Edit: Oh, and plan on powering the servo from a separate power supply. 90+ % of all servo problems come from improperly powering the servo. Attempting to power the servo from the arduino 5v pin is the most common example of powering a servo improperly.

vinceherman:
It [servo sweep] is pretty much exactly what you are asking for, if you adjust the delays.

It might not be what you (OP) actually need though, if there's more to the project than just the servo motion, which you might not have mentioned here or perhaps haven't thought of yet. It will be a good idea to look ahead to other things that might be required in time; you may soon regret using a blocking approach with any delay() when you need to re-jig the code to allow other things to happen cleanly.

the sweep is possible for little time. but whit 180 steps it takes less than a minute for 15ms
to lower the step to hour for 180degrees you should need to set it to 20.000ms (20sec) per degree.
the biggest problem is that it possible can be adjusted when it is waiting to move.

first off all why needs to go 180degrees over hour. is there not a smarter way to do the same thing.

problem the steps are to small and time it to long. a small voltage diffrenc and it can change your position

if it is not a big force than you can also think about a clock or orther timelapse tools that we use for camera's

That can be done, problem with using servo, at startup the servo will jump from where ever it is to start position at full speed. If it happens to be near 180 and something (power failure, etc.) causes a reset, it will jump almost instantly to start position, can your incubator / incubatee tolerate that?

“incubatee”

:slight_smile:

Well, the OP didn't specify what was being incubated. :stuck_out_tongue:

outsider:
problem with using servo, at startup the servo will jump from where ever it is to start position at full speed. If it happens to be near 180 and something (power failure, etc.) causes a reset, it will jump almost instantly to start position, can your incubator / incubatee tolerate that?

That's a good point. Might be feasible to write the position to EEPROM each time it moves, then on power up in setup() read the last position from EEPROM and servo.write() that value before the servo.attach(). Then it will be commanded to where it already is, and not actually move.

trucker0werner:
problem the steps are to small and time it to long. a small voltage diffrenc and it can change your position

Can you elaborate on that trucker0werner?

Might be feasible to write the position to EEPROM each time it moves, then on power up in setup() read the last position from EEPROM and servo.write() that value before the servo.attach().

Yep I thought of that, slow as the updates are (the sketch I lashed up was about every 7 + seconds) it wouldn't put much wear on the EEPROM, even then you could change the R/W addr every so often.

outsider:
it wouldn't put much wear on the EEPROM, even then you could change the R/W addr every so often.

Is the 100k writes issue per EEPROM "cell" then, not the "bank" in total?

per location.