My Nikon D90 camera lacks an interval timer mode. So doing night-time time lapse photography in a mode of say, expose 29 sec, wait 1 sec, repeat, is extremely time consuming. The shutter release button would have to be pressed manually every 30 seconds. Imagine doing that for over an hour... Obviously this should be automated.

There are a number of commercial intervalometers available, but what is the fun in that! In this project, an Atmel AVR microcontroller is used to make an inexpensive intervalometer. It controls the camera via infra red.

Unlike many other DIY intervalometer projects, the only user interface consists of a single button! Teaching it the exposure and delay times is done in a very natural way.

The default firmware for ATTINY2313 has a 0.5 second time resolution while ATTINY13 uses a 0.2 second resolution. Exposure and delay times from 0.5 seconds up to several hours are possible. Exposures are repeated infinitely. This is more than sufficient for night-time time lapse photography.

If you want to add a cabled shutter release, consider getting a ~$7 nikon 2.5mm remote release adapter cable from eBay or for example http://pc-mobile.net/nikongps.htm

Step 1: Required Equipment

You'll need the following:

- programming cable for AVR microcontrollers (!!!)
- desktop or laptop for programming
- some electronics components, totalling ~10EUR/$10, see Step 2
- small soldering iron e.g. 15W
- some solder

Indeed the only hurdle with this project is that you need a programming cable. These are not expensive, though, and can be used with many other Atmel microcontrollers.

Use whatever AVR programming cable you already have. Myself I had a self-made USBTinyISP USB programming cable http://www.ladyada.net/make/usbtinyisp/, same as in the photo, except I do not use fixed connectors but just 1-pin plugs at the end of each wire. AdaFruits also sell the USBTinyUSP as a kit for $22. Alternatively, http://www.sparkfun.com/ and their USB-connected Pocket AVR Programmer for $15.

If your computer still has a parallel port (LPT) you may use http://www.captain.at/electronics/atmel-programmer/ as a reference. Important are the "X2" connector pin-out and resistors R1, R2, R4, discard the rest of the circuit. This direct way of connecting the parallel port and an ATTINY microcontroller is a bit risky though. And you still need +5V, this you can get by sacrificing a USB cable, cut the cable in two, strip open the four wires inside the cable and connect the Black wire to GND and the Red wire to +5V/Vcc of the ATTINY, then plug the cable into the USB port.

Step 2: Components

1 * ATTINY2313 microcontroller or 1 x ATTINY13
1 * cheapest 3mm infra-red LED, wavelength around 800..900nm
1 * 10kOhm resistor
1 * push button that makes contact on press (i.e. closing type)
1 * 2-pin on/off switch
1 * small piece of stripboard to solder components onto (kind of optional...)
1 * a few centimeters of thin hook-up wire

Sure, the ATTINY2313 is a quite large controller (20-pin package!) considering only TWO pins are actually required for the infra-red intervalometer. I used this microcontroller as I had one at hand.

You may also use a ATTINY13. When you download the firmware .zip you can find inside it a second AVR Studio project that works on the ATTINY13. The attiny13 is flash memory is filled ~94% so there may not be enough space for adding your own extra features, should you wish to do so.

Power: can use a CR2032 (3.0V) with a holder, or also 3 x 1.5V AAA alkaline, or 4 x 1.2V AAA NiMH rechargables, anything that gives you something between 3.0V and 5.5V. While the circuit does not consume much power and the microcontroller spends most of its time sleeping, for long operation the 3xAAA (or even a 3xAA) battery setup may be better albeit less compact than the CR2032 battery setup.

Programming: I used the USBTinyISP self-made cable, avrdude for flash upload, free Atmel AVR Studio for development.

Step 3: Construction and Firmware

To begin construction, get out your soldering iron! This is a simple one-to-one soldering job. You do not strictly need a circuit board and can just use wires, but for mechanical stability perhaps using a stripboard of your choice is a good idea.

If using ATTINY2313:

To solder you may refer to the schematic, but to write it out in text, the ATTINY2313 pin assignment is:
Pin 2 : pushbutton first lead with other lead connected to GND
Pin 3 : 10k resistor connected to IR LED anode ('+'), and cathode end of LED is connected to GND (cathode is '-' and the lead with the biggest chunk of metal inside the led plastic) .
Pin 10 : GND which is the battery "-"
Pin 20 : +3.0V or battery "+" via a small on/off switch

The firmware is written in C and the project file is inteded for Atmel AVR Studio. The firmware compiles with AVR GCC (part of AVR Studio). The ATTINY pins used when flashing the controller firmware are: 1=Reset, 17=MOSI, 18=MISO, 19=SCL. The firmware and source code is included in the zip file.

How to program the ATTINY with firmware depends on what programming cable you are using! For avrdude and usbtinyisp you can use the program.bat inside the zip file.

Basically the commands for firmware flashing are:

avrdude -c usbtiny -p attiny2313 -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
copy default\intervalometer.hex .
avrdude -c usbtiny -p attiny2313 -U flash:w:intervalometer.hex

You need to program the firmware only once.

If using ATTINY13:

The ATTINY13 pin assignment is different (after all it is an 8-pin and not 20-pin package). Pin 2 is for the IR LED and resistor to ground. Pin 3 is the pusbutton to ground. Pin 4 is ground, pin 8 is +Vcc i.e. the battery '+' via an on/off switch.

For programming, pin 7 is SCL, pin 6 is MISO and pin 5 is MOSI.

avrdude -c usbtiny -p attiny13 -U lfuse:w:0x39:m -U hfuse:w:0xff:m
copy default\intervalometer.hex .
avrdude -c usbtiny -p attiny13 -U flash:w:intervalometer.hex

Step 4: Usage

Camera settings: First choose Bulb mode on your Nikon D90/other: go to Manual mode, then increase exposure time up to 30s and beyond this the camera switches into Bulb mode (LCD: 'bulb' or '--' ). Also switch D90 into IR remote mode via the same button as the 15s self-timer selection mode. In D90 custom settings menu you should increase infrared time-out from 1 minute to 15 minutes, otherwise the D90 exits IR remote mode quickly.

Intervalometer settings: Switch the intervalometer on. It will begin with a learning mode where you teach it the exposure time and the delay between exposures.

1) Point the intervalometer at the Nikon camera.
2) Press the button on the intervalometer. Keep it pressed for the desired duration of the exposure.
3) Release the button.
4) Wait for the desired delay time between exposures.
5) Press the button a second time.

This last button press starts the automatic mode. The camera will continue to make exposures using the settings programmed above.

You should place the intervalometer in front of the camera perhaps on the desk or tape it to your lens.

The automatic mode ends only after you switch the Intervalometer off. So to reconfigure the intervalometer, switch it off and the on again.

About timing precision: In the default firmware the precision of exposure and pause times is 0.5 seconds (or 0.2s for the attiny13). The times are stored into 16-bit integers. The maximum times are 65530*0.5s = 32765 seconds = 9.1 hours each. More than you will practically need, anyhow!

Some closing notes: I did not opt for a wired remote since firstly, the connector on D70 and D90 are different. Secondly, the connector is a rather obscure one, plugs can not be found on Digikey nor in the store and cheapest adapter cables run for around $7. With infra-red however no extra adapter is required and it works on all Nikon cameras.

On the other hand a cabled connection tends to be more reliable in the field. Currently the firmware does not assign any output pin for a cable connection yet, so you can not use a cable at the moment, but it is easy to add this...

Happy shooting!

One extra: IR command sequence: this is what the D70/D90/Dxxx Nikon cameras expect to receive over IR: {2000us ON and 27830us OFF | 390us ON and 1580us OFF | 410us ON and 3580us OFF | 400us ON then OFF} repeated on more time after 63200us. The ON parts are 38kHz modulated so the source code must blink the IR LED for 13us on, 13us off. To reach for example "2000us ON", one needs 77 of such blinks (2000us/26us=76.9).
<p>An alternative way to make a bunch of 30 second exposures with minimal delay between each on a D90 or many other cameras without built in intervalometer is to use a elastic band to hold down the shutter button while the camera is in continuous shooting mode.</p>
Hi again,<br><br>Finally I had some time to play with this... and I was able to make the programme work on my arduino duemilanove.<br><br>But now I'm trying to get it on an ATtiny85 and it seems there are some speed problems, because it does not work.<br><br>I have been reading a little on this, and could it be because the internal oscillator of the ATtiny is working at 20mhz and the arduino has got one external at 16mhz?<br><br>Thanks very much for the answer. <br><br>Greetz.
Hello,<br><br>Very nice project.<br><br>I'd like to do it... but not exactly the same... I don't see the point of controlling the shutter speed from this little device, so I'd rather set the camera with the shutter speed and f number, waiting for a IR signal... and then shoot it from the small device.<br><br>There is no problem with that, right?<br><br>I just would like to know what &quot;orders&quot; or signals do I have to send to the camera so that it understands it's time to shoot.<br><br>I guess there is no problem also to do it with a PIC instead of an ATTINY, right?<br><br>Thanks in advance, and once again, outstanding work!!!
The source code for this remote is for long exposures over 30s (when shutter speed set to 'bulb'/'--') and for making repetetive exposures automatically (intervalometer function).<br><br>Already now you can leave the camera in P/A/S/M mode with self-selected shutter and or f number. And use this intervalometer.<br><br>However the project will repeat the shutter release constantly after the taught delay. For what you want, you will have to remove this auto repeat the source code as well as the &quot;teaching&quot; part.<br><br>I added the IR command sequence to the last page of the instructable. {2000us ON and 27830us OFF | 390us ON and 1580us OFF | 410us ON and 3580us OFF | 400us ON then OFF} repeated once more time after 63200us. The ON parts are 38kHz modulated so must blink the IR LED for 13us on, 13us off, 13us on, 13us off, etc etc.<br><br>Naturally yes you can do this also on PIC or other microcontrollers.<br><br>You can find my PIC source code from an earlier remote (not intervalometer) here http://omapalvelin.homedns.org/electr/d70remote/<br>

About This Instructable




More by jwagnerhki:Infra-red Remote Intervalometer for Nikon Cameras 
Add instructable to: