Setup Arduino Uno R3 with L293D Shield to power two actuators

Hey guys,

This is my first time posting, if this is in the wrong section please forgive me (and move if necessary). I am working on a project powered by the Uno R3.

Components I have:

  • Uno R3
  • SainSmar L293D Shield
  • Two Progressive Automations PA-07 micro linear actuators (Link)

What I am looking to do is setup the Arduino to fully extend the actuator shaft 12inches and fully retract after it fully extends. No delay time inbetween is required. I plan to run these actuators for 3 days straight if possible.

I have gotten one actuator to extend about 3 inches and then retract about 3 inches using the Adafruit MotorTest Example.

I hope this is enough information, if not please let me know as I would be more than happy to provide anything else! By the way, this is what I am trying to achieve: Video Thank you so much for any help!

rooney:
I plan to run these actuators for 3 days straight if possible.

Datasheet states a duty cycle of 10%.
Could mean you should wait 9x the full stroke time before starting the next stroke.
Leo..

How will Arduino know when end of stroke is reached? Are you going to try to do it blindly with timers?

edgemoron:
How will Arduino know when end of stroke is reached? Are you going to try to do it blindly with timers?

I've timed it and it's 18 seconds to go from fully retracted to fully extended.

Wawa:
Datasheet states a duty cycle of 10%.
Could mean you should wait 9x the full stroke time before starting the next stroke.
Leo..

Oh I completely missed that! Thank you friends!

I ended up using this code:

#include <AFMotor.h>

AF_DCMotor motorTop(1); //identify 1st motor on M1
AF_DCMotor motorBottom(2); //identify 2nd motor on M2

void setup() {

//Setting motor speed

motorTop.setSpeed(255);
motorBottom.setSpeed(255);
}

void loop() {

motorTop.run(FORWARD); //M1 motor moving
motorBottom.run(BACKWARD); //M2 motor moving
delay(22000); //delay 22 seconds before reversing direction (this is the time it takes the motor to fully
extend/retract; change accordingly)

motorTop.run(FORWARD);
motorBottom.run(BACKWARD);
delay(22000); //

}