Exploring, Software, Electronics, Photography, and Kayaking from the Gulf Coast

LightRails – Dynamic External Exposure Control for Time-lapse

I’ve been sitting on this a little while, and I feel a bit remiss in not sharing it sooner. I had intended to make it “perfect” before sharing, but feel I’ve reached a point where I’m not ready to spend all of my effort on this project, and instead wish to work more on OpenMoco (but we’ll talk more about that soon!). So, I’ll share this as a more “rough” project.

Some time ago, I started out with the TSL230R chip from Taos with the intent of producing a (a) my own digital light meter and (b) a dynamic external control system for time-lapse photography. Certainly, the act of creating my own digital light meter was a smashing success, also having it control my dSLR via a remote cable in bulb mode was also a great success. Enough so that it should prove an invaluable tool to the DIY pinhole photographer. (Man, how do you time that 2:35:20 exposure manually? =)

The problem I wanted to solve was a difficult, but common one: how do you effectively manage exposure changes across sunrise and sunset time-lapses with a dSLR? It sounds very easy, just go into Av or Tv mode! Of course, life isn’t that easy. The standard dSLRs generally only meter and adjust exposure in the very rough terms of 1/6, 1/4, 1/3, or even 1/2 EV steps! This means it has a sledge hammer where the problem calls for a gentle tapping of a finger. I set out to create a system that would control the camera externally, metering and adjusting exposure in 1/100 EV steps…

Some more information about how this all got started, and some color commentary along the way can be found in these two forum postings over at timescapes.org:

Unfortunately, the system is still a bit rough for time-lapse photography in controlling exposure in all conditions, but it can be made to succeed in certain conditions, given practice and patience. I’m not going to go into great detail on instructions, as it should be largely evident based on the information below, but you will need the following parts at a minimum to use this code:

Effectively, the sensor should be placed remote from the control unit (but within specs of the TSL230R), and the control unit uses an LCD display to display information, and five momentary switches to control operation and input data. The best configuration I’ve found for using this for time-lapse is to create a reflector, placing the sensor and the capacitor in a separate enclosure from the control, and place the sensor inside of the reflector. For a reflector, I simply used three pieces of wood connected like a ‘C’, painted the inside flat white, and mounted the sensor housing inside of the ‘C’, facing downwards. The reflector could then either be placed in complete shade, or pointed towards the scene. Either way, the unit should be protected from over-head light changes – it should either meter the scene on average, or the amount of light read in shade. Which is better depends on the scene in question — shooting sunny sky-scenes with dim foregrounds generally require scene metering, whereas equally-lit sky and foregrounds prefer shade-readings. It is also capable of metering through your eye-piece, but resolution suffers greatly (set TTL F/stop in the UI to enable this mode).

The system is configured with ISO, f/stop, minimum and maximum exposure times, number of EV divisions per step (best left at 100), and shot interval. The light reading is calculated once per second, and exposure time calculated from the settings and light reading. EV adjust is set to achieve the proper exposure vs. the metered exposure, and the system is left to run.

Random fluctuations and massive jumps from physical interference (say a dog sniffing at your meter while you’re napping =) are prevented through the simple application of a ‘ev change ceiling’ setting, which prevents any change in calculated EV greater than the ceiling (in x/y EV steps — e.g.: no change greater than 3/100’s EV.) — this method has proven its self as both the most simple and effective means through empirical testing, beating out averaging, weighting, and all other sorts of complicated methods.

If you find this useful, come up with a novel application, or have any questions – please don’t hesitate to drop me a comment here. I’d love to know what you do with it, or help you if you need it.

The following videos should give you some idea how to assemble and use it:

note: both videos show older versions of the UI and the device, where the sensor was integrated into the controller. This is not recommended.

And, here’s an example of its performance:

And, without further ado, here’s the code. Each section should be pasted into a seperate tab in the Arduino UI, with the first section of code in the main tab.

/*
-- Camera Control Functions
LightRails 1.0
A dynamic external exposure control system with
integrated intervalometer for time-lapse
photography
Copyright (c) 2008-2009 C. A. Church drone< a_t >dronecolony.com
This program is free software: you can redistribute it
and/or modify it under the terms of the GNU General
Public License as published by the Free Software
Foundation, either version 3 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License
for more details.
*/
void fire_camera() {
digitalWrite(CAMERA_PIN, HIGH);
// start timer to stop camera exposure
MsTimer2::set(cur_exp_tm, stop_camera);
MsTimer2::start();
// update camera currently enaged
camera_engaged = true;
return;
}
void stop_camera() {
digitalWrite(CAMERA_PIN, LOW);
// turn off timer
MsTimer2::stop();
// update camera currently enaged
camera_engaged = false;
}

I’m looking to start this for my 11×14 pinhole, from what I gather this is designed to take photos at intervals, this should easily be removed to take one photo and adjust the exposure time throughout the shot, right?
Also do you have any software/hardware refinements since this was posted?

Hi,
great thing.
I am new to this one.It will be useful for my DIY time lapse projects, but it´s interesting to know how to wire all this switches and the LCD to arduino. If it´s possible to post some kind of wiring diagram or something similar? I look whit interest your project for time lapse, but can´t figure out how all of this is connected in one machine to work fine, like I see in your videos. If are any other links to your project or similar to see all in one piece?
Regards
Deyan

Line 279 in the main PDE (in this post) shows how I had my LCD wired up (I just used different pins). The buttons and camera pin assignments are defined on lines 34-42, and the TSL230R pins are right above that. The first tutorial (Arduino and the TSL230R) talks about how to wire up the TSL230R.

Other things to know if it´s possible. Do you use 2 different arduino,one for the LightRails and one for the engine whit the motors?
As I understand, one is controlling the metering and triggering the camera and the other one the movements of the rig. They are programed separately to perform there tasks.I live in Spain and if I can´t find the TSL230R in local store, is possible to replace it with other model or this will cause different light metering? I sou one wiring diagram for stepper motors in other post, and if I understand right, this one is for the engine that dives the rig and needs the isye drivers or other ones hooked up to the motors to perform the movements.
It will be interesting to program all this from PDA in the future. So will be much is ye to move the rig from one location to other, whiteout need of laptop or programing it at home.

I love the project but I think the premise of 1/100EV may be a little over the top. DSLRs do only meter in 1/2EV increments but they can also only expose in 1/2EV aperture/shutter speed increments. Also the general rule is accuracy greater than 1/2EV isn’t necessary. That doesn’t mean that two images 1/4EV apart are going to look identical. What it means is that given two camera RAW files that are 1/4EV apart you should be able to post-process them to look pretty much exactly identical. Of course this rule came from the film world where a negative has almost twice the dynamic range of digital sensors..

In practice, the actual change is coarser than 1/100 EV as the reality is that the light levels do not follow a nice, linear curve as day goes to night and vice-versa. The underlying issue is that most people are shooting JPG’s for timelapse, and want to avoid the flicker that the 1/4 or 1/2EV changes result in. This is a real problem in timelapse video that people are facing each day. If it weren’t a problem, I would’ve never taken on the challenge to try and solve it *grin*

Of course, we could all shoot raw, and then use some software to provide the “right” change in exposure levels after leaving our camera on auto-mode. But it doesn’t seem to exist (not without a lot of manual intervention). The goal here was to provide a light meter that one can get more granular (auto) exposure adjustments out of than 1/4-1/2EV – which do fail to produce the desired results.

In practice, my testing revealed that most of the time you’re going to see realistic changes on the order of 1/10th to 1/20th EV. Mostly because of the weighting and EV change limits one applies to make it survivable in real-world situations. (One issue I had was brief changes in scene luminance would have disappeared between the metering and actual shooting, bringing flicker back.)

So yeah, 1/100EV is unnecessary in most cases, but *shrug* it’s there! And, by shooting in bulb, we do our own timing, so the only limit is the upper shutter speed (due to the fact that the analog inputs must be de-bounced, and cameras try to avoid responding to noisy remotes, etc.)

In the process of building my own system based on your work and on the work of PhotosbyKev… Thanks for posting such an informative project description! It’s really given my experimentation a head-start…

I’m such a visual guy that I’m having a hard time envisioning the reflector you built for your light sensor and was wondering if you’d be able to post a picture to help me out?

I don’t have any pictures of the mount its self, and I’ve since recycled the lumber, but it was really quite simple: just an 8″ high “C” made of three pieces of 1×6″ wood, painted white on the inside. Then the sensor just mounted to the back piece (inside of the “C”) and then pointed towards the bottom.

Your work inspired me to get an arduino, go to my local electronics shop to buy all the required components, and use a soldering iron for the first time! Thanks so much for this. Having now built bulb-ramping intervalometer, I have a few questions. I have done a little experimentation and I am not yet pleased with my results. I hope with your experience you are able to give me a few pointers.

I have had a little bit of a problem with flicker. I presume that it is because of the way I have mounted the TSL230 chip and will be trying various alternatives.

I am using a Canon camera, and with shutter speeds below 1/2 seconds, it seems that exposure is not very accurate. Have you had any similar experience?

Sorry for the slow response! A 9V battery won’t be providing power for very long, I’d suggest a handful of AA batteries, or some C/D batteries. I usually use 12V SLA batteries (8+ Ah rating) in the field for all day power for my moco rigs.

The LightRails is definitely not perfected, and in fact, there are a few errors in the code (see the comments on the first two tutorials). I spent many weeks getting this far, and largely got tired of working on the same thing every day =)

If you see PhotoKev’s implementation, it is improved and likely performs much better.