Last Updated: 08/01/2024

#57 GS-1502 Linear Servo

Components >> #57 GS-1502 Linear Servo

GS-1502 Linear Servo

GS-1502 Servo

GS-1502 Servo rear view

I'm always on the look out for components that would make model railway control easier. At the moment I am using MG90S servos for point control and one of the issues is rtansalating the rotary motino of the servo to a linear movement of the point. Wouldn't it be nice if there was a linear servo.

So while searching for something else I came across some linear servos on Ali express, as the servo was so cheap i ordered one to give it a try.

IMPORTANT

These servos come in a right of left handed versions and are often sold in pairs.

Mine came with a very small connector so I had to solder on the usual 2.54mm pitch connector. You can buy them with the standard servo connectors but watch what you are buying.

Below are the specifications.

Item Specifications
Weight 1.8g(include connector wire)
Speed 0.11 sec @3.7v
Torque 29.5g of force
Rotation maximum 180°
Voltage 3.7V-5V
Gear Nylon
Dimensions 21 x 15 x 12mm (LWH)
Type digital.
Life Cycle 15000 unloaded
Movement approx 7mm

WARNING: Although it states the life expectancy is 15000 moves, that is unloaded. If the servo is pushing/pulling any type of load that is going to be drastically reduced as the servo movement is a plastic gear moving up a metal thread.
although the servo may have some uses for light weight animations I certainly won't be using them for point control.

I tested mine with a PCA9685 PWM Servo driver board with some very basic code listed below.

It worked without any problems so the control side is no complicated.

Pros:

Very small
Easy to control
Can be mixed with other types of servo on the same PCA9685 board
True linear movement
Quiet


Cons:

Life Expectancy
Lower torque than SG90/MG90 so can only move very light loads.

Cicuit Diagram

If you have never used the PCA9685 PWM Servo driver board please check out this tutorial: PCA9685 PWM Servo Board

Wiring:for a few common boards

SDA/SCL connections

Arduino UNO: A4 (SDA), A5 (SCL) :

Arduino Mega 2560: 20 (SDA), 21 (SCL) :

ESP32: 21(SDA), 22 (SCL)

For other Arduino boards see:https://www.arduino.cc/en/reference/wire

Example 1: PCA9685GA1502v1.ino


Click to Download code: PCA9685GA1502v1.ino

A very simple sketch that moves the servo backwards and forwards at maximum speed followed by a slower movement.
This code is just for testing the board works.

 

 
/* PCA9685GA1502v1
   08/01/2024

   Test of a GS-1502 Linear Servo with PCA9685
   some quick and dirty code just to see how the board performs.

   Visit http://www.digitaltown.co.uk/projectPCA9685PointControl.php for some better control code
   that does NOT use delay() 


*/

#include "Wire.h"

#include "Adafruit_PWMServoDriver.h"
//PCA 9685 settings


Adafruit_PWMServoDriver servoBoard = Adafruit_PWMServoDriver(0x40);//Address found from I2C scanner
#define USMIN  832 // This is the rounded 'minimum' microsecond length based on the minimum pulse of 150
//#define USMIN  600 // This is the rounded 'minimum' microsecond length based on the minimum pulse of 150

#define USMAX  2400 // This is the rounded 'maximum' microsecond length based on the maximum pulse of 600
#define SERVO_FREQ 50 // Analog servos run at ~50 Hz updates
//end pca9685 settings

//sets the position of the servo in degrees.
void setServoPos(int servo, int pos) {
  //This first bit of code makes sure we are not trying to set the servo outside of limits
  int sendPos;
  if (pos > 179) {
    pos = 179;
  }
  if (pos < 0) {
    pos = 0;
  }
  sendPos = USMIN + ((USMAX - USMIN) / 180 * pos);
  if (servo > -1 && servo < 16) { //only try to move valid servo addresses
    servoBoard.writeMicroseconds(servo, sendPos);
  }
}

void setup() {
  Serial.begin(9600);
  Serial.println("PCA9685GA1502v1");

  servoBoard.begin();
  servoBoard.setOscillatorFrequency(27000000);
  servoBoard.setPWMFreq(SERVO_FREQ);  // Analog servos run at ~50 Hz updates

 
  delay(10);//let the above values take effect

  
}



void loop() {
  int q;
 setServoPos(15, 179);
 Serial.println("179");
 delay(2000);
 setServoPos(15, 0);
 Serial.println("0");
 delay(2000);

 for(q=0;q<180;q++){
  setServoPos(15, q);
  delay(50);
 }
 delay(1000);
 for(q=179;q>-1;q--){
  setServoPos(15, q);
  delay(50);
 }
 delay(1000);

}

Additional Resource Links

PCA9685 PWM Servo Board 27/12/2023

PCA9685 Servo Control with buttons, point/turnout control for model railways 01/01/2024

Contact


To ask a question please email the address in this image: and use #57 GS-1502 Linear Servo as a reference.