You can capture all sorts of interesting night time sky events with a camera, everything from planes, stars and maybe the odd shooting star
The aim of this tutorial is to setup the Raspberry PI (rPI) NoIR camera to take a photo every 12 seconds over 9 hours. The NoIR camera doesn’t have the Infra-red filter so is well suited to taking images of the sky at night.
You can use a normal rPI or the rPI Zero, both work equally well. You will need an external battery pack to power the PI. I have linked to one below. The advantage of the battery model I have is that I can run two cameras from the same battery and more importantly it will last for more than 9 hours.
This tutorial doesn’t go into the steps of setting up the rPI with raspbian as there are plenty of tutorials that explain how to do this already. It also assumes you have a headless rPI setup as all commands I have executed via SSH. There are some good tutorials on setting up a headless.
Some videos created can be found here: https://vimeo.com/user112616269
- Tested on a Raspberry B+ or upwards including the Zero
- Pi NoIR camera
- Tupperware box + some blutak
- An Anker Power Bank
- A decent USB cable
- Clear skies at night
Time to complete: 120 minutes
- Weatherproof the RaspberryPI
- Create a script for the timelapse
- Make the script execultable
- Auto start the script on boot
- Position the camera
- Next morning...
- Create the timelapse video
1. Weatherproof the RaspberryPI
Cut a hole in the side of the tupperware box large enough to fit the lens of the picamera through, blutak the camera in place
2. Create a script for the timelapse
Create a the file /home/pi/camera/camera.sh and add the contents as follows:
#!/bin/bash /usr/bin/raspistill -vf -hf -w 1920 -h 1080 -ISO 800 -ss 6000000 -br 80 -co 100 -t 18000000 -tl 50000 -o /home/pi/camera/image%08d.jpg
-tl time between shots in milliseconds
-t how long to do this for in milliseconds, e.g. 32400000 = 9 hours
-ss shutter speed in microseconds, 6000000 = 6 seconds
3. Make the script execultable
sudo chmod u+x /home/pi/camera/camera.sh
4. Auto start the script on boot
Edit /etc/rc.local to autostart the script on boot
#!/bin/sh -e /home/pi/camera/camera.sh & exit 0
5. Position the camera
Connect it all up and place outside at night
6. Next morning...
In the morning, put the SD card into another PC and move the jpg files from /home/pi/camera/ to a local directory
7. Create the timelapse video
Enter the directory on your PC and run the following command
mencoder mf://*.jpg -mf fps=15:type=jpeg -noskip -of lavf -lavfopts format=mov -ovc lavc -lavcopts vglobal=1:coder=0:vcodec=mpeg4:vbitrate=5000 -vf eq2=1.2:0.9:0.0:1.0,scale=1280:-2 -o lapse.avi