11. Open Source Hardware - Timelapse Camera¶
A Raspberry Pi-based camera for capturing timelapses.
Need¶
One of the recurring requirements across my documentation, material experiments and fabrication work is the ability to create long-duration timelapses.
Typical applications include:
- Fabrication processes
- Biomaterial drying
- Crystallization
- Machine operation
- Workshop activity
While a mobile phone can create timelapses, it occupies the phone for long periods and introduces limitations in framing, stability, battery life and post-processing.
Since I already owned a Raspberry Pi 4B and a USB webcam, this became an opportunity to build a dedicated timelapse camera while learning the Raspberry Pi ecosystem from scratch.
Concept¶
The objective was to build a portable, standalone timelapse camera capable of:
- Configurable capture parameters
- Live camera preview
- Automatic video generation
- Headless operation
- Wireless file transfer
- Standalone touchscreen operation
Rather than designing the entire system upfront, the project evolved through successive refinements. Each iteration solved a usability issue discovered during practical testing.
Brief Note on Raspberry Pi¶
This was my first Raspberry Pi project.
Although I have extensive experience with Arduino, ESP32 and embedded systems, the Raspberry Pi introduced a different style of development by combining a complete Linux operating system with hardware interfaces and GPIO.
For this project it effectively became a dedicated Linux computer for image capture.
AI-assisted Development Methodology¶
The software for this project was developed collaboratively with ChatGPT.
The development process was iterative rather than prompt-and-generate.
Typical workflow:
- Identify the next problem.
- Ask ChatGPT to generate or modify the script.
- Run it on the Raspberry Pi.
- Test the workflow.
- Identify limitations.
- Request additional features or refinements.
- Repeat.
My role¶
- Define desired behaviour
- Design the workflow
- Test on hardware
- Report bugs
- Evaluate usability
- Decide future direction
ChatGPT's role¶
- Generate Bash scripts
- Explain Linux concepts
- Suggest software packages
- Explain Raspberry Pi configuration
- Revise scripts after testing
The final implementation therefore emerged through many cycles of testing and refinement.
This documentation page, specifically, is also similarly created by a back-and-forth with ChatGPT. The AI provided a backbone of the process as it happened (since the development went through many iterations and demands by me for things to be a certain way) while I tweaked the text, added some more details where I felt necessary, and provided all the images.
Hardware¶
Current Hardware¶
- Raspberry Pi 4B
- 32 GB microSD card
- Generic USB webcam
- 3.5" touchscreen
- Off-the-shelf Raspberry Pi enclosure
- USB power supply
- Battery pack
Planned Hardware¶
- Dedicated GPIO buttons
- Improved enclosure
- Camera mounting accessories
Tools¶
Software¶
- Raspberry Pi OS
- Bash
- Geany
- fswebcam
- FFmpeg
- MJPG-streamer
- OpenSSH
- Raspberry Pi Connect
- FileZilla
- Python (GUI prototype)
- Tkinter (current prototype)
- PyQt (future alternative)
Planned¶
- GPIO libraries
Software, Downloads and References¶
The following software was used during development.
| Software | Purpose | Website / Download |
|---|---|---|
| Raspberry Pi Imager | Flash Raspberry Pi OS to the SD card | raspberrypi.com/software |
| Raspberry Pi OS | Operating System | Operating Systems |
| Raspberry Pi Connect | Remote desktop access | Pi Connect |
| Geany | Code editor | geany.org |
| fswebcam | USB webcam image capture | GitHub Repository |
| FFmpeg | Convert captured images into video | ffmpeg.org |
| MJPG-streamer | Browser-based live camera preview | GitHub Repository |
| OpenSSH | Remote terminal access | Included with Raspberry Pi OS |
| FileZilla | SFTP file transfer | filezilla-project.org |
| Termius | SSH client | termius.com |
| Python 3 | Future GUI implementation | Included with Raspberry Pi OS |
| Tkinter | Native Python GUI toolkit | Included with Python |
| Qt for Python (PyQt / PySide) | Alternative GUI toolkit | Qt for Python |
Process¶
Phase 1 - Building the Timelapse Camera¶
Raspberry Pi Initialisation¶
Need
Learn the Raspberry Pi environment.
Process
- Install Raspberry Pi OS
- Configure networking
- Enable SSH
- Install required packages
Outcome
Working Raspberry Pi development environment. This established a stable platform on which the remainder of the project could be developed.
Insert screenshots: - Raspberry Pi Imager - Desktop after first boot
Basic USB Webcam Capture¶
Need
Verify that a standard USB webcam could replace the official Raspberry Pi Camera.
Process
- Install fswebcam
- Capture first image
- Add timestamped filenames
- Organise capture folders
Observation
- Preview colours incorrect
- Saved images correct
- Since saved images were unaffected, I continued development while treating this as a preview-only issue.
Insert screenshots: - First successful capture - First capture script insert script
Automated Timelapse¶
Need
Automate repeated capture.
Initial implementation
- Fixed interval capture
Refinement
During testing I realised that different projects required different ways of specifying a timelapse. Sometimes I knew how long I wanted to record, while at other times I cared more about the duration of the final video. The script was therefore extended to support multiple calculation modes.
Added three operating modes:
- Duration + Interval
- Duration + Video Length
- Duration + Output FPS
The script now:
- Calculates parameters
- Confirms settings
- Captures images
- Automatically renders the final video
Insert screenshots: - Mode selection - Image folder - Final video
Phase 2 - Making it a Standalone Device¶
Every refinement addressed a practical usability issue that emerged as I started using the device.
Automatic Video Generation¶
Need Remove manual FFmpeg processing.
Solution Integrate FFmpeg directly into the script.
Headless Operation¶
Need Operate away from the PC.
Solution
- SSH
- Raspberry Pi Connect
Live Preview¶
Need Frame the camera before capture.
Solution
- MJPG-streamer
- Preview script
Wireless File Transfer¶
Need Avoid removing the SD card.
Solution
- FileZilla over SFTP
Touchscreen¶
Need Remove dependence on a phone or computer.
Solution
- Added a 3.5" touchscreen.
- Continued using the existing Bash scripts while interacting directly through the Raspberry Pi.
Enclosure¶
Need Package the system into a portable workshop device.
Solution
- Installed all hardware into an off-the-shelf Raspberry Pi enclosure.
Insert screenshots: - MJPG preview - SSH - Raspberry Pi Connect - FileZilla - Touchscreen - Enclosure - Final assembled device
Current Capabilities¶
The system now provides:
- Automated image capture
- Configurable capture modes
- Automatic FFmpeg rendering
- Live preview
- Headless operation
- Integrated touchscreen
- Remote desktop
- Wireless file transfer
Phase 3 - The Next Iteration¶
The current Bash implementation works reliably.
The next iteration will migrate to a Python application.
Future work:
- Native touchscreen GUI
- GPIO buttons
- Cleaner application architecture
- Battery operation
Stretch Goals:
- Scheduled capture
- Motion-triggered capture
- Reusable Raspberry Pi application framework
Insert mock-ups and architecture diagrams.
Current Status¶
The project has evolved into a portable standalone Raspberry Pi timelapse camera suitable for workshop documentation.
The current Bash implementation is fully functional. Development has also begun on a Python-based graphical interface that will eventually replace the command-line workflow.
Future work focuses on improving the software architecture and user experience rather than adding core functionality.
Conclusion¶
This project began as an attempt to automate timelapse photography using existing hardware.
Along the way it became my introduction to the Raspberry Pi ecosystem and evolved into a reusable platform for future physical computing projects.
The immediate outcome is a practical standalone timelapse camera.
The longer-term outcome is a flexible Raspberry Pi platform capable of supporting many future tools beyond timelapse photography.
Appendices¶
The following appendices provide the additional information required to reproduce, troubleshoot and further develop the project. While not essential to understanding the overall workflow, they document the practical details encountered during implementation.
Appendix 1 — Bill of Materials (BOM)¶
Hardware¶
| Item | Qty | Approx. Price (INR) | Purchase Link | Purpose |
|---|---|---|---|---|
| Raspberry Pi 4 Model B (4 GB) | 1 | ₹5,649 | Robu - Raspberry Pi 4 Model B 4 GB | Main controller |
| Official Raspberry Pi 32 GB A2 microSD Card | 1 | ₹412 | Robu - Raspberry Pi Peripherals | Operating system and storage |
| Official Raspberry Pi 4 Case | 1 | ₹308 | Robu - Raspberry Pi Case | Enclosure |
| 3.5" SPI Touchscreen | 1 | ₹940 | Robu - 3.5" Touchscreen | Local user interface |
| USB Webcam (UVC Compatible) | 1 | ₹700–1,500 | Generic USB webcam | Image capture |
| Official Raspberry Pi USB-C Power Supply (5V 3A) | 1 | ₹899 | Robu - Raspberry Pi Accessories | Power supply |
| USB-C Power Cable (if separate) | 1 | ₹150 | Generic | Power connection |
| microSD Card Reader | 1 | ₹250 | Generic | Flash Raspberry Pi OS |
| Wi-Fi Router / Mobile Hotspot | 1 | Existing | Existing infrastructure | Headless networking |
Estimated Project Cost¶
| Configuration | Approx. Cost |
|---|---|
| Without webcam | ~₹8,450 |
| With webcam | ~₹9,200–10,000 |
Software¶
| Software | Cost | Download |
|---|---|---|
| Raspberry Pi OS | Free | https://www.raspberrypi.com/software/operating-systems/ |
| Raspberry Pi Imager | Free | https://www.raspberrypi.com/software/ |
| Geany | Free | https://www.geany.org/ |
| Bash | Free | Included with Raspberry Pi OS |
| fswebcam | Free | https://github.com/fsphil/fswebcam |
| FFmpeg | Free | https://ffmpeg.org/ |
| MJPG-streamer | Free | https://github.com/jacksonliam/mjpg-streamer |
| OpenSSH | Free | Included with Raspberry Pi OS |
| Raspberry Pi Connect | Free | https://www.raspberrypi.com/software/connect/ |
| FileZilla | Free | https://filezilla-project.org/ |
| Termius | Free (Basic) | https://termius.com/ |
| Python 3 | Free | Included with Raspberry Pi OS |
Future Additions¶
| Item | Approx. Price (INR) | Purpose |
|---|---|---|
| USB Power Bank (10,000–20,000 mAh) | ₹900–2,000 | Portable operation |
| GPIO Push Buttons | ₹20–100 | Physical controls |
| Rotary Encoder | ₹80–150 | Menu navigation |
| Camera Mount / Tripod Adapter | ₹150–500 | Adjustable framing |
| Custom 3D Printed Enclosure | Material cost | Dedicated enclosure |
| Official Raspberry Pi Camera V2 (Optional Upgrade) | ₹1,649 | Native Raspberry Pi camera interface |
Appendix 2 — Software Installation & Setup¶
1. Install Raspberry Pi OS¶
- Download Raspberry Pi Imager
- Flash Raspberry Pi OS
- Configure:
- Hostname
- Username
- Password
- Wi-Fi
- Enable SSH
2. Update System¶
sudo apt update
sudo apt full-upgrade -y
3. Install Required Packages¶
sudo apt install geany
sudo apt install fswebcam
sudo apt install ffmpeg
sudo apt install openssh-server
sudo apt install git
4. Install MJPG-streamer¶
git clone https://github.com/jacksonliam/mjpg-streamer.git
Follow the build instructions in the repository.
5. Install Raspberry Pi Connect¶
Follow the official Raspberry Pi Connect installation guide.
6. PC Software¶
Install
- Geany (optional)
- FileZilla
- Termius (Android/iOS)
7. Verify¶
Confirm that:
- SSH works
- Webcam detected
- fswebcam captures images
- MJPG-streamer displays preview
- FFmpeg generates video
- FileZilla transfers files
Appendix 3 — Troubleshooting¶
Webcam Preview¶
Problem : Live preview appeared green/magenta.
Observation : Saved images were correct.
Conclusion : The issue affected only the preview pipeline.
SSH Password Forgotten¶
Reset using
sudo passwd <username>
Dynamic IP Address¶
When using a mobile hotspot, the Raspberry Pi receives a different IP after reconnecting.
Solutions explored
- Hostname
- Static IP
- Bluetooth
- Raspberry Pi Connect
Current solution
- Determine current IP from hotspot
- Connect using SSH
MJPG-streamer Camera Conflict¶
MJPG-streamer occupies the webcam.
Solution
- Stop preview
- Start timelapse
Only one process may access the webcam at a time.
File Transfer¶
Instead of removing the SD card,
- Enable SSH
- Connect with FileZilla using SFTP
- Copy files wirelessly
Executable Scripts¶
If a script will not run:
chmod +x scriptname.sh
Safe Shutdown¶
Shutdown using
sudo shutdown now
Avoid disconnecting power while the Raspberry Pi is writing to the SD card.
Appendix 4 — Design Evolution¶
The table below summarises the major stages in the evolution of the project.
| Version | Milestone | Motivation |
|---|---|---|
| v0.1 | Raspberry Pi setup | Learn Raspberry Pi environment |
| v0.2 | USB webcam test | Verify webcam compatibility |
| v0.3 | Single image capture | Validate image acquisition |
| v0.4 | Automated interval capture | Basic timelapse functionality |
| v0.5 | Configurable capture modes | Support different user workflows |
| v0.6 | Automatic FFmpeg rendering | Remove manual post-processing |
| v0.7 | SSH headless operation | Operate away from workstation |
| v0.8 | Browser-based preview (MJPG-streamer) | Frame camera remotely |
| v0.9 | Wireless file transfer | Eliminate SD card removal |
| v1.0 | Touchscreen + enclosure | Standalone portable device |
| v1.5 | Python GUI prototype | Started migration from Bash |
| v2.0 (Planned) | Python application | Better GUI and software architecture |
Lessons Learned¶
The most significant observation from the project was that nearly every major improvement resulted from practical testing rather than initial planning.
The development process therefore became a cycle of:
- Build
- Test
- Identify limitations
- Refine
- Repeat
This iterative process gradually transformed a simple Bash script into a portable standalone Raspberry Pi timelapse camera and laid the groundwork for future Raspberry Pi-based physical computing projects.
Files¶
- snapshot.sh — capture one timestamped test image
- preview.sh — start the MJPG-streamer browser preview
- stop_preview.sh — stop the preview and release the webcam
- timelapse_advanced.sh — configure and capture the timelapse, then generate the MP4
- timelapse_full.sh — preview, confirm framing, configure, capture and render in one workflow
- README.md — installation, dependencies and usage notes
- GUI app with options in the interface, built using Python