Introduction: Miniature Camera Dolly

You will need:

3 LEGO train tracks

4 wheels from a LEGO train set

4 1x4 LEGO bricks

Arduino board

Wires

A Potentiometer

A Servo

Superglue

Arduino USB

Arduino app

Step 1: Setting Up Shop

Follow the SIK guide handbook and look at circuit 2, the potentiometer circuit. Connect the wires into the holes in the breadboard onto the positive and terminal sides. setting one at 9 Volts and the other at ground.

Step 2: The Camera Dolly

Connect the LEGO pieces together. Stack 2 1x4 lego bricks atop each other on each end of the train route. Then place the servo onto the connecting LEGO technic piece. Hold them together with superglue. On the side of the cab with flat tiles, place the 3D-printed camera mount on top using superglue. Wait for two minutes until the superglue dries.

Step 3: Putting Two Together

Hook up the USB-connected servo and potentiometer circuit together. Open up the Arduino program. Navigate to File, scroll to Examples, opt for Servo, choose Knob. Verify and Upload. Move the widget by turning the knob on the potentiometer.

Step 4: Servo-Knob Code

*

Controlling a servo position using a potentiometer (variable resistor) by Michal Rinott

modified on 8 Nov 2013 by Scott Fitzgerald http://www.arduino.cc/en/Tutorial/Knob */

#include

Servo myservo; // create servo object to control a servo

int potpin = 0; // analog pin used to connect the potentiometer int val; // variable to read the value from the analog pin

void setup() { myservo.attach(9); // attaches the servo on pin 9 to the servo object }

void loop() { val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180) myservo.write(val); // sets the servo position according to the scaled value delay(15); // waits for the servo to get there }