Introduction: Simple Arduino Camera Trigger

Want to make arty time-lapse videos? Take photos at intervals to show the progression of an event or building something?  Want to find out which neighbourhood cat bully is eating all your cat's food?  All this and more is possible with a triggerable camera remote.

An intervalometer is the general term for a device which triggers your camera to take photos at intervals, but in this case you could also set it to take photos when certain other conditions are met- a change in the reading of a light meter, a pressure sensor, anything your Arduino can measure.

(I say universal-ish because the code contains instructions for a number of makes of camera, but I don't own every camera so can't test them all.  Even within the same make, different models of camera may use different remotes so conceivably, for instance, some Pentaxes could work and others not.  Your camera needs to be triggerable by an IR remote, but that's the only requirement.)

Step 1: Parts List

  • One Arduino. If you don't have an Arduino, you can probably use most microcontrollers but the code will take a little porting. It's mostly quite portable C but you'll have to remove the Arduino-specific functions.
  • IR LED and a 330ish Ohm resistor. You can in theory do without the resistor, because the LED is run at at most a 50% duty cycle for a brief period, but it's better to include.

That's pretty much it. I use a 9V battery clip to power my arduino in the field when I'm using it for star photos.

Step 2: Hardware

The circuit for this make is almost the simplest circuit you can make with an Arduino. Connect the anode of an infrared LED to a digital output, connect the cathode to ground through the resistor.

You can't see the light from the LED so it's a bit difficult to test the circuit. If you want to make absolutely sure that the LED is working, try writing a quick Arduino sketch to blink the LED pin on and off, then pointing a digital camera at the LED- the camera will pick up the IR emitted as a purplish glow.

To set up the intervalometer, you need to position the IR LED so that it is pointing at the sensor, which is usually on the front of your camera. It might be behind a shiny black piece of plastic, which if you're very lucky will have "IR" written on it. If not, just point the intervalometer (or your camera's original remote, if you have it) at various points on the front of your camera and you should find the responsive part fairly quickly.

Step 3: Software

I'm cheating a bit here- the hard work of writing the Arduino code has already been done by Sebastian Setz. His website has disappeared but the code for his MultiCamera library seems to live on in this github repository. Camera IR remotes tend to use a well-known protocol (albeit different codes for different makes of camera), so he's written a library that can output the codes for Canon, Olympus, Sony, Pentax and Minolta cameras.

You set up the library by including the relevant code files:

#include <multiCameraIrControl.h>;

and declaring what make of camera you have, and the Arduino pin that the IR LED is connected to- if you're driving a Canon and have the LED on pin 9, the code should start with

Canon myCamera(9);

before the setup() function. The loop function, at its simplest, then just consists of a call to the shutterNow() function, which emits the remote code for "take a picture now", and a delay:

void loop(){
  myCamera.shutterNow();
  delay(10000);
}
This will emit the "take a picture" code every ten seconds. The delay is the number of milliseconds to wait between pictures- if you want to wait a minute, make the delay 60000. If you want to take triggered photos of a cat food thief with a pressure sensor under your cat bowl, or have some other criteria for triggering, your code will need to test for the condition and call myCamera.shutterNow() at the appropriate point. Make sure to include a small delay after triggering the camera so you don't spam the poor thing with remote control codes endlessly or get stray IR light in your photos.
void loop()
{
  catBowlPressure = analogRead(catSensorPin);
  if (catBowlPressure > catPresenceThreshold)
  {
    myCamera.shutterNow();
    delay(5000);
  }
}