The camera software works on its own…there’s no buttons or anything to fiddle with to get it started. Just turn the power switch on…once the system is booted (maybe 30 seconds or so) it will begin capturing images (first-time boot may take about a minute longer as it resizes the filesystem and such). The status LED will turn ON while the camera is taking a picture.

To turn the camera off, press and hold the halt button for at least 2 seconds. The status LED will turn ON while the system performs a clean shutdown (about 20 seconds), then OFF to indicate it’s safe to turn the power switch off.

Always use the halt button before powering off the camera. Don’t just switch it off or you risk losing images or having to re-do the whole SD card.

When the system is powered off, you can remove the micro SD card and install it in a USB reader on your regular computer. The images will be inside a folder called “timelapse” and are numbered sequentially…img00001.jpg, img00002.jpg, img00003.jpg and so forth.

After transferring images off the card, you can delete these files (or the whole timelapse folder) and the next recording will begin back at #00001. Or if you leave the images there, it will begin recording at the next number in the sequence.

Do not move, alter or delete any files other than the images in the timelapse folder. The Raspberry Pi requires these to run.

Settings

By default, the software will capture a 1280 by 720 pixel JPEG image every 15 seconds. You can change these settings by editing the file timelapse.sh on the SD card using any text editor. These configurable values are near the top of the file:

# Configurable stuff...
INTERVAL=15            # Time between captures, in seconds
WIDTH=1280             # Image width in pixels
HEIGHT=720             # Image height in pixels
QUALITY=51             # JPEG image quality (0-100)
DEST=/boot/timelapse   # Destination directory (MUST NOT CONTAIN NUMBERS)
PREFIX=img             # Image prefix (MUST NOT CONTAIN NUMBERS)
HALT=21                # Halt button GPIO pin (other end to GND)
LED=5                  # Status LED pin (v2 Pi cam lacks built-in LED)

With this script there is a practical minimum interval of about 2 seconds between captures (maybe longer for larger images); if you need anything faster than that, it’s best to use the time lapse features built into the raspistill utility itself. This is documented on the Raspberry Pi web site.

The GPIO pins used by the halt button and status LED can be changed in the script if you’ve wired yours up differently.

Direct Sunlight

If you find a lot of images are coming back oddly exposed, the camera might need a little more “wakeup time” before capturing an image. Look for the following line (up just a few lines from end of the script) and change “250” to a larger value, perhaps 1000 (this is the wakeup time in milliseconds; 1000 = 1 second):

raspistill -n -w $WIDTH -h $HEIGHT -q $QUALITY -th none -t 1500 -o $OUTFILE

There are more settings for controlling exposure, ISO, etc…see link below…

Gotchas and Things to Know

With this or any other battery-powered Raspberry Project, there’s a small possibility of losing data (or even corrupting the SD card and having to start over) should the battery become depleted during use…similar to switching the device off without using the halt button.

One way to reduce (but not eliminate) this risk is to add a “sync” command immediately after the “raspistill” command, which forces the completion of all pending file writes:

raspistill -n -w $WIDTH -h $HEIGHT -q $QUALITY -th none -t 250 -o $OUTFILE
sync

The extra time needed for this sync operation means the practical minimum INTERVAL value will be longer…perhaps 10 seconds. This is why it’s not done by default.

Adjusting Camera Settings

The raspistill command has a huge number of options…you can tweak exposure and white balance settings, image size, add interesting “painterly” effects to the image…it’s way beyond the scope of this guide, so if you’d like to dig deeper, please refer to the Pi Foundation’s reference:

Official Raspberry Pi Camera Documentation

Extending Run Time

If you have a very long time lapse project in mind that exceeds the longevity of the built-in battery (about 2 hours), you can use a higher capacity USB phone charger battery connected one of two ways:

  • To the PowerBoost’s USB charge port. This will top off the PowerBoost’s battery while also running the Pi.
  • Directly to the Pi’s USB power port. Leave the PowerBoost switched OFF in this case, or there will be…trouble.

 In either case, you do still need to use the halt button before switching off or disconnecting power.

SD Card Limitations

The /boot filesystem uses a Windows “FAT32” directory structure. This limits the timelapse directory to a maximum of 65,535 images. The script doesn’t enforce any specific checks on this, since other limiting factors (battery longevity, card capacity, etc.) are more likely to come into play much sooner.

The startup file system consistency check (fsck) on the /boot partition has been disabled in the ready-made SD image. If a large number of images (several thousand) are present on the card, boot time is inordinately long with this check in place. If you really want that boot-time check, you’ll need to familiarize yourself with and edit /etc/fstab.

Between this and the battery concerns, copying images off the card at every convenient opportunity is recommended. Also, if you’ve rolled your own SD card, making a backup image is recommended.

Merging Stills Into Video or GIF

Combining the captured images into a video or GIF you can share will depend on what software you have access to and are familiar with. For example, Adobe Premiere or AfterEffects have fancy GUIs (but cost may be prohibitive if you don’t already use these tools), or there are free command-line tools like ffmpeg or ImageMagick’s convert.

Covering every tool for every likely operating system is beyond the scope of this guide. If it’s an unfamiliar process, try Google searching for “jpg to video windows” or “jpg to video mac” or similar. So many options!

Just one example…in Adobe Photoshop CC, it’s possible through a roundabout sequence of operations…

  • File→Scripts→Load Files into Stack…
  • In pop-up window, click “Browse” and select image files, then “OK.”
  • In Timeline window, “Create Frame Animation.”
  • In Timeline menu, “Make Frames From Layers.”
  • Then the usual frame animation tools (timing, etc.) can be used to create a video (File→Export→Render Video…) or animated GIF (File→Export→Save for Web (Legacy)…).

This guide was first published on Jun 30, 2016. It was last updated on Mar 08, 2024.

This page (Using It) was last updated on May 31, 2016.

Text editor powered by tinymce.