DIY Motorized Camera Slider

This ain’t for the faint of heart, people. you’ll need to know some programming, how to solder, and have some basic common sense so you don’t burn your house down.

Whats needed
Camera slider
Arduino – Uno or nano, or any others (If you’re feeling extra froggy, this can be done with a Raspberry pi.)
Easydriver Stepper motor controller
Arduino IDE
Processing 3 – JAVA IDE

Arduino Code

int Stepping = false;
int Speed = 0;
void setup() {               
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  digitalWrite(8, LOW);
  digitalWrite(9, LOW);
  Serial.begin (9600);
}

void loop() {
   
  if(Serial.available()){
  char val = Serial.read();
  if(val == 'm'){     //move/start
    Stepping = true;
  }
  
  if(val == 's'){     //stop
    Stepping = false;
  }
  
  if(val == 'f'){     //forward
    digitalWrite(8,LOW);
    }
    
  if(val == 'b'){     //back
    digitalWrite(8,HIGH);
    }
  if (val == '1'){
    Speed=1;
  }
  if (val == '2'){
    Speed=5;
  }
  if (val == '3'){
    Speed=10;
  }
  
  }
  if (Stepping == true){
    digitalWrite(9, HIGH);
    delay(Speed);         
    digitalWrite(9, LOW);
    delay(Speed);
    }       
}

Java

import controlP5.*;
import processing.serial.*;

Serial port;
ControlP5 cp5;
PFont font;

void setup(){
  size(300, 400);
  printArray(Serial.list());
  port = new Serial(this, "COM7", 9600);//Set COM* to whatever Serial port is reported by your computer.
  cp5 = new ControlP5(this);
  font = createFont("calibri light", 20);
  
cp5.addButton("forward")
  .setPosition(25,345)
  .setSize(100,50)
  .setFont(font)
;

cp5.addButton("backward")
  .setPosition(175,345)
  .setSize(100,50)
  .setFont(font)
  ;
  
cp5.addButton("begin")//m
  .setPosition(87,150)
  .setSize(125,50)
  .setFont(font)
  ;
  
cp5.addButton("stop")
  .setPosition(75,225)
  .setSize(150,75)
  .setFont(font)
  ;
  
cp5.addButton("fast")
  .setPosition(25,50)
  .setSize(75,50)
  .setFont(font)
  ;
cp5.addButton("medium")
  .setPosition(115,50)
  .setSize(75,50)
  .setFont(font)
  ;
  
cp5.addButton("slow")
  .setPosition(210,50)
  .setSize(75,50)
  .setFont(font)
  ;
}

void draw(){
 background (200, 200, 200); 
 textFont(font);
 text("Slider Controll Beta1.0", 70, 30);
}

void forward(){
  port.write('f');
}

void backward(){
  port.write('b');
}

void begin(){
  port.write('m');
}

void stop(){
  port.write('s');
}
void fast(){
  port.write('1');
}
void medium(){
  port.write('2');
}
void slow(){
  port.write('3');
}

Leave a Reply