Intervaluino: A DIY Intervalometer for your Canon SLR

Friday, June 20th, 2008 | art, electronics, howto, make, photography

UPDATE: The Intervaluino got its own page on my photo blog now, where all updates are posted.

+++

Ah, a new day, a new WordPress version… you don’t see it, but I finally updgraded.

I’m very much into electronics right now. As a child, I received this awesome collection of circuit diagrams with instructions on how to build blinking light machines or light sensor alarm systems – and I’ve built them all (although I didn’t understand most of the theory behind it).

Now, I’m back onto electronics – thanks to my video projects. Over the last two months, I made four time-lapse videos; clouds, cities, pizza and strawberries. The problem I encountered was that while my camera can record videos up to 27 hours (internal HD + strong compression), compressing more than 4 days of video is a resource-hogging process.

So I decided to use my photo camera for time-lapse shots; to do that, I needed a so-called intervalometer
- a device that times the shots to regular intervals. But those are expensive, and even the cheapest consumer device I found costs $140 – not counting cables, AC adapters or S&H.

So I decided to build my own.

The friendly neighbourhood hive mind pointed me towards getting a microcontroller. I decided upon the wonderfully open source gadget Arduino, which I had read so much about in MAKE magazine. After some basic Arduino training I started working on the hard- and software for my own intervalometer.

And here it is:

Full view of the (packaged) Intervaluino Intervaluino\'s insides

I call it Intervaluino, and it does exactly what I want him to do: Tell my Canon EOS 400D to take pictures at regular intervals. Wanna build one yourself? Please follow me.

Features

  • Programmable intervalometer, based on the Arduino microcontroller
  • Works for Canon cameras that use a 2.5mm stereo jack-controlled remote shutter release (EOS 300D, 350D, 400D, DigitalRebel)
  • Powered by USB, AC adapter or 9V battery
  • Timing programmable via the Arduino programming interface
  • Start/stop push button
  • Focuses before shooting
  • Maximum interval between shots: 24 days 20 hours
  • Published under a Creative Commons -by -nc -sa 3.0 license: Use it, share it, change it, as long as you tell it’s based on my work, don’t use it commercially, and use the same license for derivatives.

What could be better:

  • Should have multiple pre-programmable interval settings, for photo trips
  • Interval tuning via potentiometer
  • Stop button doesn’t work too well at long intervals (you need to press the button until at least one interval passes)

It’s not perfect, neither its hardware nor its code. But it fulfills my initial requirements.

Required Parts

  • 1 Arduino (I used the Diecimila model) -
  • 3x 100 ohm resistors
  • 1x 10k ohm resistor
  • 2 x 5V reed relays (NO = normally open)
  • 1 x push button of your choosing
  • 1 x 2.5mm male stereo jack
  • 1 x 80 x 50 mm strip board
    (alternatively: bread board or Arduino protoshield)
  • Assorted wires
  • Arduino USB cable
  • Arduino AC adapter OR Arduino 9V battery pack
  • Basic electronic tools to cut and de-isolate wires and to solder components (if you use a strip board), maybe a multimeter to test connections
  • A nice box
  • 20 cm of thin steel cable (used as a loop to attach the Intervaluino to the tripod)

Circuit Diagram (click to enlarge)

Code

// Intervaluino
// this code programs the Arduino as an intervalometer for a Canon EOS camera, using two relays and a push button
// this enables you to create time-lapse movies with your camera.
// change the variables “full_time” and “short_time”  to automatically calculate the right time interval (based on 25 frames per second)
// upload the code via USB, fire up the Arduino, plug it into your camera’s remote shutter release, and press the Intervaluino push button.
// press the button another time to stop the sequence (doesn’t work that well if your interval is long)
// make sure to turn on single shoot
// (c) Lord Yo 2008 (intervaluino a_t sporez do:t com)
// Licensed under a Creative Commons (Attribution Non-Commercial Share-Alike) license

/////////// Change these variables according to your needs

long full_time = 14400;  //full length time to cover (in seconds)
long short_time = 120;        //length of time-lapse movie (in seconds)

int shutter_on = 200;       //time to press shutter, set between 100 and 300
int shutter_wait = 5000;   //initial time to wait to begin sequence
int wakeup = 300;          //time to activate wakeup (focus)
int wakewait =200;         //time between wake and shutter

/////////// Further Variables ////////////

long shutter_off = (40 * full_time / short_time) – shutter_on – wakeup – wakewait;    //time to wait between shutter releases;

int outpin = 11;            //output for shutter relay from pin 11
int wakepin = 8;            //output for focus relay from pin 8
int switchpin = 2;          //input from button from pin 2

int val;                    //value of button press
int buttonState;            //check variable for change of button press
int on_off = 0;             //state of sequence (turned on, turned off)

/////////// Setup ////////////

void setup() {
pinMode(outpin, OUTPUT);        //outpin gives output
pinMode(switchpin, INPUT);      //switchpin receives input
pinMode(wakepin, OUTPUT);      //wakepin gives output

buttonState = digitalRead(switchpin);    //read value of the button
}

/////////// Loop ////////////

void loop(){

val = digitalRead(switchpin);      // read button value and store it in val

if (val != buttonState) {          // if the button state has changed…
if (val == LOW) {                // check if the button is pressed…
if (on_off == 0) {             // if the sequence is currently off…
on_off = 1;                    // turn the sequence on
delay(shutter_wait);           // wait the initial period
} else {
on_off = 0;                  // turn the sequence off
}
}
}

buttonState = val;               //switch the button state

if (on_off == 1) {                //while the sequence is turned on…

digitalWrite(wakepin, HIGH);   //turn wakeup/focus on
delay(wakeup);                 //keep focus
digitalWrite(wakepin, LOW);    //turn wakeup off
delay(wakewait);               //wait
digitalWrite(outpin, HIGH);    //press the shutter
delay(shutter_on);             //wait the shutter release time
digitalWrite(outpin, LOW);     //release shutter
delay(shutter_off);            //wait for next round
}

}

Photos and Wire Colors

(btw, the only reason why I used two stripboards was that I added another relay later and didn’t want to start from scratch; you can just use one slightly larger strip board)

Full view of the (packaged) Intervaluino Plugs of the intervaluino Intervaluino\'s insides

I used the following color coding:

  • black for ground
  • red for 5V (on the board) and for the connection to F (focus)
  • 2x green for the output channels on pins 8 and 11
  • yellow for the input channel on pin 2 (on the board), and for the connection to SH (shutter)
  • grey for the connection to CG (camera ground)

How to Build It

This is only a short instruction, which assumes that you can read simple circuits, understand components, and solder them.

  1. According to the circuit diagram, lay out the parts and wires on the strip board to find the right spacing configuration (as opposed to the pictures above, you can use just one strip board for all the parts – no need to use two separate ones)
  2. Solder the parts as per circuit diagram (make sure you test the relays – it took me a while to figure out what triggers what!) – don’t connect it to the Arduino yet
  3. Solder the stereo jack to the wires (red, yellow, grey) according to the wiring diagram
  4. Compile and upload the Intervaluino code via USB
  5. Detach the Arduino from USB
  6. Connect the strip board to the Ardunino (pins 2, 8, 11, 5V, 3x GND)
  7. Connect the Arduino to USB again
  8. Wait a couple of second for initialization
  9. Press the button
  10. Test the device with a multimeter on the stereo jack: Every couple of seconds, the circuit between F and CG should be closed, shortly followed by the circuit between SH and CG.
  11. If it works, congratulations! (if it doesn’t, test your circuits thoroughly.)
  12. Plug the stereo jack into your camera’s remote shutter release
  13. Turn on your camera, focus it on something brightly lit, and set it to single shot
  14. Repeat steps 7-9. Your camera should now shoot a picture every couple of seconds
  15. Put it into a nice box, cut holes for the cable and the plugs
  16. To set your own intervals, follow the instructions in the code (change the values for variables full_time and short_time)

Some tips

  • Use a tripod
  • Set your camera to single shot
  • Consider turning off autofocus – if you follow a static object, you will only have to focus once.
  • For photo series above 1500 shots (or those with flash), get an AC adapter for both your camera and Intervaluino

I hope this is of use for you! If you have questions, want to let me know what you think, or want to share an Intervaluino time-lapse movie, please comment this post! Or contact me at (intervaluino a_t sporez do_t com)!

  • Digg
  • del.icio.us
  • Netscape
  • Reddit

Tags: , , , , , , , , , , , , , , , ,

28 Comments to Intervaluino: A DIY Intervalometer for your Canon SLR

[...] video shows 4 hours of clouds at dusk, compressed to 45 seconds; it was taken with the Intervaluino on my Canon EOS 400D (manual focus, manual exposure/f-stop [...]

[...] I’ve posted circuit schematics, component list, code, photos, and an explanation on my blog – Intervaluino: A DIY Intervalometer for your Canon SLR Read more | Permalink | Comments | Read more articles in Arduino | Digg this! Source: MAKE [...]

matt
June 23, 2008

Thanks for writing this up.

I have been thinking about doing this for my nikon. I have an extra Arduino laying around, too.

One thing I was thinking about was using a transistor/diode pairs instead of a relays. Out of curiosity, why did you opt for relays?

Lord Yo
June 23, 2008

@Matt: I took relays because I didn’t know how else to approach it – what I needed was a component that connects the focus/shutter contact with the camera ground without having additional current going through it. If there is a way around relays, I would be very interested in it.

paul
June 23, 2008

i made a similiar Arduino based device for my Olympus E510 DSLR.

with 2 optocouplers instead of reeds

and combined with an serial LCD and a nunchuk and a motorized panoramahead

Aki Korhonen
June 23, 2008

Try optocouplers instead of relays. I’m working on a same kind of project and I’m using a couple of 4N35′s, haven’t tested them yet but they should work.

arnookie
June 23, 2008

just use chdk custom firmware it is much easier and much better works with nearly all canon digital cameras. You can then make your own scrips for timelapse work. I also increases iso shutter speed gives zebra mode and better video compression all in one. Take a look I highly recomend it. Also it dose not impact or alter official firmware and canon also said it dose not void warrent.
http://chdk.wikia.com/wiki/Downloads

ed
June 23, 2008

somebody knows someone working on a nikon solution??

Ron
June 23, 2008

A neat project and a nice write-up. I’d recommend either going with an optoisolator (as already mentioned) or adding a few more parts to your relay circuit. You’re safer driving that relay via a NPN transistor (ex. 2N2222) and having a protection diode across the relay coil.

It’s because the relay, being an electromagnet, acts as an inductor. When you turn the power off it dumps some current, which could make its way back to the Arduino and make it unhappy. Check out the Arduino Playground entry on Relays, it has a pretty clear schematic. My guess is that the protection diodes built into the Arduino, and the small size of the relays, are keeping things from popping.

Regardless, I really appreciate the clear write-up and the photos. I wish more people took the time to so carefully document their projects. Keep up the good work.

Lord Yo
June 23, 2008

@Paul: Sounds interesting and far more advanced than what I’ve done so far – especially the motorized panorama head. Do you have any documentation or pics?

@Aki: Thanks, I’ll take a look at optocouplers

@arnookie: I had looked at the chdk firmware, but I don’t think it works with the SLR series (EOS, DigitalRebel). Let me know if I’m mistaken.

@ed: I don’t know what kind of remote Nikon uses, but if it’s electronic, it can’t be much different from Canon – it’s just a connection between either focus and ground or shutter and ground, probably with a different jack.

@Ron: Thanks! Took me some time, but it was fun, and I like sharing. Also thanks for the tip regarding relays – I wasn’t aware of that danger. In my next version will probably look at a different way to connect the camera circuit.

[...] Intervaluino: A DIY Intervalometer for your Canon SLR at The Honey Jar (tags: electronics arduino photography hardware) [...]

Stefan
June 25, 2008

Very cool writeup!

Rick Saunders
June 30, 2008

I built an intervalometer for my astrophotos. It doesn’t set the focus/exposure (doesn’t need to) but could be modified to do so using a PC827 dual opto instead of the 4N36. Optos are much simpler to use than relays.

http://ozastro.dyndns.org/avr_timer.html

Brad P. from NJ
December 12, 2008

You, sir, have moved into ubergeek in my estimation. A photo geek, who not only custom builds a tool, but custom codes the programming for the tool, too?! In the words of the great Wayne & Garth, “We’re not worthy… We’re not worthy…”

Joe L.
February 16, 2009

Great idea! I picked up all the parts, but I have a quick question about the relays:
Does only the center pin on each relay need to be connected to the Arduino pins?
I’m not sure how to read that…

Thanks!
Joe

Michael Michael Motorcycle
March 5, 2009

If you program the stop feature via an interrupt, won’t that take care of the delay when pressing the stop button? I’m new to Arduino, so I haven’t tried this yet, but I thought that was the idea of using interrupts.

(third attempt at posting… have to keep typing this over and over… Recaptcha sucks)

michaelr
March 12, 2009

Cool. I like the opto isolator option. I just wired up a circuit to test using a couple of Darlington npn transistors, but didn’t get it to work. I’m planning on a similar project for the Nikon D80. I’m guessing it is because the shutter and focus have negligible voltage, that wasn’t enough to break through the transistor’s small resistance?

Dcb
April 14, 2009

@michaelr
How is that plan to try this with a Nikon D80 going?

Brian
April 29, 2009

Where can I find some specs for the canon interface to the 2.5mm stereo jack? Is there a document somewhere describing what the camera is expecting through the stereo cable, and what it will do given certain inputs?

Steve
May 15, 2009

I went to my local electronics shop and couldn’t get all the parts for this project, but I managed to get the 2.5mm jack. So, as soon as I got home I wired up the ground and shutter to a button and I was amazed how exciting it was to hear the shutter fire! I guess I associate that noise with pushing the shutter release on the camera, to hear it without doing the motion was a combination of exhilarating and astounded. Thanks, you really made my day!

[...] now this hardware is just for an intervallometer. Beyond this, there are many shields in the Arduino universe and my intention is to use a few of [...]

slr digital camera
September 20, 2009

Thank for implementation. How cost of this set?

melissanthi
February 24, 2010

Very cool! I am having a problem with the code though… I copied and pasted from the website but I get the message

“error: stray ‘\’ in the program”

Do you have any suggestions?

#
// Intervaluino
// this code programs the Arduino as an intervalometer for a Canon EOS camera, using two relays and a push button
// this enables you to create time-lapse movies with your camera.
// change the variables “full_time” and “short_time” to automatically calculate the right time interval (based on 25 frames per second)
// upload the code via USB, fire up the Arduino, plug it into your camera’s remote shutter release, and press the Intervaluino push button.
// press the button another time to stop the sequence (doesn’t work that well if your interval is long)
// make sure to turn on single shoot
// (c) Lord Yo 2008 (intervaluino a_t sporez do:t com)
// Licensed under a Creative Commons (Attribution Non-Commercial Share-Alike) license

/////////// Change these variables according to your needs

long full_time = 14400; //full length time to cover (in seconds)
long short_time = 120; //length of time-lapse movie (in seconds)
int shutter_on = 200; //time to press shutter, set between 100 and 300
int shutter_wait = 5000; //initial time to wait to begin sequence
int wakeup = 300; //time to activate wakeup (focus)
int wakewait =200; //time between wake and shutter
long shutter_off = (40 * full_time / short_time) – shutter_on – wakeup – wakewait; //time to wait between shutter releases;

int outpin = 11; //output for shutter relay from pin 11
int wakepin = 8; //output for focus relay from pin 8
int switchpin = 2; //input from button from pin 2

int val; //value of button press
int buttonState; //check variable for change of button press
int on_off = 0; //state of sequence (turned on, turned off)

/////////// Setup ////////////

void setup() {
pinMode(outpin, OUTPUT); //outpin gives output
pinMode(switchpin, INPUT); //switchpin receives input
pinMode(wakepin, OUTPUT); //wakepin gives output

buttonState = digitalRead(switchpin); //read value of the button
}

/////////// Loop ////////////

void loop(){

val = digitalRead(switchpin); // read button value and store it in val

if (val != buttonState) { // if the button state has changed…
if (val == LOW) { // check if the button is pressed…
if (on_off == 0) { // if the sequence is currently off…
on_off = 1; // turn the sequence on
delay(shutter_wait); // wait the initial period
} else {
on_off = 0; // turn the sequence off
}
}
}

buttonState = val; //switch the button state

if (on_off == 1) { //while the sequence is turned on…

digitalWrite(wakepin, HIGH); //turn wakeup/focus on
delay(wakeup); //keep focus
digitalWrite(wakepin, LOW); //turn wakeup off
delay(wakewait); //wait
digitalWrite(outpin, HIGH); //press the shutter
delay(shutter_on); //wait the shutter release time
digitalWrite(outpin, LOW); //release shutter
delay(shutter_off); //wait for next round
}

}
#

Timm
February 24, 2010

@Melissanthi: Looks like you have a wrong backslash character somewhere in the code. Search for “\” in the arduino code editor, and check it against the original code posted. Can’t think of anything else that causes this.

[...] by the intervalometer project at the Honey Jar, Dan Bridges produced a motion activation control to use with his Canon SLR camera. [...]

[...] Intervaluino este es un aparato similar a photoduino en cuanto al objetivo del proyecto pero con menos funciones que el anterior.Usa .NET y Netduino. [...]

Electronics mini projects
September 10, 2011

[...] DIY Intervalometer for a Canon SLR camera [...]

[...] DIY Intervalometer for a Canon SLR camera [...]

Leave a comment