Arduino – IR remote/ intervalometer for Nikon D80 DSLR (that means timelapse photography yarrr!)

Nikon D80 + Arduino remote trigger/ intervalometer

I’m cheap and skint, yet I want to do timelapse photography with my Nikon D80 DSLR. Unfortnately that requires spending some cash on an intervalometer for time lapse photography which will set me back a sizeable chunk of cash. Or I could get a remote or get the trigger system then create a delay mechanism to do the timelapse. But again it’d cost a few quid to even get a remote…

Thankfully I already have an Arduino board and a bag of Infrared emitter diodes which I was wondering what I could use them for. So I had a quick scout round the interweb and saw various projects where people had written programs to allow Arduino to work as a TV remote etc.. and I stumbled up on this site: which listed the very IR timing sequence and frequency I would need to trigger my camera. I’m guessing you can find other sequences/ frequencies for other bits of hardware too.

There is no point in me writing up a circuit diagram or parts list for this as you just need an IR diode and an Arduino board. Oh and check that your camera has an Infrared remote port on it or else this is pointless!

Arduino Nikon Intervalometer Remote Code

You will see that basically we blink an IR LED for a set time, wait and repeat to create our signal. The only complicated bits are working out the delays to create the pulse cycle/ wave. Turns out Arduino isn’t so hot at measuring delays in Microseconds so we need to give it a hand keeping track using the micros() function – so we just create a counter to do this and specify an end time for it to count up to.
[ad#Google Ad in content]


LUCKYLARRY.CO.UK - IR Remote control for Nikon using Arduino

Mimics the infrared signal to trigger the remote for any Nikon camera
which can use the ML-L1 and ML-L3 remotes. Can be used as an intervalometer
for time lapse photography.

The IR sequence I used is originally taken from:

You should be able to use my pulse methods to alter to suit other cameras/ hardware.

micros() is an Arduino function that calls the time in Microseconds since your program
first ran. Arduino doesn't reliably work with microseconds so we work our timings by
taking the current reading and then adding our delay on to the end of it rather than rely
on the in built timer.


int pinIRLED = 13;                                      // assign the Infrared emitter/ diode to pin 13

void setup() {
  pinMode(pinIRLED, OUTPUT);                            // set the pin as an output

// sets the pulse of the IR signal.
void pulseON(int pulseTime) {
  unsigned long endPulse = micros() + pulseTime;        // create the microseconds to pulse for
  while( micros() < endPulse) {
    digitalWrite(pinIRLED, HIGH);                       // turn IR on
    delayMicroseconds(13);                              // half the clock cycle for 38Khz (26.32×10-6s) - e.g. the 'on' part of our wave
    digitalWrite(pinIRLED, LOW);                        // turn IR off
    delayMicroseconds(13);                              // delay for the other half of the cycle to generate wave/ oscillation


void pulseOFF(unsigned long startDelay) {
  unsigned long endDelay = micros() + startDelay;       // create the microseconds to delay for
  while(micros() < endDelay);

void takePicture() {
  for (int i=0; i < 2; i++) {
    pulseON(2000);                                      // pulse for 2000 uS (Microseconds)
    pulseOFF(27850);                                    // turn pulse off for 27850 us
    pulseON(390);                                       // and so on
  }                                                     // loop the signal twice.

void loop() {
  takePicture();                                        // take the picture
  delay(5000);                                          // delay in milliseconds which allows us to do timelapse photography - 1 second = 1000 milliseconds

[ad#Google Ad in content]

Ok, so one other thing when using your camera and thats a quick modification to the remote timer, if like mine your infrared camera remote port is set to be active for less than a minute then you'll need to edit the settings accordingly - just check your owner manual. For me it's in the menu screen, custom setting menu, then option 30: Remote on duration.

Now I just got to take some cool timelapse stuff like my friends here:

Which also reminds me to look into CHDK and my Canon Powershot A530 and see what I can do there. :)


  • Thanks for sharing this! Works great with my D60.

    • No problem John. I reckon that this can also be used to build some sort of trip wire system which might be quite handy :)

    • Ok. This didn’t work. I got a 940nm from digikey (actually, a few). None of them work, but I am getting signal test through to a plain old LED. Yes, my camera is set for remote etc. I can trigger it with my ML-L3 just fine. I even have tried being close to the sensor. Also, how does the time-lapse work? My D-80 only lets me set the remote to be on for 15 minutes! Is there an override for that?

  • Hey Larry I tried to make the interval-o-meter but mine doesnt seem to work at all. I bought an IR diode that has a continuous forward current of 150mA. Also I have a D60.

    Any help would be most appreciated. Thanks.

    • Hmm strange. I use lower power diodes. Check the wavelength emitted from the diode should be around 940nm and the frequency your D60 expects should be the same as mine.

      I also found I had to point it directly to the cameras IR sensor oh and make sure your cameras set to remote shutter release mode (which I forgot).

      For debugging, try switching the IR diode for a normal LED to see easier if its flashing, its a good check of your code.

      If you’re in the UK, I could always post you one of my IR leds to see if its that since they’re cheap and I have surplus – I have broken a few when working with this :). Could also be that your higher power diode isn’t getting the power from the Arduino board since they output 40mA per I/O pin and yours needs up to 150mA. (mine uses about 50mA)

  • I just tried this with my Nikon D50 and it works great!

  • Thanks! I was thinking about taking some timelapse with the Nikon D90, and also thought about using Arduino. With just a few clicks on Google, BAM!! Your website came up. After a trip to the electronic store, timelapse with Nikon D90 + Arduino works like a charm! Thanks for sharing! For other people interested in this, but is in the US, Radioshack’s 276-0143 IR LED (5mm, T-1 3/4 case) will do the job.

    • Glad it helped you out. I found though that I had to keep my IR LED quite close to the camera port did you have that issue as well?

      • Yes, I have tried putting it about .5 meters away from the camera, and the camera did not pick up the signal. But, for me, it’s no big deal when taking timelapse, I would just tie the Arduino (along with the batteries) on top of the lens (as fixed focal length and manual focus is used, the lens stays still while shooting). Here is a test shot taken in the Millenium Park in Chicago. Thanks again!

  • I used this code with zero problems. Not a bad solution for a $2 IR LED!

    • I will also add that I used the Radioshack 276-0143 IR LED 5mm. The LED was tested about 2 inches from the sensor. Here is an example of what I did manually with the IR remote previously when out and about. It will be great to automate this now! Next stop… airplanes taking off at night.
      Time Lapse:

      • Wow. Thats a good timelapse! Can’t wait to see what you get when you automate it – post a link back on here is possible :)

  • Thank you Larry for sharing the valuable experience and knowledge.

    • No problem glad you can use it!

  • Hi Larry thanks for sharing. I want to make an intervalometer with an Arduino. My need is to leave the camera set up for days at a time (outdoors in a box) so battery life becomes a big issue. For instance the Kodak P880 I have set up at moment can shoot for days on one battery as it’s built-in intervalometer seems to shut camera functions down between shots. Problem is it stops at 99 shots :/ also don’t want to shot when nothing is happening on site (a building site).

    Does your project leave the camera in stand-by mode b/w shots (I’m using 5min intervals)? How long does your camera battery last?

    I could maybe run power as its on a building site. I’d like a 2-way switch that the foreman can flip in the morning when there is action on site and flip of again in the afternoon to stop my DSLR shooting.

    • Hi Alastair,

      I’m using a digital SLR so its on standby and the battery life will last along time – for my project I just left the camera as default but turned on the remote setting. For the Arduino a 9volt battery power supply should mean this’ll run for a while to – could build in a battery checker for camera and arduino.

      Putting in a 2 way switch is easy enough, just do it at the power source – not sure for the camera though – that might require some hacking.

      Alternatively you can get a cheap(ish) canon powershot or ixus that you can alter the firmware on that will let you do timelapse.

      I want to do some timelapse actually for my lizards so I’ll run the camera and see how many shots I can get before power fails.

  • Thanks for sharing.Works great on D60.

  • Thanks for the excellent post, worked great for the D90

  • Worked like a champ on my D40. I had tried getting the Big Mike timings to work (just got my Arduino, this is the first thing that I tried).

    Beat my head against the wall until reading your comment that the Arduino doesn’t work reliably with microseconds, I think that was the issue.

    Got a handy tip and a nice implementation. Really appreciated!

  • Worked straight away. Thanks for sharing!

  • Amazing! Worked immediately with my D40; I was so startled when the shutter clicked I jumped out of my seat.

  • […] work. On Nikon cameras it’s really easy to remote control them with a wire or ir signals. On Lucky LArry there is some useful code I used for the ir triggering. To this code I added some functions for a […]

  • Thanks for sharing! Worked perfectly fine with a Nikon Coolpix P7000 and IR LED of 850nm.

  • […] Code that would trigger my camera. When I built the arduino version of the shutter release, I used Lucky Larry’s arduino intervalometer code, which includes the timing I […]

  • can u make this program for 8051 microcontrollers please.arduino nd pic r unavailable to me.i have atmel 89s52 one nd programmer for 8051 series.please make a program for me :)

    • I don’t have that chip set, I would imagine that it’ll compile C for it though – must be some resources somewhere on line for that.

      • ahh.can u tell me does it work with atmega 16??does it need any external oscillator???which header file i need to include for atmega 16??

  • Larry, thanks very much for posting this. I just got my first arduino uno and tried this and it immediately worked on my d90. Yee. Haw.

    Going to try and add an lcd and a couple of push buttons on a breadboard in hopes of being able to enter a delay time without a pc. If you’ve got any tips on that, would love to hear them!

    Thanks again!

  • Fantastic! Works great on my D40. I set the exposure to unlimited, so instead of time lapse I get long exposures.

    • To clarify.. set exposure at — with the thumb wheel, then set the seconds in the code (5000ms) to the length you want.

  • AWESOME! I did this on my lunch break at work today… I already so time-lapse, this makes it even easier because I don’t need to bring my laptop (I had been tethering in the past in order to get the intervals correct.)

    Here’s some I did with the laptop tethered:

  • Works great with my Nikon D60. Used a Radio Shack 276-0143 IR Emitter. The only problem is that the D60 remote on duration is 15 min, I need to figure out how this can be made infinite. Thanks!

  • can u please send the code and hex file for atmega 16 or atmega 16a.please…………..

  • Nice one Larry. Threw this together on the arduino, worked a charm first time. Leg end.

    • D5000 here btw too.

  • […] is the demofunction for Nikon, i didnt made this myself, just found it on a forum or weblog (->… ).Following this there a some empty function u can make use of for your own code. void […]

  • Just found out this article a few days ago and just borrowed an Arduino Mega, Im testing this on my d90!! 😀

Join the Discussion

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>