Raspberry Pi Moving Timelapse




Introduction: Raspberry Pi Moving Timelapse

This is how to use a raspberry pi along with it's camera to create beautiful moving timelapse videos (called hyperlapse vidoes)

things you need:

  • A raspberry Pi. The instructions are for a Raspberry Pi B+ but you can adapt for other models (the pin layout may be different)
  • A raspberry Pi Camera module
  • A stepper motor. Very in expensive and usually comes with controller. I used RioRand Stepper Motor 5V DC 4-Phase 5-Wire with ULN2003 Driver Board
  • Pulley wheel for the stepper motor shaft
  • Raspberry Pi case
  • washing line
  • (Optional) Wi-Fi Adaptor for Raspberry Pi
  • female to female leads to connect the boards
  • USB Portable Power pack (at least 4000mAh) and cable. This is also optional but needed to allow your hyperlapse rig to work where there is no plug (i.e. outdoors)
  • small metal angle bracket (like mechano)

ok so the basic idea once the rig is assembled and the program uploaded the pi will repeat the following three steps for as long as you configure it to do so:

  1. take a picture with a unique name
  2. move
  3. wait for a pre-determined amount of time

Step 1: Connect the Camera

So to connect the camera is quite simple and there is a lot of help online. The official help video is here:


but I found this to be more helpful


once installed and you have enabled the camera try it out with the raspistill -o image.jpg command. Hopefully it takes a picture but if not you need to go back and check from these links until it works properly.

Step 2: Access

next you need to setup remove access from your laptop or PC.

if you have a wireless adapter like this one:


then now is the time to install and set it up. There is help on that here:


Next we need two free programs: the first allows you to get remote access to a terminal prompt where you can run the script and the second allows access to get the pictures off.

Download and install putty:


and then WinSCP:


you can go for alternatives if you like but these are pretty good

Step 3: Connect the Stepper Motor

ok so you should have a motor that looks something like the picture.. First put the pulley on make sure the grub screw tightens onto the flat part of the shaft.

First connect the motor to the control board this is the white tipped cable and only goes in one way. Next take the female to female leads to connect the motor control board to your Pi. I have drawn how to do this with a Raspberry Pi B+ based on the following URL:


once it is connected use WinSCP to upload the following script to your pi as stepper.py

two important lines you can play with once the rig is working is this one:

for x in range(1, 200):

which tells the script how many times to take a picture and move and this one:

for x in range(0, 2000):

which tells the script how long between pictures. 2000 works out to be about 52 seconds

Also if you have a big microSD card you might want to increase the resolution of your individual pics. You can do this by adding the line "camera.resolution = (2592,1944)" immediately before the line that says "camera.capture(nextpicname)" . That is the maximum resolution so it will fill space quick (200 pics is approx 430Mb or possibly more) but you can also try lower resolutions.

Step 4: Assemble and Test

next you need to connect the stepper motor to the case. I drilled a hole in my pi case and bolted on the angle bracket. Next I bolted on the motor to the other end of the angle bracket. The motor is now on one end of the pi case with the shaft parallel with the top edge as in the photo.

now string up the washing line in an appropriate place for a test like across a room. I have found the best type of line is one with a plastic coating and not too steep so that the rig can roll along it. Next hook the pulley over the line so it kind of looks like a cable car. The whole pi and rig should now be sitting on the line. remember that the pulley goes clockwise by default so take account of that when planning which way the rig will travel.

Now connect the power to you pi and let it boot. The cable to the USB adapter and socket needs to be free enough to be connected to the pi for the whole run. Next connect to your pi with putty and WinSCP. on the terminal (through putty) type in sudo python stepper.py. the script should start and after a short pause print "take pic1" to the command line. Then the motor should kick in and move the pi along the line a very short distance. It is almost imperceptible so it will be more obvious if is moving (or not!) after a few cycles. Through putty it should look like the picture after a while.

After the script completes or you think enough pictures are taken you can stop the script with ctrl+c then download the pictures from your Pi to your laptop or PC with WinSCP. They are numbered in order.

Step 5: Make the Movie

next you need to combine the pictures into a movie. I use Sony Vegas Movie Studio but there are plenty of other tools out there free that are as good for this task. You want to make sure your pics are rendered in order, some tools might order incorrectly because they do it alphabetically (1,10,11 etc) rather than (1,2,3) so you might have to rename the first nine files like 01, 02, 03.

I suggest trying a frame rate of 4 frames per second (fps) and about 80 -120 pics is good for a short film to get the idea. Also a bit of appropriate background music can make a movie even better.

Finally stabilisation can greatly improve hyperlaspe videos. If you rig is like mine it can get buffeted by the wind. If you upload your video to youtube you can select the option to have youtube stabilise the video for you which is well worth the price (free!)

Here is two basic examples I took but there is loads of potential subjects like setting suns, rotting fruit, melting ice, incoming tide etc, etc...



Step 6: Additional Work..

now you have your rig there is loads of other exciting things you can try. One obvious one that I tried is instead of having the rig move along a washing line you can use thread to have the rig move up a plank or similar where the thread is fixed to one end of the plank and the other end gets wound round the pulley as the motor advances. This drags the whole rig up the plank. Even better put tracks from a toy train set on the plank and mount the rig on a toy train wagon so the whole thing is smoother.

Alternatively you can fix the camera module directly on the top of the motor and adjust the script so that it turns less in each step and have the shot rotate instead of pan.

Another enhancement is to have the Pi start the stepper script as soon as your Pi boots. The way to do this is with crontab. Use sudo crontab -e to see what is setup and sudo crontab -l to see what is setup. There is plenty of help on this topic online too. what this then allows you to do is go outside with the USB portable power source and simply plug it in to take pictures without the immediate need of a plug socket or laptop/PC.

Good luck and have fun and don't forget to post results in the comments. Thanks for reading!

Backyard Contest

Participated in the
Backyard Contest

Be the First to Share


    • Go Big Challenge

      Go Big Challenge
    • Chocolate Challenge

      Chocolate Challenge
    • Digital Fabrication Student Design Challenge

      Digital Fabrication Student Design Challenge



    6 years ago

    j'ai fais un dolly en lego dans le meme style avec un moteur pas à pas...


    7 years ago on Introduction

    Looks like you're using Adafruit's stepper motor? If you want to work with me and make it so you can control this timelapse using your phone let me know! I did an Instructable on remote controlling a stepper using the Raspberry Pi :)

    But awesome project I like it a lot!


    Reply 7 years ago

    hi Ranasoraus thanks for the comment .sounds like an intesresting idea worth exploring. i am using connectbot on android to connect to my pi without a laptop but this does require the phone and pi to be on the same network. the motor and camera are controlled together in the script so a photo is taken in between do you think that could work?


    Reply 7 years ago

    So what you are doing is basically creating an SSH session between the Pi and your phone, and are running scripts using terminal is my understanding.

    My project basically automates that need of having to manually run the script, but rather being able to hit a button on a website or phone app. An example being a user would log into his timelapse account and they could choose an amount of seconds(distance) and other various options of the timelapse and have it able to run according to the need.


    Reply 7 years ago

    hi Ranasoraus do you have a link to your project to share?


    Reply 7 years ago on Introduction



    7 years ago on Introduction

    Thanks for the comment tomato skins! Yes I am planning to add a better video soon that does it justice and for that one I will try youtube, good idea..


    7 years ago on Introduction

    Really cool project! I might suggest uploading your video to YouTube or someplace like that so that user's don't need to download it if they want to look at it. Again, great project!