Arduino Mega controlling a linear actuator? (Setup for retracting?)

Dear fellow arduinees,

Since a few days I've been trying to come up for a feasible solution to my next project - What I'm trying to do is control a linear actuator (this type here: using an Arduino Mega to scare the neighbourhood's kids during Halloween. As far as I understood the linear actuator I bought is a really simple type, it basically only has the standard (+) (-) inputs, so there's no fancy motor driver needed afaik.

What I need to be able to control: 1) Stroke speed (using a pot on an analogue input) 2) Stroke length (using a pot on an analogue input) 3) Start/stop button

On the programming side of things, I think I'll figure stuff out myself, but I'm still unsure on how to hook up the motor to the Arduino. I've looked through all those "How to control a DC motor" Tutorials, but the still don't make it quite clear to me, especially because I'm not sure if the actuator can be treated same like a DC motor.

What I would try (but I figured asking you for the culprits before killing anything, maybe it would be smart to hook up stuff like a capacitor in front of the actuator?) is the following setup:

Arduino output with PWM Signal attached to -> Transistor's base to switch the 24V 5A needed (Does anybody know a cheap transistor that can handle 24V 5A?) -> Linear actuator

That way I could use one Pot to control the PWM length making the motor move faster/slower due to the frequency the transistor switches the power. The other Pot would be then used to decide how long the PWM signal is sent to the transistor's base, deciding how long the stroke length is in conjunction with the speed.

My biggest culprit is: I need to inverse the power to make the actuator retract after it has been extended for the chosen length. How can I do this? My first idea was doing a dual setup, using another additional transistor hooked up the other way round adding a diode to prevent power flowing backwards if the vice-versa transistor is in use - but I'm not sure if that's a good solution at all... Have a look at my try here:

I'd be happy for any help - Halloween is near ;D

Regards, - Max

This will blow up. You have a nice smoke generator near your 24V battery.

Google for H-bridge driver! There are many good and powerful motor drivers out there.


Thank you so much! That was just what I was looking for, I found a neat tutorial here:

Ty & Goodbye, - Max

This tutorial seems good for the beginning. You may want to consider to search for a 'stronger' H-bridge chip/driver than the L293. I doubt it will survive when your linear actuator stalls or has to do some real work.

Have a look at as well. They cost more, but they won't blow up in your face as easily.

You should also get a linear actuator with an internal pot to make position detection easier.


The Pololu drivers look awesome! I think I found one that fits great and that I can use along with my PWM idea:

I've been looking for linear actuators with internal pots, but was unlucky finding any that were that cheap + that fast as the one that i bought (230mm/s is kinda cool I think) - And, after all, it's just for Halloween decoration, so it doesn't need to be too precise.

Regards, - Max