- OV528 camera module
- mbed board with an SD card slot (I used NXP K64F) or an SD card shield for boards without an onboard SD card slot
- micro SD card
This application takes a photo every 10 minutes and stores the images on an SD card. The application will also save a text file log to the SD card. The application utilized the mbed OS filesystem to store the photos and log.
I let my timelapse run for two weeks. This introduced some interesting requirements:
- Logging - When running in the short term, I relied on capturing
STDOUT
from the board with a serial connection to my computer. As the device was going to be running without any PC connection, I needed a way to check that the application was still working as intended. I used a logging function to write any messages to a file, which I could view later on the SD card. - Continuous naming scheme - To make the timelapse, I would need to know the order in which photos were taken. Without a persistent RTC, I relied on a naming scheme. So, they'd need to be named in order. I chose
img0
,img1
...imgN
. However, between power cycles, the device would lose this count. I chose to make a new directory with each power cycle, such that they would be nameddir0
,dir1
...dirN
. When the application starts, it finds the firstdirX
that does not exist and creates it. Within each of these directories, images were named according toimg0
,img1
...imgN
, using a global count variable to keep track of the image number.