Overview
One of the things I like most about where I live is the view from my balcony. I have an unobstructed view of the horizon, and on most days I get to see the sun set. It’s often very beautiful, and occasionally it is just… breathtaking. Some time ago I had the idea that I would love to have a picture of each sunset, over the course of a year. I could do that manually of course, except being home at sunset every day isn’t feasible, and frankly, that requires more dedication than I possess. I would enjoy the pictures in and of themselves, but I also think you could make some pretty neat art with that set of images: a collage is the first thing that comes to mind; or a time lapse video set to one frame/day showing the progression of the sun throughout the year; or a composite image in which one row of pixels comes from each day of the year. There are other interesting things you could do with that too, I’m sure.
Basic Setup
The bones of the project are actually pretty simple–a Raspberry Pi coupled with an 8MP camera module should be more than sufficient to handle the basics. You’d need a waterproof enclosure of course, along with some mounting hardware. Make sure your model of RasPi has some WiFi to transfer the pictures, and you’ve got a project! The basics of the software are pretty straightforward too. You’d only need to take care of a few things. The location of the camera (in general terms) needs to be known–have the user enter this–this, along with the date, will give you the time when the sun goes down. It’s an easy enough calculation to make, but there are also services that provide the sunset time–you could pull from those as an alternative to calculating the time yourself. Have the RasPi take a picture at the appropriate time, along with several backup pictures at ±a short interval, in case something flies in front of the camera. And you’re done! Easy peasy, right?
Tricky Pieces
There are two things that come to mind that might cause difficulties:
- Power. I can’t easily run a cable out to the balcony, so the power supply needs to be self contained. A simple battery isn’t going to cut it, either, because I don’t want to charge and swap batteries every few days. This project is supposed to be as hands-off as possible. The RasPi has a reasonably low power draw, but not anywhere near low enough to run on batteries for a year. That’s a different class of device. I see two possible solutions.
- Option 1: a solar panel. This seems like a reasonably good idea, if a bit of overkill. Solar panels are cheap and pretty robust nowadays, and the RasPi doesn’t need all that much power, especially when it is dormant 99% of the day. It is only actually working for a few minutes each day around sunset. So, this would definitely work, but it is pretty wasteful to provide power to a device that isn’t doing anything the vast majority of the time.
- Option 2: a wakeup timer. I’m imagining rigging something with a 555 timer, although surely there must be a pre-existing solution for this sort of problem. Depending on how long the RasPi needs to be awake each day, and the size of the battery, I would expect to still need to change the battery pack every so often, but without specific components I can’t run the numbers. That seems manageable though. I can reasonably expect myself to be able to change batteries once a month–every day, not so much.
- Image Quality Detection: My worry is that, over the course of a year, things go wrong. A really strong wind blows, and knocks the camera out of alignment. A bird poops at just the right angle, and it hits the camera lens. A plastic bag gets stuck on the enclosure and occludes the camera. Heat exposure degrades the camera quality. Something always goes wrong, and this project is intended to run for at least a year, which is a lot of chances for something to go wrong. It wouldn’t be terribly difficult to manually review the image taken every day and make sure nothing is going wrong, but, again, this is intended to require as little human intervention as possible. Given that, it seems like you would want some sort of barebones image detection software to run after every capture, and make sure that the image was at least close to being what was expected. This seems reasonably complicated to do well, especially in comparison to how easy the rest of the project seems to be.
Improvements
- Time Lapse/Video: If instead of a single image you wanted to take a time lapse sequence of each sunset, or a video, you could make a very small modification and build the project in essentially the same way. You may need to change out the camera module if you want hi-res video, but that is about it. Whether you want this variant or not should depend on what you want to do with the pictures you take.
- Gimbal+Zoom Lens: Putting the RasPi on a gimbal (and writing software to rotate the gimbal to track the sun over the course of the year, a la one of those tracking telescopes) would allow you to capture the sun itself, at a pretty high level of detail, rather than the sunset. You could do some fun things with that, and fancy camera filters.
- Image Selection: The RasPi could be programmed to take some number of images, and software could be written that chooses the best (for whatever definition of “best” you are using) one. It seems like a selection based on the a set of metrics including the highest contrast, and/or how unobstructed the sun is, would provide an improvement over just taking a single image.