Make a Motorized Camera Slider with Joystick Controlled | DIY



Today, I made an Arduino controlled camera slider. There are many cheap sliders available but none that are motorized. So, I made my own using a stepper motor, a belt pulley, few wood sticks and an Arduino. It is also possible to control the camera direction with a joystick. The total cost of the project is about $ 40. Required Hardware: Wooden Sticks - https://goo.gl/RZe3Zf Servo Motor - https://goo.gl/cvdmtT 18650 Battery Holder - https://goo.gl/VU4dfb 18650 Battery + Charger - https://goo.gl/UEJTff Stepper Motor + ULN2003 - https://goo.gl/bySDZQ GT2 Pulley 40 Teeth - https://goo.gl/xKT5xm GT2 Pulley 36 Teeth - https://goo.gl/ZwqLLc Belt - https://goo.gl/WC57kH Cylinder Liner 10mm - https://goo.gl/wP9MkP Roller Bovine Wheel - https://goo.gl/A3bGWV Breadboard - https://goo.gl/ExxNWy Jumper Wires - https://goo.gl/EGTafY Joystick Module - https://goo.gl/qupktG Arduino Compatible Nano - https://goo.gl/f3pdKS Hot Melt Glue Gun - https://goo.gl/2znyr6 Camera Tripod Holder - https://goo.gl/umv9ug Optional Products: 16MP Ultra HD Action Camera - https://goo.gl/rj8qtK XIAOMI Wowstick - https://goo.gl/wEV7e2 ------------------------------------------------------------------------ Studio Equipment: Studio Lighting Softbox - https://goo.gl/PM3xTM Adjustable SoftBox Tripod - https://goo.gl/j1N2UP Zhiyun Smooth Q Gimbal - https://goo.gl/wcNqB8 Xiaomi Mi6 - https://goo.gl/EkiV7i Magnetic Blue Mat - https://goo.gl/5j4Q7y ------------------------------------------------------------------------ Social Media: Subscribe to Channel - http://bit.ly/MertArduino Facebook - http://bit.ly/MertArduinoFB Instructables - http://bit.ly/Mertduino
------------------------------------------------------------------------

Source Code:
#include <Servo.h>
#include <Stepper.h>

#define bottomServoPin 3  //Digital PWM pin used by the bottom servo
#define upperServoPin 5   //Digital PWM pin used by the upper servo
#define bottomJoyPin 1    //Analog pin to which the joystick (Y) is connected for the bottom servo control
#define upperJoyPin 2     //Analog pin to which the joystick (X) is connected for the upper servo control
#define stepperJoyPin 0   //Analog pin to which the joystick is connected for the stepper motor control
#define stepsPerRev 64    //Change this to fit the number of steps per revolution for your motor
#define stepperSpeed 50  //Speed of the stepper motor

//Digital pins to which the stepper motor drive is connected
#define IN1 8
#define IN2 9
#define IN3 10
#define IN4 11

//Servo objects created to control the servos
Servo bottomServo;
Servo upperServo;

//Stepper object created to control the stepper motor
Stepper stepperMotor(stepsPerRev, IN1,IN3,IN2,IN4);


//Variables created for joystick values
int bottomJoyVal;
int upperJoyVal;
int stepperJoyVal;

/* Below there is nothing to change, all variables and pins are defined above.
 * In the following section, you can only set the joystick threshold value and 
 * the maximum and minimum angle values at which the servo motor will rotate.*/

void setup(){
  bottomServo.attach(bottomServoPin);
  upperServo.attach(upperServoPin);
  stepperMotor.setSpeed(stepperSpeed);
}

void loop(){
  bottomJoyVal = analogRead(bottomJoyPin);
  upperJoyVal = analogRead(upperJoyPin);
  bottomJoyVal = map(bottomJoyVal, 0, 1023, 60, 120);
  upperJoyVal = map(upperJoyVal, 0, 1023, 60, 120);
  bottomServo.write(bottomJoyVal);
  upperServo.write(upperJoyVal);

  stepperJoyVal = analogRead(stepperJoyPin);
  if(stepperJoyVal < 450) {stepperMotor.step(1);}
  if(stepperJoyVal > 550) {stepperMotor.step(-1);}
}