While the Raspberry Pi Educators Roadtest is complete, I wanted to follow up with my belated post using the Raspberry Pi B+ Camera Kit to create time lapse photos. The school where I teach physics is undergoing a major construction project to rebuild the football field with new, larger bleachers and an artificial turf field. Using the Raspberry Pi Camera Kit, I have been capturing images of the construction out of a well placed classroom window.
While time lapse photography isn't a mind-blowing new project, I've learned a lot doing it. Most importantly, I've learned that managing large numbers of image files can be daunting! I'm still using the Noobs SD card which I used to install Raspbian. I only have a 2 to 3 Gb of storage available for images, and each image I capture is 2-3Mb. Which means I get about 1000 images before things get filled. Depending on the frequency you plan to capture images at, this can fill up fast. For me, it was a matter of 3-4 days. My solution has been to upload each image to my Google Drive using the pydrive module. Then every couple days I log into the RPi and delete the photos from the Pi once I'm sure I have them storage elsewhere. I could just upload each one without saving it to the Pi's SD card, but then I wouldn't have a backup in case of network failure. I see this being useful for classrooms where you want to monitor something over an extended period of time (plants, mold growth, weather conditions, etc.). By creating an online cache of images it is easy to check on them regularly, even remotely. A simpler solution would be to save them to a USB flash drive plugged into the Pi. Swapping one out for another would be an easy way to transfer the image files rather than downloading them from Google Drive (this was a pain with many large zipped directories of images).
Here are links to useful documentation/tutorials I used to complete this project:
- Raspberry Pi Camera Module setup
- Picamera documentation - This package provides a pure Python interface to the Raspberry Pi camera module for Python 2.7 (or above) or Python 3.2 (or above).
- PyDrive is a wrapper library of google-api-python-client that simplifies many common Google Drive API tasks.
Here is my python script and settings file. Google ids have been removed and must be added for your own implementation (see the PyDrive documentation regarding generating your own client_secrets.json file):