Binary Intervalometer

I'm sure you all know what time lapses are. To take them you need an intervalometer, a device that triggers a camera at a desired interval. (There fairly expensive)

Anyway, I built one some time ago, a bulky Radio Shack project box with a bunch of wires, an Arduino Duemilanove w/ protosheild, a few buttons and knobs, flashy lights, and an LCD. It served me well, and it was never documented. This conspicuous-looking black box I could only imagine not to be the best thing to travel with at an airport.

So considering this, I built a small Altiods tin-sized intervalometer based around the Atmega328p and programmed through the Arduino IDE.
To set the interval, you need to set the 8 dip switches, each representing a single bit in a byte, to the desired interval time in seconds as represented in binary. It's simple if you understand binary.

The maximum interval time is 255 seconds or 4 minutes, 15 seconds.

Full schematic!!
Imgur

Fully commented source (Great for beginners) -

// Binary Intervalometer
// By Physics_Dude
//
// Digi-pins 2 - 9 have dip switches
// Digi-pins 11 - 13 are for LED, focus, and shutter

// Set dip switch pins
const int buttonPin2 = 2;     
const int buttonPin3 = 3; 
const int buttonPin4 = 4;    
const int buttonPin5 = 5;
const int buttonPin6 = 6;    
const int buttonPin7 = 7;  
const int buttonPin8 = 8; 
const int buttonPin9 = 9;  

// Set led, focus, and shutter pins
const int ledPin =  13;  
const int focusPin =  12;  
const int shutterPin =  11;  

// Define default dip switch values
int buttonState2 = 0;      
int buttonState3 = 0;      
int buttonState4 = 0;       
int buttonState5 = 0;       
int buttonState6 = 0;   
int buttonState7 = 0;         
int buttonState8 = 0;       
int buttonState9 = 0;    

// Delays
long DelayVal = 0;  // Starting delay value
int hold = 100;  // Time shutter button is held down for


void setup() {
  // Inputs
  pinMode(buttonPin2, INPUT);
  pinMode(buttonPin3, INPUT);
  pinMode(buttonPin4, INPUT);
  pinMode(buttonPin5, INPUT);
  pinMode(buttonPin6, INPUT);
  pinMode(buttonPin7, INPUT);
  pinMode(buttonPin8, INPUT);
  pinMode(buttonPin9, INPUT);        

  // Outputs
  pinMode(ledPin, OUTPUT);      
  pinMode(focusPin, OUTPUT);      
  pinMode(shutterPin, OUTPUT);      
}

void loop(){

  // Turn all outputs off
  digitalWrite(ledPin, LOW);   // LED off
  digitalWrite(focusPin, LOW);   // Focus not pressed
  digitalWrite(shutterPin, LOW);   // Shutter not pressed

  // Read the states of the dip switch values:
  buttonState2 = digitalRead(buttonPin2);
  buttonState3 = digitalRead(buttonPin3);
  buttonState4 = digitalRead(buttonPin4);
  buttonState5 = digitalRead(buttonPin5);
  buttonState6 = digitalRead(buttonPin6);
  buttonState7 = digitalRead(buttonPin7);
  buttonState8 = digitalRead(buttonPin8);
  buttonState9 = digitalRead(buttonPin9);

  // Lazy math time!  
  // Bit 1
  if (buttonState2 == HIGH) {     
    DelayVal = DelayVal + 1;  
  } 

  // Bit 2
  if (buttonState3 == HIGH) {     
    DelayVal = DelayVal + 2;  
  } 

  // Bit 3
  if (buttonState4 == HIGH) {     
    DelayVal = DelayVal + 4;  
  } 

  // Bit 4
  if (buttonState5 == HIGH) {     
    DelayVal = DelayVal + 8;  
  } 

  // Bit 5
  if (buttonState6 == HIGH) {     
    DelayVal = DelayVal + 16;  
  } 

  // Bit 6
  if (buttonState7 == HIGH) {     
    DelayVal = DelayVal + 32;  
  } 

  // Bit 7
  if (buttonState8 == HIGH) {     
    DelayVal = DelayVal + 64;  
  } 

  // Bit 8
  if (buttonState9 == HIGH) {     
    DelayVal = DelayVal + 128;  
  } 
  // Full byte complete! 

  // Convert to milliseconds
  DelayVal = DelayVal * 1000;

  //Minimum Delay is 1 second
  if (DelayVal < 1000)
  {
    DelayVal = 1000;
  }

  // Compensate for shutter press delay.
  DelayVal = DelayVal - hold;

  // Delay for "DelayVal" milliseconds
  delay(DelayVal);

  // Done? Now activate outputs!
  digitalWrite(ledPin, HIGH);   // LED on
  digitalWrite(focusPin, HIGH);   // Focus pressed
  digitalWrite(shutterPin, HIGH);   // Shutter pressed
  delay(hold);   // Time shutter is held down 

  // Reset DelayVal
  DelayVal = 0;

}

Here is a short, uneventful demonstration of the device working.
~~My Binary Arduino Intervalometer - YouTube

Here is a proper sequence of time lapse clips I put together from my vacation to New York. All of which were recorded using this project.

Quick numerical binary lesson:
There are 8 bits in a byte
In order, each bit is equal to:
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1

To read or write numerical binary values you add the sum of each active bit, indicated by a "1", and ignore the "0"s

Lets take 00101010 for example.
The active (1) bits are 32, 8, and 2
Add them up and you get 42

And to distinguish the difference between a 1 and 0, find the nearest power switch with a line and circle printed on it. You'll see that 1 means on and 0 means off.

Very neat! any example photos you shot with this compact device?

liudr:
Very neat! any example photos you shot with this compact device?

Well, the short video after the image was the first test. I am going to try to get some good example footage tomorrow night for the fourth of July.
Hopefully with some sparse fireworks and a sun set if the weather co-operators.

Besides that, I'll most likely be travelling somewhere later this summer, and I hope to get numerous time lapses when I'm away.
However I'm worried with the idea that the TSA might be concerned with this "device" passing through there airport as I have never travelled with a home-built invention before. Got any tips so I won't loose this awesome creation of mine to the TSA?

This is cool. I still have a project in the back of my head to have a time-lapse system where by I have the intervalometer, plus a pan/tilt/move system on rails (if I want the camera to move a certain path on rails - say "ride" around a corner of a building).

Thank you for posting, watched the vids, love time lapse.

physics-dude:
(There fairly expensive)

They're not, but very nice job. :slight_smile:

Inprogress:
I still have a project in the back of my head to have a time-lapse system where by I have the intervalometer, plus a pan/tilt/move system on rails

That also is something I plan to build in the future. Mainly using some 80/20 hardware.

Check out Dynamic Perception's time lapse dolly, It's open source and may give you a few tips.

Kaouthia:

physics-dude:
(There fairly expensive)

They're not, but very nice job. :slight_smile:

Eh, for the name-brand ones from Nikon or Cannon, and considering how simple they are, ~$150 isn't very agreeable.

There's plenty of other manufacturers out there. The Yongnuo ones are dirt cheap and offer, I think, better options than the Nikon/Canon ones.

Kaouthia:
There's plenty of other manufacturers out there. The Yongnuo ones are dirt cheap and offer, I think, better options than the Nikon/Canon ones.

I guess you could say I'm a stickler for the name brand, non-third-party products.

Besides, where are you going to find an open source intervalometer that utilises binary and is built inside an Altoids tin? :grin:

yup the tin definitely clinches the deal for me!
as for getting it past "security", just remove the batteries, then it's just "anonymous junk" to the hard of thinking (aka "security")

physics-dude:
I guess you could say I'm a stickler for the name brand, non-third-party products.

Well, if you wanna be a stickler, and get technical. Nikon's is free. Has been ever since the D200 as it's built into Nikon's bodies. :smiley:

physics-dude:
Besides, where are you going to find an open source intervalometer that utilises binary and is built inside an Altoids tin? :grin:

Totally, absolutely love what you've done. Very neat, but also very useful. :slight_smile:

liudr:
Any example photos you shot with this compact device?

Here is what I got yesterday on the 4th.

I'm not super satisfied with this specific time lapse but I hope to get some better materiel later this summer.
This was just a test for the intervalometer; it works perfectly.

What body & lens are you using? The lack of any aperture flicker is rather impressive.

Kaouthia:
What body & lens are you using? The lack of any aperture flicker is rather impressive.

Nikon D3100 with NIKKOR 18-200mm f/3.5-5.6G ED VR II

The flickering is prevented by putting every variable on the camera to manual. This includes white balance, shutter speed, aperture, ISO, and focus.

The sparse white-ish flashes that may have been seen were due to me wielding a flashlight while being rather board, and to indicate a manual change in exposure for later editing in post.

physics-dude:
The flickering is prevented by putting every variable on the camera to manual. This includes white balance, shutter speed, aperture, ISO, and focus.

Having everything on manual doesn't usually prevent flicker, as the camera has to stop down the aperture every time it takes a shot (it lets it go back wide open after the shot has been taken). If you're going down anything more than about a stop from wide open, you'll often get a lot of flicker.

But, that 18-200 seems mighty impressive in this regard, what aperture were you at? Even on my 70-200mm f/2.8VR or 300mm f/4 AF-S, unless I'm shooting wide open, there's aperture flicker from shot to shot. I've taken to primarily using M42 lenses these days for my timelapse.

Kaouthia:
What aperture were you at?

In the first segment of the video I was at f/3.5 at 18mm
The second segment was at f/5.6 at 200mm
The third segment was at f/5.0 at 65mm
And the final sunset segment was at f/22 at 32mm

I have never experienced flickering from the aperture as is settles in place, although I can see why this would happen. I don't think I have ever experienced this is because my camera, the D3100, being entry level (and becoming a little under-featured for me) has a slow burst rate of 3 frames per second. Since the entire mechanism is considerably slow this would allow some time for the aperture blades to settle before the sensor gets exposed.

If your camera has a quiet mode, I suggest that you try taking time lapses with that and see if the flickering improves. This may include a delay between closing the aperture and opining the shutter.

physics-dude:
I have never experienced flickering from the aperture as is settles in place, although I can see why this would happen. I don't think I have ever experienced this is because my camera, the D3100, being entry level (and becoming a little under-featured for me) has a slow burst rate of 3 frames per second. Since the entire mechanism is considerably slow this would allow some time for the aperture blades to settle before the sensor gets exposed.

Yes, perhaps it is a case of "budget is better" for this particular application. That's one problem with these entry level cameras. They have just enough features to entice you in, but if you get serious about it, you rapidly outgrow them and you end up with a second body that you can't sell and will probably never use again, heh.

Watching the video again, I can see a little flicker in the f/22 sequence, but not much, certainly not as much as I've experienced with some lenses, so still very impressive. It might be the slower framerate that's making it less obvious too.

physics-dude:
If your camera has a quiet mode, I suggest that you try taking time lapses with that and see if the flickering improves. This may include a delay between closing the aperture and opining the shutter.

The problem with quite mode is that I'm using an external intervalometer to control the exposure (shutter speed) for bulb ramping. So, using quiet mode and having that delay throws all the calculations off, and getting the timing ms perfect to cover that initial delay can be tricky. :slight_smile:

But, even using the built in interval timer, using either the quiet mode or the delay feature which locks up the mirror before the shot, flicker can (and often does) happen. Try some other lenses, it might be that the lens & body combo you're using is particularly well suited to this kind of task, so you haven't noticed it yet. I have a Sigma 10-20mm f/4-5.6, which is an absolutely fantastic lens, but doing beach cloud scenes it flickers like crazy once you get down to f/8-f/16 and you're playing it back at 24fps - Fortunately I have the B+W 10 stop ND filter, some rather sexy Schneider 4x5.65" ND filters and the Z-Pro holder so I can shoot it wide open (where the Sigma performs beautifully) and still lose up to 20 stops of light if need be (very nice for those long exposures with the sun in the shot).

This is one I shot on the Sigma that wasn't too bad (although Youtube's compression gives it horrible moiré and artifacting issues). Beach Timelapse Sequence - YouTube

With the M42 lenses, there's no workarounds needed. I put them on my D200 & D300s bodies using an M42->Nikon adapter with a diopter to retain infinity focus, and the aperture never changes (because the camera isn't setting it each time it takes a shot, it's controlled on the lens itself and stays constant throughout). Because most of them are 30-40 years old or more, and quality control was pretty much absent from their production, they can have some great character too. :slight_smile:

@Kaouthia,
Another thing that could be lessoning this flickering in my case is the fact that I was using long espousers of 8 seconds for the night shots. This would average out the initial wrong-doing of the aperture.

I almost forgot, you people want a schematic don't you.
Here you go. (In main post too.)

Imgur

This looks good - I though about doing binary but just stuck with the normal pot method for the time being. It seems to work well for you, and the board looks very clean as well! Nice.