Create Makers

How To Make a Motorized Camera Slider

Disclosure: Some of the links below are affiliate links and we only earn a small commission if you purchase through our links at no additional cost to you. The earning mainly used for maintaining the website.

Taking stunning and smooth footage is so satisfying with a camera slider. As you clicked on this blog, you are surely looking for one. But, the price of getting the camera slider is always in consideration. So, in this blog, you will make your own camera slider. And the best thing, it is a motorized camera slider without breaking your bank.

Starter Pack

The Camera Slider Structure

  1. Pinewood
  2. Diameter 6mm Wood Dowel Pin
  3. Plywood
  4. Diameter 8mm Stainless Steel Shaft
  5. LM8UU Linear Bush Bearing
  6. GT2 Timing Belt
  7. GT2 20 Teeth Pulley
  8. GT2 20 Teeth Idler Pulley
  9. M6 Wood Insert E-Type
  10. M6 Furniture Leveling Feet
  11. 1/4” to 3/8” Tripod Screw
  12. Epoxy/Aryclate Adhesive

The Electronic Components

  1. Arduino Pro Mini 5V
  2. 28BYJ-46 Stepper Motor
  3. ULN2004 Driver Board
  4. HC-06 Bluetooth Module
  5. Wires
  6. Slide Switch
  7. Roller Lever Micro Switch
  8. 18650 Rechargeable Battery
  9. 18650 Battery Holder 2 Slots

The Software for Programming

  1. Arduino IDE
  2. Visual Studio Code (Build Flutter application to control camera slider)

Steps To Make The Motorized Camera Slider

Making the camera slider structure is the most crucial part of this project. Alignment of the linear bush bearings and diameter 8mm shaft. So the design of the camera slider is built to be easy to align. Even if you are not an engineer, the design will not be that difficult for you.

If you know about Arduino, then wiring and programming the Arduino parts is just a fingertip to you. The codes are simple and nothing so fancy. The only things, even I myself (obviously not a programmer), find quite a tough time in learning Flutter – an open source framework by Google to build multi-platform applications. Well, the good news is you can just download the apps that I have built and published in Google Play Store, Slide Motion. And besides Flutter, you may use MIT APP Inventor 2 to build the apps.

Designing The Camera Slider Structure

For simplicity, the design of the camera slider is based on pinewood since woodworking is not difficult for everyone to make. And also you can find pinewood in any hardware shop easily. The 3D of camera slider, Fusion 360 is a great option for a hobbyist to start with. Visit my GrabCAD to download the design.

The Circuit

Every hobbyist should know about Fritzing. It is easy to represent the wiring diagram. And it is free too.

Programming The Motorized Camera Slider

The programs are divided into two parts, one part is the Arduino program for the functionality of the motorized camera slider and the second part is the Flutter program for controlling the unit.

Arduino Codes

#include <SoftwareSerial.h>

const int stepPinA = 4;
const int stepPinB = 6;
const int stepPinC = 8;
const int stepPinD = 10;
bool motDir = false;

bool isButton = false;
bool lastButton = false;

const int switchPinL = 11;
const int switchPinR = 12;
bool switchState = true;

long prevMillis = 0;
long interValMillis = 150;

SoftwareSerial bleSerial (2, 3);
const byte numChars = 32;
char receivedChars[numChars];
char tempChars[numChars];
int isTravelled = 0;
int speedVal = 2;
int delaySec = 0;
bool isReceived = false;

void setup() {
  bleSerial.begin(9600);
  delay(100);

  pinMode(switchPinL, INPUT_PULLUP);
  pinMode(switchPinR, INPUT_PULLUP);
  pinMode(stepPinA, OUTPUT);
  pinMode(stepPinB, OUTPUT);
  pinMode(stepPinC, OUTPUT);
  pinMode(stepPinD, OUTPUT);
  delay(100);

  if(digitalRead(switchPinL) == false){
    motDir = !motDir;
  }

  delay(100);
}


void loop() {
  unsigned long currentMillis = millis();
  while(switchState == true){
    receivedData();
    if(isReceived == false){
      strcpy(tempChars, receivedChars);
      parsedData();
      isReceived == false;
      motDir = !motDir;
      switchState == false;
      currentMillis = millis();
      prevMillis = currentMillis + 3500 + delaySec*1000;
      isButton = !isButton;
    }

    delay(10);
  }


  if(isTravelled == 1){
    programFlow(halfClockwise, halfAnticlockwise);
  }

  else{
    programFlow(rotateClockwise, rotateAntiClockwise);
  }


  timeCheck(currentMillis);
}
void receivedData(){
  static byte index = 0;
  char endMarker = '\n';
  char readChars;

  while(bleSerial.available() > 0 && isReceived == false){
    readChars = bleSerial.read();
    if(readChars != endMarker){
      receivedChars[index] = readChars;
      index++;
      if(index >= numChars){
        index = numChars - 1;
      }
    }

    else{
      receivedChars[index] = '\0';
      index = 0;
      isReceived = true;
    }
  }
}


void parsedData(){
  char* strtokIndex;

  strtokIndex = strtok(tempChars, ",");
  isTravelled = atoi(strtokIndex);

  strtokIndex = strtok(NULL, ",");
  switch(atoi(strtokIndex)){
    case 0:
      speedVal = 20;
      break;
    case 10:
      speedVal = 10;
      break;
    case 20:
      speedVal = 2;
      break;
  }


  strtokIndex = strtok(NULL, ",");
  delaySec = atoi(strtokIndex);
}
int cycle = 2560;

void rotateClockwise(){
  step_1();
  step_2();
  step_3();
  step_4();
}


void rotateAntiClockwise(){
  step_4();
  step_3();
  step_2();
  step_1();
}


void halfClockwise(){
  for(int a = 0; a <= cycle; a++){
    unsigned long currentMillis = millis();
    step_1();
    step_2();
    step_3();
    step_4();
    timeCheck(currentMillis);
    if(switchState == true || a == cycle){
      switchState = true ;
      bleSerial.print("D");
      break;
    }
  }
}


void halfAnticlockwise(){
  for(int b = 0; b <= cycle; b++){
    unsigned long currentMillis = millis();
    step_4();
    step_3();
    step_2();
    step_1();
    timeCheck(currentMillis);
    if(switchState == true || b == cycle){
      switchState = true ;
      bleSerial.print("D");
      break;
    }
  }
}


void step_1(){
  digitalWrite(stepPinA, HIGH);
  digitalWrite(stepPinB, LOW);
  digitalWrite(stepPinC, LOW);
  digitalWrite(stepPinD, LOW);
  delay(speedVal);
}


void step_2(){
  digitalWrite(stepPinA, LOW);
  digitalWrite(stepPinB, HIGH);
  digitalWrite(stepPinC, LOW);
  digitalWrite(stepPinD, LOW);
  delay(speedVal);
}


void step_3(){
  digitalWrite(stepPinA, LOW);
  digitalWrite(stepPinB, LOW);
  digitalWrite(stepPinC, HIGH);
  digitalWrite(stepPinD, LOW);
  delay(speedVal);
}


void step_4(){
  digitalWrite(stepPinA, LOW);
  digitalWrite(stepPinB, LOW);
  digitalWrite(stepPinC, LOW);
  digitalWrite(stepPinD, HIGH);
  delay(speedVal);
}


void programFlow(void funcA(), void funcB()){
  if(isButton != lastButton){
    delay(delaySec*1000);
    lastButton = isButton;
  }


  if(motDir == true){
    funcA();
  }

  else{
    funcB();
  }
}


void timeCheck(unsigned long currentMillis){
  if(currentMillis >= prevMillis){
    if(currentMillis - prevMillis >= interValMillis){
      prevMillis = currentMillis;
      if(digitalRead(switchPinL) != digitalRead(switchPinR)){
        switchState = true;
        bleSerial.print("D");
      }
    }
  }
}

Flutter Android Apllication

Download the apps at Google Play Store, Slide Motion.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments