Tag Archives: Raspberry Pi Camera

Turn a Raspberry Pi / PiFace Display into a Time-Lapse Camera

Make a Raspberry Pi and PiFace Display into a Time-Lapse Camera using Snap-Camera

Skill Level: Beginner – Intermediate
Project Completion Time: 2-3 hours

TimeLapse Camera – Parts List
— Raspberry Pi – Rev 2 Board
— Pi-Face Display Module (element14)
— Raspberry Pi Camera Module (element14)
— Mobile Phone/tablet Battery Charger Pack (5000mAh or higher)
**(I’m using an “Anker Astro 3E 15000mAh dual USB model)
— 8,16,32,64GB SD Card or Micro-SD (Class 10 – 45mb/S or higher write speed)
— Raspbian Wheezy Distro
— Snap-Camera Application

TimeLapse Enclosure – Parts List
— Plastic or Metal container (preferably one with good seals for weather proofing)
— Camera Tripod
— Velcro
— 9/32 Drill Bit (for camera module aperture)

OS Preparation

Listed below are step-by-step instructions for creating a time-lapse camera using a Raspberry Pi and PiFace Display. I used a modified Raspbian Wheezy IMG produced by “University of Manchester School of Computer Science” for use with the PiFace module.The latest Raspbian Distro caused conflicts with the startup script from running autonomously. I used an older Distro version which worked as expected during configuration. The custom Raspbian SD Image download link is: http://pi.cs.man.ac.uk/download/rpi_raspbian_piface_4gb_sandisk.img
You may wish to initially configure raspi-config with, boot to desktop environment, and overclock to “High” just until you complete the snap-camera install & configuration to make things a little faster. This is what I did initially and then tweaked everything way back once I was finished.
During the initial boot up (raspi-config) I enabled the following settings.
1. Boot to CLI (booting up all the graphical libraries in my thinking would drain the battery quicker)
2. Enable SSH
3. I verified that the camera module was loaded, as well as the PiFace binaries loaded on boot up.
4. Configured a unique hostname (aided in SSH session into RPi to view images if need be.)
5. Before I changed the overclock settings I updated “raspi-config”, in advanced settings. This took quite a bit of time to complete due to the older Distro that I was using for thus project.
6. After completing the “raspi-Config” update, and system reboots, you should now be looking at your desktop or CLI. If you are on the CLI prompt then type “startx” to boot to desktop. I then opened a command line and ran the following commands, (sudo apt get update), again this will take a while as it is an older Distro version and there is quite a bit to update within the OS. You should perform a “reboot” once the update has finished. Once the RPi has rebooted and you are now looking at the desktop, open another command line within LXTerminal and type sudo apt get upgrade. Once the system has completed upgrading its components, perform another reboot.

Snap-Camera Installation
Element14 has a PDF walk-through for installing the Snap-Camera binaries & python libraries.
http://www.element14.com/community/servlet/JiveServlet/downloadBody/65069-102-2-287269/SnapCam%20Installation%20Guide%20V1.2.pdf

PiFace Display and Control Installation
You will also need to install the, pifacecad, which is used for controlling the PiFace Control Display, piface.org.uk has a great tutorial with step-by-step procedures for step.
http://www.piface.org.uk/guides/setting_up_pifacecad/installing_pifacecad_package/

PiFace Display and Control – Documentation
http://piface.github.io/pifacecad/installation.html

Excellent webpage listing everything you could possibly want to know and do with the PiFace Display and Control Module.
http://www.piface.org.uk/products/piface_control_and_display/

Helpful Tips – POST Installation & Configurations
Couple of things to verify once you have installed the snap-camera & pifacecad libraries.
1. Make sure your PiFace Display is initialized (turns on, LCD displaying content) after rebooting the Raspberry Pi. This is the integral part of having a fully automated camera running on the Raspberry Pi.
2. I attached a “mini-USB WiFi adapter” to my Raspberry Pi for a couple of reasons. a) Some of my Time Lapse scenes were created relatively close to my home network which allowed me to SSH into the RPi and visually verify that photos were being taken, and stored correctly within the “images” folder. This can be achieved with the following commands; (cd snap-camera/images (Enter), ls (Enter)), assuming you configured the snap-camera to it’s default location. b) This also allowed me to SSH into the RPi and perform a proper system shut-down, to reduce any possibility of the SD Card data from being corrupted.

Camera Enclosure Construction
The size of your camera enclosure will be determined by the battery pack you use to power your Raspberry Pi.

Deciding on what type of enclosure you want comes down to preference, plastic, wood, metal, plexiglass, etc. My own decision came down from a couple of necessary requirements. I decided not to go with metal for a couple of reasons, my environment being the Sonoran Desert with 120 degree summers would have produced an oven for my camera, NOT GOOD! I did not choose a wood enclosure because it would have been an absorbent material for moisture which would have caused condensation inside the box, and water with electronics usually don’t go together. Plexiglass was a viable option but was fairly expensive to buy, and again with high heat could have distorted the joints over time, compromising the structural integrity. I originally had this setup contained within a frosted plastic Tupperware container which worked nicely, but made mounting to the tripod with full range of motion difficult to obtain. So I decided to go with a box form factor which worked nicely in the mounting setup.
Weather proofing the enclosure should also be at the top of the requirement list, since you will probably want to leave this outside for extended TimeLapse shooting. Preferably, an enclosure with few as holes as possibly since these will become possibly points for water, rain, dust etc to enter the enclosure causing damage to the electronics within.

Assembly
Assembly will vary based on your type of enclosure. Discussed below are the steps I did for my camera enclosure.

Enclosure Mount to Tripod

Shows the mounting assembly used to secure to the tripod mount. The wooden strips are the common paint stirrers that are given away at your local hardware store. The bolt assembly with a metal washer, followed by a rubber washer. I used the rubber washer insert to reduce the stress being put on the plastic enclosure and the cedar wood strips.
Image 1

In this photo, I used wooden strips (commonly used as paint can stirrers), you can get these for free from your local chain hardware stores for FREE.

  • I cut 2x pieces the length of the enclosure.
    (These will be used for the anchors to the tripod, 1 piece will be inside the enclosure, and 1 piece on the outside anchored to the tripod).
  • I then used an excess piece of wood to basically balance everything to make it level.
  • I used an additional 2x pieces of wood, laid vertically to make the surface level so the battery and raspberry pi were even, laying flat across the bolts.
Picture of the mounting assembly for mounting the plastic enclosure to the tripod camera mount.
Image 2

Seen above, the 2nd piece of wood, with the enclosure base sandwiched between the two strips of wood.
The reason why I sandwiched the enclosure between the two wood strips was to alleviate any stress or uneven pressure on the thin plastic. This way there was equal force on both the top and bottom portions of the bolts holding the enclosure with my time-lapse camera and battery to the tripod.
Note: This was also the choice in purchasing a large metal washer, seen in “image 1”, thus reducing the stress on the actual wood strip as well. Below the metal washer, between the bolt head and wood strip is a rubber washer “image 1” to dampen any vibrations and reduce any stress fractures to the wood.
The other bolt seen in “image 1” with no washers was just used to prevent the entire enclosure from free-spinning on the tripod, “locking bolt”.

Mount assembly for camera to tripod.
Image 3

Above “image 3” is an enlarged view of the mounting assembly from the enclosure to the tripod.

Camera Mount – Battery – Raspberry Pi / PiFace Display

Image 4
Image 4

Inside of the enclosure showing the Anker 10000mAh rechargeable battery pack, PiFace Display running Snap-Camera, Camera Module attached to the lid of the enclosure, and the mini-USB WiFi adapter on right side of Raspberry Pi.

Image 5
Image 5

Image 5 shows the mount for the camera module to lid of the enclosure. The camera module is secured in place with velcro. The diameter of the camera aperture is 9/32 drill bit size.

 

Some Videos I’ve created using the Snap-Camera & RPi Camera

Arizona Sunset with Adobe After Effects Processing

Arizona Sunset – No Post Processing

Sunset behind Saguaro Cactus

Thanks for reading.
More tutorials to come, including
Raspberry Pi Laptop
Home Automation with Z-Wave and the Raspberry Pi