Controlling Firgelli linear actuator speed

I have a linear actuator ( that I want to be able to slow down. Right now, the shaft moves too quickly. I’m not sure how to do this. I was looking into varSpeedServo.h library but couldn’t implement it.

#include <Servo.h> 

#define LINEARACTUATORPIN 9        //Linear Actuator Digital Pin

const int button1Pin = 4;     // the number of the pushbutton pin

// variables will change:
int button1State = 0;         // variable for reading the pushbutton status

Servo LINEARACTUATOR;  // create servo objects to control the linear actuator

int linearValue = 10000;   //current positional value being sent to the linear actuator. 

void setup() 
  //initialize servo/linear actuator objects
  LINEARACTUATOR.attach(LINEARACTUATORPIN, 1050, 2000);      // attaches/activates the linear actuator as a servo object 

  // initialize the pushbutton pin as an input:
  pinMode(button1Pin, INPUT);   

  //use the writeMicroseconds to set the linear actuators to their default positions


void loop() 

  // if the pushbutton is pressed set the linear value
  button1State = digitalRead(button1Pin);
  if (button1State == HIGH) {    
    // set the position value  
    linearValue = 1050; 


    if (button1State == LOW) {    
    // set the position value  
    linearValue = 2000;  

  //use the writeMicroseconds to set the actuator to the new position

Please don't cross-post.


If you don't need to get different speeds in your sketch, and don't need a very specific speed I see an "easy" no code solution.It's the hardware solutions:

  • By providence if you bought the 30:1 version, returning your stuff to change it for the 63:1 or 100:1 version could give you 1/2 or 1/3 speed.

-I saw a board which can also control the speed via one of the build-in potentiometer, it seems to work with -P serie so you have to change your actuator. Check arduino forums to use this board because between theory and reallity there is a world !
here the board :