Ultimate Guide to Timelapse Automation with Raspberry Pi Zero 2W

Raspberry Pi Zero, with camera for timelapse video project

Overview

Welcome to the MM0ZIF-WX Timelapse Automation Project! This lightweight and portable system is powered by the Raspberry Pi Zero 2W, a Pi Camera, and a power bank, making it perfect for outdoor or remote use. The setup is designed to capture high-quality timelapse images, organize them, and automatically upload them to a remote server for safekeeping and further use. In this case I will be using another computer to create timelapse videos but that is for another article.

A unique feature of this project is its WiFi failover capability. If the primary WiFi network becomes unavailable, the Raspberry Pi seamlessly switches to a secondary WiFi network, ensuring uninterrupted operation and uploads.

The Raspberry Pi OS’s can be found Here.


What You Need

  1. Raspberry Pi Zero 2W:
    • Compact, energy-efficient, and powerful enough for image processing and FTP uploads.
  2. Pi Camera:
    • Compatible with the Raspberry Pi for capturing still images.
  3. Power Supply:
    • A USB power bank for portable operation. Capacity depends on desired uptime.
  4. Storage:
    • A microSD card (32GB or higher) to store the operating system and captured images.
  5. WiFi Network:
    • Primary and secondary WiFi networks for seamless failover.
  6. Software:
    • Raspberry Pi OS Lite.
    • Custom Python scripts for timelapse and network management.

Features

  • Automated Timelapse Capture:
    • Captures images every 5 minutes and saves them in a date-organized folder.
  • Remote Backup via FTP:
    • Compresses daily captures into a ZIP file and uploads them to a remote FTP server at midnight.
  • WiFi Failover Support:
    • Switches to a secondary WiFi network if the primary network is unavailable, ensuring uninterrupted operation.
  • Portable and Efficient:
    • Powered by a USB power bank, the Raspberry Pi Zero 2W offers long runtimes and low power consumption.
  • Customizable and Expandable:
    • Easily modify capture intervals, storage locations, or add features like cloud integration.

How It Works

  1. Image Capture:
    • The Pi Camera captures images every 5 minutes and saves them in a folder named after the current date. Now updated from RaspiCam2 to libcam.
  2. Daily Upload:
    • At midnight, the script compresses the previous day’s folder into a ZIP file and uploads it to a configured FTP server.
  3. WiFi Management:
    • The Raspberry Pi checks connectivity to the primary WiFi network.
    • If the connection fails, it automatically switches to a per-configured secondary WiFi network to maintain upload functionality.
  4. Portability:
    • Powered by a USB power bank, the setup can operate in remote locations without reliance on a fixed power source.

Setting Up WiFi Failover

To configure WiFi failover, the Raspberry Pi’s wpa_supplicant.conf file is set up with multiple network configurations:

country=UK
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="Primary_Network"
psk="Primary_Password"
priority=1
}
network={
ssid="Secondary_Network"
psk="Secondary_Password"
priority=2
}

The network with the highest priority (priority=1) will be used first. If unavailable, the Pi switches to the next available network.

This as you can imaging will work with both fixed and hotspot wifi.


Hardware Setup

  1. Attach the Pi Camera:
    • Connect the Pi Camera to the Raspberry Pi Zero 2W using the appropriate camera ribbon cable.
  2. Power the System:
    • Connect a USB power bank to the Raspberry Pi’s power input.
  3. Network Configuration:
    • Configure WiFi failover using the method described above.
  4. Run the Script:
    • Upload the provided Python script to the Pi and run it to start capturing images.

Software Setup

  1. Install Required Libraries: Run the following commands to install dependencies: sudo apt update sudo apt install libcamera-apps python3-pip pip install schedule
  2. Download and Configure the Script:
    • Clone the project repository:gh repo clone TheLich2112/PiPicFtp
    • Edit the script to configure FTP credentials and storage paths.
  3. Run the Script: Start the script manually:python3 pipicftp.py Or set it up as a service to start automatically at boot.

Example Use Cases

  • Nature Timelapse:
    • Capture stunning sunrise-to-sunset sequences in remote locations.
  • Construction Monitoring:
    • Document the progress of long-term projects.
  • Weather Observations:
    • Use the setup as part of an automated weather station.

Expandability

This project is a foundation for further enhancements:

  • Cloud Integration:
    • Replace FTP uploads with cloud services like Google Drive or AWS S3.
  • Solar Power:
    • Add a solar charging setup for long-term outdoor use.
  • Environmental Monitoring:
    • Incorporate sensors to log weather data alongside images.

In my case the powerbank I am already using has a Solar recharger build in. I have yet to test its efficiency, but I will report back on that matter.


Sample Output

Conclusion

This project showcases the versatility and power of the Raspberry Pi Zero 2W in creating a portable, reliable, and automated time-lapse system. With features like WiFi failover, remote backups, and easy customization, it is an ideal solution for hobbyists, researchers, and professionals alike.

For more details or to get started, explore the GitHub repository or reach out to Marcus.

Marcus Hazel-McGown - MM0ZIF
Not Disclosed at Havenswell. | inferno@mm0zif.radio | Website | + posts

Hi I am Marcus, MM0ZIF, a licenced Radio Amateur, Doctor of Musicology, amateur weather enthusiast. I over the years have been a Amateur Radio Tutor, Examiner, and a Regional Manager for the Radio Society of Great Britain.

This site is dedicated more towards Amateur Radio and Weather, with an angle on Technology too. I also maintain https://havenswell.com/ which is my other blog which is more aimed at cooking, hobbies and life in general as well as businness and networking.

Leave a Comment

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.