Go Down

Topic: Binary Intervalometer (Read 8817 times) previous topic - next topic

physic.dude

Jul 04, 2011, 04:34 am Last Edit: Sep 12, 2011, 12:14 am by physics-dude Reason: 1
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!!
http://www.flickr.com/photos/50241702@N04/5943905339/sizes/l/in/photostream/

Fully commented source (Great for beginners) -
Code: [Select]
// 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.
http://youtu.be/FuPBKNC4i90


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.
http://youtu.be/rqjRefAv3Us

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.


liuzengqiang

Very neat! any example photos you shot with this compact device?
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

physic.dude


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?

fanjanc@gmail.com

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.
"The really amazing thing is how many people are successful with their Arduino projects considering the fact that so many of them do not have a technical background.  A lot of them seem to try, and succeed with, projects that no sane engineer would even attempt." - floresta commenting on the proper use of LCD displays

Kaouthia

John

physic.dude


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.

physic.dude



(There fairly expensive)

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


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

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.
John

physic.dude

#8
Jul 04, 2011, 06:44 pm Last Edit: Jul 04, 2011, 06:53 pm by physics-dude Reason: 1

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?  :smiley-mr-green:

mmcp42

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")
there are only 10 types of people
them that understands binary
and them that doesn't

Kaouthia


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. :D


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

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

physic.dude


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.

http://youtu.be/YL9Rd11FDhw


Kaouthia

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

physic.dude

#13
Jul 05, 2011, 10:04 pm Last Edit: Jul 05, 2011, 10:07 pm by physics-dude Reason: 1

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.

Kaouthia


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.
John

Go Up