Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Raspberry Pi Zero W as a headless time-lapse camera (jeffgeerling.com)
122 points by geerlingguy on March 14, 2017 | hide | past | favorite | 35 comments


Happy Pi Day everyone! Since the SpaceX launch was scrubbed this morning, I thought I'd go ahead and finish off this post and kick off the Pi Day celebration early.

Every year I try to do a new Raspberry Pi-based project on Pi Day, and this year I finally plugged in the Pi Camera I bought about 3 years ago to build this time-lapse camera. It was a fun project, and I hope you enjoy the build!


For anyone who wants to do time lapse photography but doesn't want to expend the effort to build something like this, check out the Xiaoyi Yi. [0]

It has WiFi, the firmware is Linux (you can get telnet IIRC) and it also supports scripts for more advanced configuration and control. You can buy it online from China (e.g. AliExpress) for around $80

Sample timelapse video [1]

[0] http://en.xiaoyi.com/xiaoyi_en.html

[1] https://www.youtube.com/watch?v=6zlb2VFGVbs


You'll notice that the internal battery only lasts for ~1hr. But the yi-cam can run completely without the internal battery. I'd suggest plugging it directly into a powersupply or an external battery for this purpose.


It does have a very fish-eyed lens and some annoying design decisions. And the Xiaomi Yi app is less than stellar.

But I love mine, and the waterproof cases for them are dirt cheap and sacrificial.


At 70 grams in weight - shoots seven frames per second and supports 240fps video (480p) - The $80 version is 2K and there is a new 4K version which is $220.


I am really, really bugged by how that website stops my scrolling in blocks.


I did basically the same thing!

https://github.com/bschwind/timelapse-zero

I even have the same carbon fiber case:

http://i.imgur.com/PF5kri7.png

Though I did this before the Zero W came out so I had to have that ugly USB hub and WiFi adapter there. Something is being built across the street from me which is what prompted me to set this up.


Seems like a popular project :-)

http://imgur.com/a/ljZqs

I used a raspberry pi 2. I was tracking the movement of a plant in my apartment http://imgur.com/a/hoEwO

I used a simple cron job to capture photos in the waking hours of the day and upload to a cloud drive. Was definitely a fun project. I was hoping to eventually expand the project to include image detection so I can keep track of the various animals roaming my apartment. Also, create a mobile app that would allow me to snap pictures or videos remotely, but haven't gotten around to it yet.


I actually still have the original Pi(with 256MB of ram!) that has a camera connected to it and runs a webserver accessible on the local network.

I used it to capture a timelapse of few days:

https://www.youtube.com/watch?v=ySb7vu4KPac


Nice. Though I'm amazed that car parked on the corner, hanging off the pavement all that time doesn't get a prang! ;) Nice parking!


You need to watch out for those moving plants!

And yes, this is one of my favorite Pi projects too; it's one of the few where I can show my wife the results and she doesn't just roll her eyes at me.


How long does the battery last? I'd like a camera at our summer cottage to take a timelapse during the whole winter (in Finland, so snowy), turn itself on each day, take a pic, shut down, repeat for like 6months, not sure it's possible?


I have a similar project for monitoring fruit trees. We use a SleepyPi add on to our pi zero (basically an Arduino with a rtc module) in order to shut down the pi zero during the downtime and save battery. Should be able to run for several months this way.


Neat! What kind of battery are you using with it?


Unfortunately the sleepy pi only accepts voltages greater than 6V I believe so we're using 6 eneloop AA batteries in series.


On my home server/NAS, I use rtcwake to sleep the computer for a few hours, then wake up, check if there's work to do, then sleep again. I'm not sure if it'd work with a Pi, though, since its hardware is different from a typical motherboard.

Alternatively, you could use something like an Arduino, and connect it in some way to an independent camera. Since it doesn't need to process the picture, you don't need a powerful processor or MBs of RAM.


The Raspberry Pi doesn't support power management of any kind. It simply can't go into suspend or soft power-off because it doesn't have the hardware to do it. In theory the C.H.I.P can but I'm not sure if the software support for that feature is there yet.


Check out the Sleepy Pi HAT. It's possible, though more complicated than it would be on a computer with power management options or on an Arduino.


Something like that is possible, but you'd have to probably build your own battery and power circuitry; most USB power packs shut off after a few minutes without any current draw, and you need to press a physical button to turn them back on.

The AUKEY supply I'm using goes for about 6 days, continuous.

You can also have two packs and judiciously swap them out every week or so. That's my plan for a video I want to record later this year.


Oh sorry, I guess it's not exactly the "same thing", mine's plugged into a socket :P


If you're into this but don't need the WiFi connectivity I bodged together my own DSLR shutter release triggered by my Arduino: http://blog.mclemon.io/hacking-the-canon-dslr-trigger-releas...


Nice little project and writeup! I thought about using my SLR but I don't want to bump it's shutter count too much, and since I have young kids in the house, there's no good place I can set it up on a tripod for long periods of time without it taking a tumble :(


Ah yeh this was an old-ish DSLR (Canon 450D) that has seen better days so I didn't mind too much about running it for a few hundred pics every few days - it's on its way out anyway :)

I had a similar concern with my dog experimenting with the camera setup - luckily he managed to resist the temptation!


Similar, but not quite... The way I've done timelapse in the past, is via an old laptop plus an old USB camera, and any number of freeware tools to take a jpg every X minutes.

I happen to have a registered copy of Webcam32 from years ago, so with that and copy of XP, I've been able to timelapse things for zero-cost. Then it's just a case of FFMPEGing the jpgs into an mp4.

However, nothing comes close to a proper DSLR doing it - it's all about the optics. So I might do the hack described in this comment (I have a 350D):

https://news.ycombinator.com/item?id=13865967


I have also been shooting with a various laptops, USB cameras (mostly Canon PowerShot A-series), software (including my own badly rolled C++ tool using CanonSDK) before finally settling on GBTimelapse, which ended up being the killer "app" for controlling multiple cameras at once. I just did a count of ~3 million images, here are some of my more dodgy installations using my now defunct beloved waterproof Panasonic touchbook: https://imgur.com/a/jyNLP

I still continue to shoot but I've moved on to using GoPro 5 and various Nikon DSLRs and I have to absolutely agree: nothing comes close to DSLR and decent optics! The only problem is that you get slight fluctuations in image brightness even when shooting identical shutter speed, etc. which necessitates a non-free tool like GBDeflickr or LRTimelapse to get flicker-free video. Alternately just stick to using non-SLR cameras such as GoPro or other Compact with the function builtin, which I've noticed is becoming quite standard in most cameras.

As for controlling your Canon, if you want to skip a step (and extra hardware requirements) you could just put MagicLantern on an SD card and write a LUA script (or download one of the many available ones out there).


Has anybody found an easy way to power a zero via solar? I haven't been able to find any cheap or lightweight solutions. It'd be perfect for a project like this.


There isn't a really cheap way to do it. Solar panels are cheap, li-ion batteries are cheap. A PWM/MPPT charge controller is still not cheap. You can spend $20-30 on the other components and still have to purchase a $70-100 charge controller.


I explored this once. The camera actually draws a fair bit of current, so you need big (1Msq) panels to run the Pi-Zero properly and/or charge a battery.


Yeah, the only way to get it to work reliably is to also employ other energy-saving tricks, like using a Sleepy Pi HAT and a rechargeable battery. The cost starts inching towards $1k+ at this point (not to mention the time involvement as well).

However, it's definitely doable, and if you have something like a year-long construction project... it's not really that expensive for what you'll get in the end!


Thanks geerlingguy, your Pi-related content is always useful and enjoyable to read.


This is a nice write-up :-) Any chance you could provide a dd image to get up and running quickly?


Before the Pi Foundation released Raspbian Lite, I used to distribute a semi-popular 'diet' image of Raspbian for headless Pi servers, but found that in addition to extra bandwidth costs, there were many little security risks associated with maintaining an OS image. So I'm not interested in taking on those risks again, unfortunately.

I would like to get the packaging and installation of this script a little more streamlined, though!


i've created an awesome for raspberry https://github.com/blackout314/awesome-raspberry-pi :D


I'm building this at home too. Quite exciting!


Nice! Are you using the Zero W or one of the other Pi models?




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: