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: http://www.bigmike.it/ircontrol/ 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.
/*
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: http://www.bigmike.it/ircontrol/
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
pulseOFF(1580);
pulseON(410);
pulseOFF(3580);
pulseON(400);
pulseOFF(63200);
} // 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
}
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.
This content is published under the Attribution-Noncommercial-Share Alike 3.0 Unported license.
- Arduino – motion triggered camera
- Arduino – Redefining the TV Remote
- Arduino – (Very) Basic motion tracking with 2 PIR sensors
- Arduino + Processing – 3D Sensor Data Visualisation
- Using Processing to Send Values using the Serial Port to Arduino
- Arduino + Processing – Make a Radar Screen – Part 3: Visualising the Data from Sharp Infrared Range Finder
- Arduino – Using a Sharp IR Sensor for Distance Calculation
- Obstacle avoidance Arduino robot – build your own larryBot
- Arduino & Processing – Getting values from SRF05 ultrasound sensor & serial port
- Control a DC motor with Arduino and L293D chip









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
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!
Sweet!
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: http://www.youtube.com/watch?v=UrsfZBl5w6M
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