Using the RasPi Zero with the PIcamera, a Servo and the OC05 Servo Driver/Controller, you can shoot a panning time-lapse video.
Step 1: Preparing the SD Card for the Rasperry Pi Zero- Download Raspbian Lite and unzip
- Download Etcher and install
- Flash Raspbian Lite to a Micro-SD card using Etcher
- Open your terminal and go to the root of the SD Card
cd /Volumes/boot
echo 'dtoverlay=dwc2' >> config.txt
touch ssh
echo -n ' modules-load=dwc2,g_ether' >> cmdline.txt
The last 3 lines set up the RasPi Zero (and only the Zero) to be able to network via the USB port. Just verify that the last line has no newline before ' modules...' in cmdline.txt!
- Eject the SD Card
- Assemble everything as per this video:
- Connect USB Cable between your RasPi Zero and your computer.
- Either use a Mac or install Bonjour to SSH to your RasPi Zero:
ssh pi@raspberrypi.local
- Password is
raspberry
- Finally setup internet sharing on your computer allowing Broadcom Ethernet to connect to your WiFi via your computer.
sudo raspi-config nonint do_expand_rootfs
sudo raspi-config nonint do_i2c 0
sudo raspi-config nonint do_camera 0
sudo apt-get install vim python-smbus i2c-tools
sudo apt-get install python-picamera python3-picamera
sudo reboot
- The first 3 lines makes full use of your SD card, activates I2C for the servo controller and activates the PIcamera.
- Then I2C tools are getting installed and then PIcamera drivers.
- Then reboot to make the changes take effect.
- Login again.
- Test the connection to your servo controller, and if everything is fine you should see this:
pi@raspberrypi:~ $
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --
Step 3: Install OC05 Servo Drivercd ~β¨
git clone https://github.com/xinabox/rpOC05.git
cd rpOC05β¨
sudo python setup.py install
This will install the Servo Driver library, once installed, test by:
cd examples
python simpletest
Step 4: Program- Copy and Paste the code below into xservo.py.
- Create a frames directory
cd ~
mkdir frames
python xservo.py
It should now start taking pictures and store them in frames.
Step 5: Extra steps- You can have the program run automatically by
crontab -e
- And then write at the bottom of the file:
@reboot python /home/pi/xservo.py
- Once your shoot is finished, you can copy the pictures to your computer. I use
scp
- And then I use convert from ImageMagick, like this:
convert -quality 100 frames*.jpg outputfile.mpeg
Comments