Tuesday 20 May 2014

1st attempt at Cress Heads

I want to get my CodeClub to setup some timelapse photography using their Raspberry Pis and the PiCameras. Fortunately there is a great resource for with instructions and ideas for doing just that using quick-growing cress as the subject matter.

Lighting can be crucial to getting decent results when doing timelapse photography. While changes in brightness can be dramatic for landscape scenes, they can spoil the illusion for close-up objects. So I wanted to experiment with a few ideas.

Because this is for CodeClub, I also thought I'd emix the original instructions  thought I'd use the excellent picamera Python module to control the camera. This also has the advantage of making it easier to integrate other peripheral devices into the system... like a PiLite (to provide illumination) for example.

Obviously you need somewhere where the whole operation won't be disturbed. I plumped for the windowsill in my office. It gets plenty of light in the day, and hopefully the PiLite would provide enough balance illumination during the night (obviously you don't have to use a PiLite, just a bunch of leds in a breadboard would do).

Here's my setup. There's nothing significant about the Camus book - it just happened to be the right thickness to keep the Pi level on its side!


I only need to activate the PiLite while a picture is being taken, and this is pretty easy to program.

#!/usr/bin/env python 
import serial, time, sys
import picamera 
from datetime import datetime, timedelta 
s = serial.Serial()
s.baudrate = 9600
s.timeout = 0
s.port = "/dev/ttyAMA0" 
try:
    s.open()
except serial.SerialException, e:
    sys.stderr.write("could not open port %r: %s\n" % (s.port, e))
    sys.exit(1)
with picamera.PiCamera() as camera:
    camera.start_preview()
    time.sleep(2)
    s.write("$$$ALL,ON\r")
    for filename in camera.capture_continuous('img{timestamp:%Y-%m-%d-%H-%M}.jpg'):
        time.sleep(10) #
s.write("$$$ALL,OFF\r")
        print('Captured %s' % filename)
        time.sleep(3600) #
s.write("$$$ALL,ON\r"
)
(I'll need to make this a bit simpler/clearer for the CodeClub posse but it's good enough for government work here).

Here's the end result after 7 days:


As you can see, the difference in light from day to night time remains quite noticeable despite the PiLite's bright leds.  I wanted to make sure the cress got plenty of light during the day, but perhaps it didn't need such direct sunlight.  Next time I think I'll make a 'studio' that surrounds the cress more completely from the sides.

Or you can have some motorised blinds that were also controlled by the Pi and closed just before the images was taken. Hmm that might be a little complicated for this project.

I also need to make the walls of the studio less shiny to reduce reflections of the PiLite at night (ok, perhaps Lego wasn't the nest choice but is was very quick and convenient).

You can also see that the gooseneck mount does seem to flex slightly during the day (possibly due to thermal expansion). Perhaps a more rigid mount will be better (more Lego!).

Finally, the cress grows really high! I'll need to have the camera framed higher next time. 

No comments:

Post a Comment